blob: a05d25ff60b9110374fc289711af385877ecad7d [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 = "",
Luiz Capitulino7a7f3252011-09-15 14:20:28 -030066 .mhandler.cmd_new = qmp_marshal_input_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",
Luiz Capitulinoc245b6a2011-12-07 16:02:36 -020087 .mhandler.cmd_new = qmp_marshal_input_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?",
Luiz Capitulino333a96e2011-12-08 11:13:50 -0200113 .mhandler.cmd_new = qmp_marshal_input_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",
Luiz Capitulinoad39cf62012-05-24 13:48:23 -0300149 .mhandler.cmd_new = qmp_marshal_input_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 = "",
Luiz Capitulino5f158f22011-09-15 14:34:39 -0300172 .mhandler.cmd_new = qmp_marshal_input_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 = "",
Luiz Capitulinoe42e8182011-11-22 17:58:31 -0200193 .mhandler.cmd_new = qmp_marshal_input_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 = "",
214 .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
215 },
216
217SQMP
218system_wakeup
219-------------
220
221Wakeup guest from suspend.
222
223Arguments: None.
224
225Example:
226
227-> { "execute": "system_wakeup" }
228<- { "return": {} }
229
230EQMP
231
232 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300233 .name = "system_reset",
234 .args_type = "",
Luiz Capitulino38d22652011-09-15 14:41:46 -0300235 .mhandler.cmd_new = qmp_marshal_input_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 = "",
Luiz Capitulino22e1bb92011-11-27 22:40:03 -0200256 .mhandler.cmd_new = qmp_marshal_input_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",
Luiz Capitulinoa15fef22012-03-29 12:38:50 -0300313 .mhandler.cmd_new = qmp_marshal_input_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?",
Amos Konge4c8f002012-08-31 10:56:26 +0800336 .mhandler.cmd_new = qmp_marshal_input_send_key,
337 },
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",
Luiz Capitulino755f1962011-10-06 14:31:39 -0300367 .mhandler.cmd_new = qmp_marshal_input_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",
392 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
393 },
394
395SQMP
396cpu-add
397-------
398
399Adds virtual cpu
400
401Arguments:
402
403- "id": cpu id (json-int)
404
405Example:
406
407-> { "execute": "cpu-add", "arguments": { "id": 2 } }
408<- { "return": {} }
409
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?",
415 .mhandler.cmd_new = qmp_marshal_input_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",
Luiz Capitulino6d3962b2011-11-22 17:26:46 -0200444 .mhandler.cmd_new = qmp_marshal_input_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 = "",
Luiz Capitulinoab49ab52011-11-23 12:55:53 -0200472 .mhandler.cmd_new = qmp_marshal_input_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 Armbruster3949e592013-02-06 21:27:24 +0100495 .mhandler.cmd_new = qmp_marshal_input_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 Armbruster3949e592013-02-06 21:27:24 +0100526 .mhandler.cmd_new = qmp_marshal_input_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",
562 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
563 },
564
565SQMP
566xen-save-devices-state
567-------
568
569Save the state of all devices to file. The RAM and the block devices
570of the VM are not saved by this command.
571
572Arguments:
573
574- "filename": the file to save the state of the devices to as binary
575data. See xen-save-devices-state.txt for a description of the binary
576format.
577
578Example:
579
580-> { "execute": "xen-save-devices-state",
581 "arguments": { "filename": "/tmp/save" } }
582<- { "return": {} }
583
584EQMP
585
586 {
Anthony PERARD39f42432012-10-03 13:48:19 +0000587 .name = "xen-set-global-dirty-log",
588 .args_type = "enable:b",
589 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
590 },
591
592SQMP
593xen-set-global-dirty-log
594-------
595
596Enable or disable the global dirty log mode.
597
598Arguments:
599
600- "enable": Enable it or disable it.
601
602Example:
603
604-> { "execute": "xen-set-global-dirty-log",
605 "arguments": { "enable": true } }
606<- { "return": {} }
607
608EQMP
609
610 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300611 .name = "migrate",
612 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
Luiz Capitulinoe1c37d02011-12-05 14:48:01 -0200613 .mhandler.cmd_new = qmp_marshal_input_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 = "",
Luiz Capitulino6cdedb02011-11-27 22:54:09 -0200646 .mhandler.cmd_new = qmp_marshal_input_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",
667 .mhandler.cmd_new = qmp_marshal_input_migrate_incoming,
668 },
669
670SQMP
671migrate-incoming
672----------------
673
674Continue an incoming migration
675
676Arguments:
677
678- "uri": Source/listening URI (json-string)
679
680Example:
681
682-> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
683<- { "return": {} }
684
685Notes:
686
687(1) QEMU must be started with -incoming defer to allow migrate-incoming to
688 be used
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",
695 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
696 },
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 = "",
718 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
719 },
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",
Luiz Capitulino3dc85382011-11-28 11:59:37 -0200740 .mhandler.cmd_new = qmp_marshal_input_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",
Luiz Capitulino4f0a9932011-11-27 23:18:01 -0200763 .mhandler.cmd_new = qmp_marshal_input_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 Armbrusterb8a185b2015-03-05 17:29:02 +0100788 .mhandler.cmd_new = qmp_marshal_input_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",
Wen Congyang783e9b42012-05-07 12:10:47 +0800822 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
823 },
824
825SQMP
826dump
827
828
829Dump guest memory to file. The file can be processed with crash or gdb.
830
831Arguments:
832
833- "paging": do paging to get guest's memory mapping (json-bool)
834- "protocol": destination file(started with "file:") or destination file
835 descriptor (started with "fd:") (json-string)
836- "begin": the starting physical address. It's optional, and should be specified
837 with length together (json-int)
838- "length": the memory size, in bytes. It's optional, and should be specified
839 with begin together (json-int)
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 = "",
858 .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability,
859 },
860
861SQMP
862query-dump-guest-memory-capability
863----------
864
865Show available formats for 'dump-guest-memory'
866
867Example:
868
869-> { "execute": "query-dump-guest-memory-capability" }
870<- { "return": { "formats":
871 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
872
873EQMP
874
875 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300876 .name = "netdev_add",
877 .args_type = "netdev:O",
Luiz Capitulino928059a2012-04-18 17:34:15 -0300878 .mhandler.cmd_new = qmp_netdev_add,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300879 },
880
881SQMP
882netdev_add
883----------
884
885Add host network device.
886
887Arguments:
888
889- "type": the device type, "tap", "user", ... (json-string)
890- "id": the device's ID, must be unique (json-string)
891- device options
892
893Example:
894
895-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
896<- { "return": {} }
897
Markus Armbrusteraf347aa2013-02-22 18:31:51 +0100898Note: The supported device options are the same ones supported by the '-netdev'
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300899 command-line argument, which are listed in the '-help' output or QEMU's
900 manual
901
902EQMP
903
904 {
905 .name = "netdev_del",
906 .args_type = "id:s",
Luiz Capitulino5f964152012-04-16 14:36:32 -0300907 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300908 },
909
910SQMP
911netdev_del
912----------
913
914Remove host network device.
915
916Arguments:
917
918- "id": the device's ID, must be unique (json-string)
919
920Example:
921
922-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
923<- { "return": {} }
924
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100925
926EQMP
927
928 {
Paolo Bonzinicff8b2c2013-12-20 23:21:10 +0100929 .name = "object-add",
930 .args_type = "qom-type:s,id:s,props:q?",
931 .mhandler.cmd_new = qmp_object_add,
932 },
933
934SQMP
935object-add
936----------
937
938Create QOM object.
939
940Arguments:
941
942- "qom-type": the object's QOM type, i.e. the class name (json-string)
943- "id": the object's ID, must be unique (json-string)
944- "props": a dictionary of object property values (optional, json-dict)
945
946Example:
947
948-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
949 "props": { "filename": "/dev/hwrng" } } }
950<- { "return": {} }
951
952EQMP
953
954 {
Paolo Bonziniab2d0532013-12-20 23:21:09 +0100955 .name = "object-del",
956 .args_type = "id:s",
957 .mhandler.cmd_new = qmp_marshal_input_object_del,
958 },
959
960SQMP
961object-del
962----------
963
964Remove QOM object.
965
966Arguments:
967
968- "id": the object's ID (json-string)
969
970Example:
971
972-> { "execute": "object-del", "arguments": { "id": "rng1" } }
973<- { "return": {} }
974
975
976EQMP
977
978
979 {
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100980 .name = "block_resize",
Benoît Canet3b1dbd12014-01-23 21:31:37 +0100981 .args_type = "device:s?,node-name:s?,size:o",
Luiz Capitulino5e7caac2011-11-25 14:57:10 -0200982 .mhandler.cmd_new = qmp_marshal_input_block_resize,
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100983 },
984
985SQMP
986block_resize
987------------
988
989Resize a block image while a guest is running.
990
991Arguments:
992
993- "device": the device's ID, must be unique (json-string)
Benoît Canet3b1dbd12014-01-23 21:31:37 +0100994- "node-name": the node name in the block driver state graph (json-string)
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100995- "size": new size
996
997Example:
998
999-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
1000<- { "return": {} }
1001
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001002EQMP
1003
1004 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001005 .name = "block-stream",
Jeff Cody13d8cc52014-06-25 15:40:11 -04001006 .args_type = "device:B,base:s?,speed:o?,backing-file:s?,on-error:s?",
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001007 .mhandler.cmd_new = qmp_marshal_input_block_stream,
1008 },
1009
Stefan Hajnocziec683d62015-04-15 11:43:42 +01001010SQMP
1011block-stream
1012------------
1013
1014Copy data from a backing file into a block device.
1015
1016Arguments:
1017
1018- "device": The device's ID, must be unique (json-string)
1019- "base": The file name of the backing image above which copying starts
1020 (json-string, optional)
1021- "backing-file": The backing file string to write into the active layer. This
1022 filename is not validated.
1023
1024 If a pathname string is such that it cannot be resolved by
1025 QEMU, that means that subsequent QMP or HMP commands must use
1026 node-names for the image in question, as filename lookup
1027 methods will fail.
1028
1029 If not specified, QEMU will automatically determine the
1030 backing file string to use, or error out if there is no
1031 obvious choice. Care should be taken when specifying the
1032 string, to specify a valid filename or protocol.
1033 (json-string, optional) (Since 2.1)
1034- "speed": the maximum speed, in bytes per second (json-int, optional)
1035- "on-error": the action to take on an error (default 'report'). 'stop' and
1036 'enospc' can only be used if the block device supports io-status.
1037 (json-string, optional) (Since 2.1)
1038
1039Example:
1040
1041-> { "execute": "block-stream", "arguments": { "device": "virtio0",
1042 "base": "/tmp/master.qcow2" } }
1043<- { "return": {} }
1044
1045EQMP
1046
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001047 {
Jeff Codyed61fc12012-09-27 13:29:16 -04001048 .name = "block-commit",
Jeff Cody54e26902014-06-25 15:40:10 -04001049 .args_type = "device:B,base:s?,top:s?,backing-file:s?,speed:o?",
Jeff Codyed61fc12012-09-27 13:29:16 -04001050 .mhandler.cmd_new = qmp_marshal_input_block_commit,
1051 },
1052
Jeff Cody37222902014-01-24 09:02:37 -05001053SQMP
1054block-commit
1055------------
1056
1057Live commit of data from overlay image nodes into backing nodes - i.e., writes
1058data between 'top' and 'base' into 'base'.
1059
1060Arguments:
1061
1062- "device": The device's ID, must be unique (json-string)
1063- "base": The file name of the backing image to write data into.
1064 If not specified, this is the deepest backing image
1065 (json-string, optional)
1066- "top": The file name of the backing image within the image chain,
Jeff Cody7676e2c2014-06-30 15:14:15 +02001067 which contains the topmost data to be committed down. If
1068 not specified, this is the active layer. (json-string, optional)
Jeff Cody37222902014-01-24 09:02:37 -05001069
Jeff Cody54e26902014-06-25 15:40:10 -04001070- backing-file: The backing file string to write into the overlay
1071 image of 'top'. If 'top' is the active layer,
1072 specifying a backing file string is an error. This
1073 filename is not validated.
1074
1075 If a pathname string is such that it cannot be
1076 resolved by QEMU, that means that subsequent QMP or
1077 HMP commands must use node-names for the image in
1078 question, as filename lookup methods will fail.
1079
1080 If not specified, QEMU will automatically determine
1081 the backing file string to use, or error out if
1082 there is no obvious choice. Care should be taken
1083 when specifying the string, to specify a valid
1084 filename or protocol.
1085 (json-string, optional) (Since 2.1)
1086
Jeff Cody37222902014-01-24 09:02:37 -05001087 If top == base, that is an error.
1088 If top == active, the job will not be completed by itself,
1089 user needs to complete the job with the block-job-complete
1090 command after getting the ready event. (Since 2.0)
1091
1092 If the base image is smaller than top, then the base image
1093 will be resized to be the same size as top. If top is
1094 smaller than the base image, the base will not be
1095 truncated. If you want the base image size to match the
1096 size of the smaller top, you can safely truncate it
1097 yourself once the commit operation successfully completes.
1098 (json-string)
1099- "speed": the maximum speed, in bytes per second (json-int, optional)
1100
1101
1102Example:
1103
1104-> { "execute": "block-commit", "arguments": { "device": "virtio0",
1105 "top": "/tmp/snap1.qcow2" } }
1106<- { "return": {} }
1107
1108EQMP
1109
Jeff Codyed61fc12012-09-27 13:29:16 -04001110 {
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001111 .name = "drive-backup",
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001112 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
John Snowd58d8452015-04-17 19:49:58 -04001113 "bitmap:s?,on-source-error:s?,on-target-error:s?",
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001114 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
1115 },
1116
1117SQMP
1118drive-backup
1119------------
1120
1121Start a point-in-time copy of a block device to a new destination. The
1122status of ongoing drive-backup operations can be checked with
1123query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1124The operation can be stopped before it has completed using the
1125block-job-cancel command.
1126
1127Arguments:
1128
1129- "device": the name of the device which should be copied.
1130 (json-string)
1131- "target": the target of the new image. If the file exists, or if it is a
1132 device, the existing file/device will be used as the new
1133 destination. If it does not exist, a new file will be created.
1134 (json-string)
1135- "format": the format of the new destination, default is to probe if 'mode' is
1136 'existing', else the format of the source
1137 (json-string, optional)
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001138- "sync": what parts of the disk image should be copied to the destination;
1139 possibilities include "full" for all the disk, "top" for only the sectors
John Snowd58d8452015-04-17 19:49:58 -04001140 allocated in the topmost image, "dirty-bitmap" for only the dirty sectors in
1141 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
1142- "bitmap": dirty bitmap name for sync==dirty-bitmap. Must be present if sync
1143 is "dirty-bitmap", must NOT be present otherwise.
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001144- "mode": whether and how QEMU should create a new image
1145 (NewImageMode, optional, default 'absolute-paths')
1146- "speed": the maximum speed, in bytes per second (json-int, optional)
1147- "on-source-error": the action to take on an error on the source, default
1148 'report'. 'stop' and 'enospc' can only be used
1149 if the block device supports io-status.
1150 (BlockdevOnError, optional)
1151- "on-target-error": the action to take on an error on the target, default
1152 'report' (no limitations, since this applies to
1153 a different block device than device).
1154 (BlockdevOnError, optional)
1155
1156Example:
1157-> { "execute": "drive-backup", "arguments": { "device": "drive0",
Ian Mainfc5d3f82013-07-26 11:39:04 -07001158 "sync": "full",
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001159 "target": "backup.img" } }
1160<- { "return": {} }
Fam Zhengc29c1dd2014-12-18 18:37:05 +08001161
1162EQMP
1163
1164 {
1165 .name = "blockdev-backup",
1166 .args_type = "sync:s,device:B,target:B,speed:i?,"
1167 "on-source-error:s?,on-target-error:s?",
1168 .mhandler.cmd_new = qmp_marshal_input_blockdev_backup,
1169 },
1170
1171SQMP
1172blockdev-backup
1173---------------
1174
1175The device version of drive-backup: this command takes an existing named device
1176as backup target.
1177
1178Arguments:
1179
1180- "device": the name of the device which should be copied.
1181 (json-string)
1182- "target": the name of the backup target device. (json-string)
1183- "sync": what parts of the disk image should be copied to the destination;
1184 possibilities include "full" for all the disk, "top" for only the
1185 sectors allocated in the topmost image, or "none" to only replicate
1186 new I/O (MirrorSyncMode).
1187- "speed": the maximum speed, in bytes per second (json-int, optional)
1188- "on-source-error": the action to take on an error on the source, default
1189 'report'. 'stop' and 'enospc' can only be used
1190 if the block device supports io-status.
1191 (BlockdevOnError, optional)
1192- "on-target-error": the action to take on an error on the target, default
1193 'report' (no limitations, since this applies to
1194 a different block device than device).
1195 (BlockdevOnError, optional)
1196
1197Example:
1198-> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
1199 "sync": "full",
1200 "target": "tgt-id" } }
1201<- { "return": {} }
1202
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001203EQMP
1204
1205 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001206 .name = "block-job-set-speed",
Stefan Hajnoczi882ec7c2012-04-25 16:51:02 +01001207 .args_type = "device:B,speed:o",
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001208 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
1209 },
1210
1211 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001212 .name = "block-job-cancel",
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001213 .args_type = "device:B,force:b?",
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001214 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
1215 },
Jeff Codyc1864022012-02-28 15:54:07 -05001216 {
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001217 .name = "block-job-pause",
1218 .args_type = "device:B",
1219 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
1220 },
1221 {
1222 .name = "block-job-resume",
1223 .args_type = "device:B",
1224 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
1225 },
1226 {
Paolo Bonziniaeae8832012-10-18 16:49:21 +02001227 .name = "block-job-complete",
1228 .args_type = "device:B",
1229 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
1230 },
1231 {
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001232 .name = "transaction",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01001233 .args_type = "actions:q",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001234 .mhandler.cmd_new = qmp_marshal_input_transaction,
Jeff Codyc1864022012-02-28 15:54:07 -05001235 },
1236
1237SQMP
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001238transaction
1239-----------
Jeff Codyc1864022012-02-28 15:54:07 -05001240
Wenchao Xiabbe86012013-09-11 14:04:34 +08001241Atomically operate on one or more block devices. The only supported operations
1242for now are drive-backup, internal and external snapshotting. A list of
1243dictionaries is accepted, that contains the actions to be performed.
1244If there is any failure performing any of the operations, all operations
1245for the group are abandoned.
Jeff Codyc1864022012-02-28 15:54:07 -05001246
Wenchao Xiabbe86012013-09-11 14:04:34 +08001247For external snapshots, the dictionary contains the device, the file to use for
1248the new snapshot, and the format. The default format, if not specified, is
1249qcow2.
Jeff Codyc1864022012-02-28 15:54:07 -05001250
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001251Each new snapshot defaults to being created by QEMU (wiping any
1252contents if the file already exists), but it is also possible to reuse
1253an externally-created file. In the latter case, you should ensure that
1254the new image file has the same contents as the current one; QEMU cannot
1255perform any meaningful check. Typically this is achieved by using the
1256current image file as the backing file for the new image.
1257
Wenchao Xiabbe86012013-09-11 14:04:34 +08001258On failure, the original disks pre-snapshot attempt will be used.
1259
1260For internal snapshots, the dictionary contains the device and the snapshot's
1261name. If an internal snapshot matching name already exists, the request will
1262be rejected. Only some image formats support it, for example, qcow2, rbd,
1263and sheepdog.
1264
1265On failure, qemu will try delete the newly created internal snapshot in the
1266transaction. When an I/O error occurs during deletion, the user needs to fix
1267it later with qemu-img or other command.
1268
Jeff Codyc1864022012-02-28 15:54:07 -05001269Arguments:
1270
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001271actions array:
1272 - "type": the operation to perform. The only supported
1273 value is "blockdev-snapshot-sync". (json-string)
1274 - "data": a dictionary. The contents depend on the value
1275 of "type". When "type" is "blockdev-snapshot-sync":
1276 - "device": device name to snapshot (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001277 - "node-name": graph node name to snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001278 - "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001279 - "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001280 - "format": format of new image (json-string, optional)
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001281 - "mode": whether and how QEMU should create the snapshot file
1282 (NewImageMode, optional, default "absolute-paths")
Wenchao Xiabbe86012013-09-11 14:04:34 +08001283 When "type" is "blockdev-snapshot-internal-sync":
1284 - "device": device name to snapshot (json-string)
1285 - "name": name of the new snapshot (json-string)
Jeff Codyc1864022012-02-28 15:54:07 -05001286
1287Example:
1288
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001289-> { "execute": "transaction",
1290 "arguments": { "actions": [
Eric Blakecd0c5382014-05-06 09:39:03 -06001291 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001292 "snapshot-file": "/some/place/my-image",
1293 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001294 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
Benoît Canet0901f672014-01-23 21:31:38 +01001295 "snapshot-file": "/some/place/my-image2",
1296 "snapshot-node-name": "node3432",
1297 "mode": "existing",
1298 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001299 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001300 "snapshot-file": "/some/place/my-image2",
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001301 "mode": "existing",
Wenchao Xiabbe86012013-09-11 14:04:34 +08001302 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001303 { "type": "blockdev-snapshot-internal-sync", "data" : {
Wenchao Xiabbe86012013-09-11 14:04:34 +08001304 "device": "ide-hd2",
1305 "name": "snapshot0" } } ] } }
Jeff Codyc1864022012-02-28 15:54:07 -05001306<- { "return": {} }
1307
1308EQMP
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001309
1310 {
John Snow341ebc22015-04-17 19:49:52 -04001311 .name = "block-dirty-bitmap-add",
1312 .args_type = "node:B,name:s,granularity:i?",
1313 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_add,
1314 },
1315
1316SQMP
1317
1318block-dirty-bitmap-add
1319----------------------
1320Since 2.4
1321
1322Create a dirty bitmap with a name on the device, and start tracking the writes.
1323
1324Arguments:
1325
1326- "node": device/node on which to create dirty bitmap (json-string)
1327- "name": name of the new dirty bitmap (json-string)
1328- "granularity": granularity to track writes with (int, optional)
1329
1330Example:
1331
1332-> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1333 "name": "bitmap0" } }
1334<- { "return": {} }
1335
1336EQMP
1337
1338 {
1339 .name = "block-dirty-bitmap-remove",
1340 .args_type = "node:B,name:s",
1341 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_remove,
1342 },
1343
1344SQMP
1345
1346block-dirty-bitmap-remove
1347-------------------------
1348Since 2.4
1349
1350Stop write tracking and remove the dirty bitmap that was created with
1351block-dirty-bitmap-add.
1352
1353Arguments:
1354
1355- "node": device/node on which to remove dirty bitmap (json-string)
1356- "name": name of the dirty bitmap to remove (json-string)
1357
1358Example:
1359
1360-> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1361 "name": "bitmap0" } }
1362<- { "return": {} }
1363
1364EQMP
1365
1366 {
John Snowe74e6b72015-04-17 19:49:59 -04001367 .name = "block-dirty-bitmap-clear",
1368 .args_type = "node:B,name:s",
1369 .mhandler.cmd_new = qmp_marshal_input_block_dirty_bitmap_clear,
1370 },
1371
1372SQMP
1373
1374block-dirty-bitmap-clear
1375------------------------
1376Since 2.4
1377
1378Reset the dirty bitmap associated with a node so that an incremental backup
1379from this point in time forward will only backup clusters modified after this
1380clear operation.
1381
1382Arguments:
1383
1384- "node": device/node on which to remove dirty bitmap (json-string)
1385- "name": name of the dirty bitmap to remove (json-string)
1386
1387Example:
1388
1389-> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1390 "name": "bitmap0" } }
1391<- { "return": {} }
1392
1393EQMP
1394
1395 {
Jes Sorensend967b2f2011-07-11 20:01:09 +02001396 .name = "blockdev-snapshot-sync",
Benoît Canet0901f672014-01-23 21:31:38 +01001397 .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?",
Luiz Capitulino6106e242011-11-25 16:15:19 -02001398 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
Jes Sorensend967b2f2011-07-11 20:01:09 +02001399 },
1400
1401SQMP
1402blockdev-snapshot-sync
1403----------------------
1404
1405Synchronous snapshot of a block device. snapshot-file specifies the
1406target of the new image. If the file exists, or if it is a device, the
1407snapshot will be created in the existing file/device. If does not
1408exist, a new file will be created. format specifies the format of the
1409snapshot image, default is qcow2.
1410
1411Arguments:
1412
1413- "device": device name to snapshot (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001414- "node-name": graph node name to snapshot (json-string)
Jes Sorensend967b2f2011-07-11 20:01:09 +02001415- "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001416- "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001417- "mode": whether and how QEMU should create the snapshot file
1418 (NewImageMode, optional, default "absolute-paths")
Jes Sorensend967b2f2011-07-11 20:01:09 +02001419- "format": format of new image (json-string, optional)
1420
1421Example:
1422
Luiz Capitulino7f3850c2011-10-10 17:30:08 -03001423-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1424 "snapshot-file":
1425 "/some/place/my-image",
1426 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +02001427<- { "return": {} }
1428
1429EQMP
1430
1431 {
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001432 .name = "blockdev-snapshot-internal-sync",
1433 .args_type = "device:B,name:s",
1434 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1435 },
1436
1437SQMP
1438blockdev-snapshot-internal-sync
1439-------------------------------
1440
1441Synchronously take an internal snapshot of a block device when the format of
1442image used supports it. If the name is an empty string, or a snapshot with
1443name already exists, the operation will fail.
1444
1445Arguments:
1446
1447- "device": device name to snapshot (json-string)
1448- "name": name of the new snapshot (json-string)
1449
1450Example:
1451
1452-> { "execute": "blockdev-snapshot-internal-sync",
1453 "arguments": { "device": "ide-hd0",
1454 "name": "snapshot0" }
1455 }
1456<- { "return": {} }
1457
1458EQMP
1459
1460 {
Wenchao Xia44e3e052013-09-11 14:04:36 +08001461 .name = "blockdev-snapshot-delete-internal-sync",
1462 .args_type = "device:B,id:s?,name:s?",
1463 .mhandler.cmd_new =
1464 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1465 },
1466
1467SQMP
1468blockdev-snapshot-delete-internal-sync
1469--------------------------------------
1470
1471Synchronously delete an internal snapshot of a block device when the format of
1472image used supports it. The snapshot is identified by name or id or both. One
1473of name or id is required. If the snapshot is not found, the operation will
1474fail.
1475
1476Arguments:
1477
1478- "device": device name (json-string)
1479- "id": ID of the snapshot (json-string, optional)
1480- "name": name of the snapshot (json-string, optional)
1481
1482Example:
1483
1484-> { "execute": "blockdev-snapshot-delete-internal-sync",
1485 "arguments": { "device": "ide-hd0",
1486 "name": "snapshot0" }
1487 }
1488<- { "return": {
1489 "id": "1",
1490 "name": "snapshot0",
1491 "vm-state-size": 0,
1492 "date-sec": 1000012,
1493 "date-nsec": 10,
1494 "vm-clock-sec": 100,
1495 "vm-clock-nsec": 20
1496 }
1497 }
1498
1499EQMP
1500
1501 {
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001502 .name = "drive-mirror",
Paolo Bonzinib952b552012-10-18 16:49:28 +02001503 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
Benoît Canet09158f02014-06-27 18:25:25 +02001504 "node-name:s?,replaces:s?,"
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001505 "on-source-error:s?,on-target-error:s?,"
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001506 "granularity:i?,buf-size:i?",
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001507 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1508 },
1509
1510SQMP
1511drive-mirror
1512------------
1513
1514Start mirroring a block device's writes to a new destination. target
1515specifies the target of the new image. If the file exists, or if it is
1516a device, it will be used as the new destination for writes. If it does not
1517exist, a new file will be created. format specifies the format of the
1518mirror image, default is to probe if mode='existing', else the format
1519of the source.
1520
1521Arguments:
1522
1523- "device": device name to operate on (json-string)
1524- "target": name of new image file (json-string)
1525- "format": format of new image (json-string, optional)
Benoît Canet4c828dc2014-06-16 12:00:55 +02001526- "node-name": the name of the new block driver state in the node graph
1527 (json-string, optional)
Benoît Canet09158f02014-06-27 18:25:25 +02001528- "replaces": the block driver node name to replace when finished
1529 (json-string, optional)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001530- "mode": how an image file should be created into the target
1531 file/device (NewImageMode, optional, default 'absolute-paths')
1532- "speed": maximum speed of the streaming job, in bytes per second
1533 (json-int)
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001534- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001535- "buf_size": maximum amount of data in flight from source to target, in bytes
1536 (json-int, default 10M)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001537- "sync": what parts of the disk image should be copied to the destination;
1538 possibilities include "full" for all the disk, "top" for only the sectors
1539 allocated in the topmost image, or "none" to only replicate new I/O
1540 (MirrorSyncMode).
Paolo Bonzinib952b552012-10-18 16:49:28 +02001541- "on-source-error": the action to take on an error on the source
1542 (BlockdevOnError, default 'report')
1543- "on-target-error": the action to take on an error on the target
1544 (BlockdevOnError, default 'report')
1545
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001546The default value of the granularity is the image cluster size clamped
1547between 4096 and 65536, if the image format defines one. If the format
1548does not define a cluster size, the default value of the granularity
1549is 65536.
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001550
1551
1552Example:
1553
1554-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1555 "target": "/some/place/my-image",
1556 "sync": "full",
1557 "format": "qcow2" } }
1558<- { "return": {} }
1559
1560EQMP
1561
1562 {
Jeff Codyfa40e652014-07-01 09:52:16 +02001563 .name = "change-backing-file",
1564 .args_type = "device:s,image-node-name:s,backing-file:s",
1565 .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
1566 },
1567
1568SQMP
1569change-backing-file
1570-------------------
1571Since: 2.1
1572
1573Change the backing file in the image file metadata. This does not cause
1574QEMU to reopen the image file to reparse the backing filename (it may,
1575however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1576if needed). The new backing file string is written into the image file
1577metadata, and the QEMU internal strings are updated.
1578
1579Arguments:
1580
1581- "image-node-name": The name of the block driver state node of the
1582 image to modify. The "device" is argument is used to
1583 verify "image-node-name" is in the chain described by
1584 "device".
1585 (json-string, optional)
1586
1587- "device": The name of the device.
1588 (json-string)
1589
1590- "backing-file": The string to write as the backing file. This string is
1591 not validated, so care should be taken when specifying
1592 the string or the image chain may not be able to be
1593 reopened again.
1594 (json-string)
1595
1596Returns: Nothing on success
1597 If "device" does not exist or cannot be determined, DeviceNotFound
1598
1599EQMP
1600
1601 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001602 .name = "balloon",
1603 .args_type = "value:M",
Luiz Capitulinod72f3262011-11-25 14:38:09 -02001604 .mhandler.cmd_new = qmp_marshal_input_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001605 },
1606
1607SQMP
1608balloon
1609-------
1610
1611Request VM to change its memory allocation (in bytes).
1612
1613Arguments:
1614
1615- "value": New memory allocation (json-int)
1616
1617Example:
1618
1619-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1620<- { "return": {} }
1621
1622EQMP
1623
1624 {
1625 .name = "set_link",
1626 .args_type = "name:s,up:b",
Luiz Capitulino4b371562011-11-23 13:11:55 -02001627 .mhandler.cmd_new = qmp_marshal_input_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001628 },
1629
1630SQMP
1631set_link
1632--------
1633
1634Change the link status of a network adapter.
1635
1636Arguments:
1637
1638- "name": network device name (json-string)
1639- "up": status is up (json-bool)
1640
1641Example:
1642
1643-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1644<- { "return": {} }
1645
1646EQMP
1647
1648 {
1649 .name = "getfd",
1650 .args_type = "fdname:s",
1651 .params = "getfd name",
1652 .help = "receive a file descriptor via SCM rights and assign it a name",
Corey Bryant208c9d12012-06-22 14:36:09 -04001653 .mhandler.cmd_new = qmp_marshal_input_getfd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001654 },
1655
1656SQMP
1657getfd
1658-----
1659
1660Receive a file descriptor via SCM rights and assign it a name.
1661
1662Arguments:
1663
1664- "fdname": file descriptor name (json-string)
1665
1666Example:
1667
1668-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1669<- { "return": {} }
1670
Corey Bryant208c9d12012-06-22 14:36:09 -04001671Notes:
1672
1673(1) If the name specified by the "fdname" argument already exists,
1674 the file descriptor assigned to it will be closed and replaced
1675 by the received file descriptor.
1676(2) The 'closefd' command can be used to explicitly close the file
1677 descriptor when it is no longer needed.
1678
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001679EQMP
1680
1681 {
1682 .name = "closefd",
1683 .args_type = "fdname:s",
1684 .params = "closefd name",
1685 .help = "close a file descriptor previously passed via SCM rights",
Corey Bryant208c9d12012-06-22 14:36:09 -04001686 .mhandler.cmd_new = qmp_marshal_input_closefd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001687 },
1688
1689SQMP
1690closefd
1691-------
1692
1693Close a file descriptor previously passed via SCM rights.
1694
1695Arguments:
1696
1697- "fdname": file descriptor name (json-string)
1698
1699Example:
1700
1701-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1702<- { "return": {} }
1703
1704EQMP
1705
Corey Bryantba1c0482012-08-14 16:43:43 -04001706 {
1707 .name = "add-fd",
1708 .args_type = "fdset-id:i?,opaque:s?",
1709 .params = "add-fd fdset-id opaque",
1710 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1711 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1712 },
1713
1714SQMP
1715add-fd
1716-------
1717
1718Add a file descriptor, that was passed via SCM rights, to an fd set.
1719
1720Arguments:
1721
1722- "fdset-id": The ID of the fd set to add the file descriptor to.
1723 (json-int, optional)
1724- "opaque": A free-form string that can be used to describe the fd.
1725 (json-string, optional)
1726
1727Return a json-object with the following information:
1728
1729- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1730- "fd": The file descriptor that was received via SCM rights and added to the
1731 fd set. (json-int)
1732
1733Example:
1734
1735-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1736<- { "return": { "fdset-id": 1, "fd": 3 } }
1737
1738Notes:
1739
1740(1) The list of fd sets is shared by all monitor connections.
1741(2) If "fdset-id" is not specified, a new fd set will be created.
1742
1743EQMP
1744
1745 {
1746 .name = "remove-fd",
1747 .args_type = "fdset-id:i,fd:i?",
1748 .params = "remove-fd fdset-id fd",
1749 .help = "Remove a file descriptor from an fd set",
1750 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1751 },
1752
1753SQMP
1754remove-fd
1755---------
1756
1757Remove a file descriptor from an fd set.
1758
1759Arguments:
1760
1761- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1762 (json-int)
1763- "fd": The file descriptor that is to be removed. (json-int, optional)
1764
1765Example:
1766
1767-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1768<- { "return": {} }
1769
1770Notes:
1771
1772(1) The list of fd sets is shared by all monitor connections.
1773(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1774 removed.
1775
1776EQMP
1777
1778 {
1779 .name = "query-fdsets",
1780 .args_type = "",
1781 .help = "Return information describing all fd sets",
1782 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1783 },
1784
1785SQMP
1786query-fdsets
1787-------------
1788
1789Return information describing all fd sets.
1790
1791Arguments: None
1792
1793Example:
1794
1795-> { "execute": "query-fdsets" }
1796<- { "return": [
1797 {
1798 "fds": [
1799 {
1800 "fd": 30,
1801 "opaque": "rdonly:/path/to/file"
1802 },
1803 {
1804 "fd": 24,
1805 "opaque": "rdwr:/path/to/file"
1806 }
1807 ],
1808 "fdset-id": 1
1809 },
1810 {
1811 "fds": [
1812 {
1813 "fd": 28
1814 },
1815 {
1816 "fd": 29
1817 }
1818 ],
1819 "fdset-id": 0
1820 }
1821 ]
1822 }
1823
1824Note: The list of fd sets is shared by all monitor connections.
1825
1826EQMP
1827
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001828 {
1829 .name = "block_passwd",
Benoît Canet12d3ba82014-01-23 21:31:35 +01001830 .args_type = "device:s?,node-name:s?,password:s",
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -02001831 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001832 },
1833
1834SQMP
1835block_passwd
1836------------
1837
1838Set the password of encrypted block devices.
1839
1840Arguments:
1841
1842- "device": device name (json-string)
Benoît Canet12d3ba82014-01-23 21:31:35 +01001843- "node-name": name in the block driver state graph (json-string)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001844- "password": password (json-string)
1845
1846Example:
1847
1848-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1849 "password": "12345" } }
1850<- { "return": {} }
1851
1852EQMP
1853
1854 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001855 .name = "block_set_io_throttle",
Alberto Garcia76f4afb2015-06-08 18:17:44 +02001856 .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?",
Luiz Capitulino80047da2011-12-14 16:49:14 -02001857 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001858 },
1859
1860SQMP
1861block_set_io_throttle
1862------------
1863
1864Change I/O throttle limits for a block drive.
1865
1866Arguments:
1867
1868- "device": device name (json-string)
Eric Blake586b5462013-08-30 14:44:11 -06001869- "bps": total throughput limit in bytes per second (json-int)
1870- "bps_rd": read throughput limit in bytes per second (json-int)
1871- "bps_wr": write throughput limit in bytes per second (json-int)
1872- "iops": total I/O operations per second (json-int)
1873- "iops_rd": read I/O operations per second (json-int)
1874- "iops_wr": write I/O operations per second (json-int)
Benoît Canet3e9fab62013-09-02 14:14:40 +02001875- "bps_max": total max in bytes (json-int)
1876- "bps_rd_max": read max in bytes (json-int)
1877- "bps_wr_max": write max in bytes (json-int)
1878- "iops_max": total I/O operations max (json-int)
1879- "iops_rd_max": read I/O operations max (json-int)
1880- "iops_wr_max": write I/O operations max (json-int)
Benoît Canet2024c1d2013-09-02 14:14:41 +02001881- "iops_size": I/O size in bytes when limiting (json-int)
Alberto Garcia76f4afb2015-06-08 18:17:44 +02001882- "group": throttle group name (json-string)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001883
1884Example:
1885
1886-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
Eric Blake586b5462013-08-30 14:44:11 -06001887 "bps": 1000000,
1888 "bps_rd": 0,
1889 "bps_wr": 0,
1890 "iops": 0,
1891 "iops_rd": 0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02001892 "iops_wr": 0,
1893 "bps_max": 8000000,
1894 "bps_rd_max": 0,
1895 "bps_wr_max": 0,
1896 "iops_max": 0,
1897 "iops_rd_max": 0,
Benoît Canet2024c1d2013-09-02 14:14:41 +02001898 "iops_wr_max": 0,
1899 "iops_size": 0 } }
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001900<- { "return": {} }
1901
1902EQMP
1903
1904 {
Gerd Hoffmann75721502010-10-07 12:22:54 +02001905 .name = "set_password",
1906 .args_type = "protocol:s,password:s,connected:s?",
Luiz Capitulinofbf796f2011-12-07 11:17:51 -02001907 .mhandler.cmd_new = qmp_marshal_input_set_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001908 },
1909
1910SQMP
1911set_password
1912------------
1913
1914Set the password for vnc/spice protocols.
1915
1916Arguments:
1917
1918- "protocol": protocol name (json-string)
1919- "password": password (json-string)
Alberto Garcia3599d462015-02-26 16:35:07 +02001920- "connected": [ keep | disconnect | fail ] (json-string, optional)
Gerd Hoffmann75721502010-10-07 12:22:54 +02001921
1922Example:
1923
1924-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1925 "password": "secret" } }
1926<- { "return": {} }
1927
1928EQMP
1929
1930 {
1931 .name = "expire_password",
1932 .args_type = "protocol:s,time:s",
Luiz Capitulino9ad53722011-12-07 11:47:57 -02001933 .mhandler.cmd_new = qmp_marshal_input_expire_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001934 },
1935
1936SQMP
1937expire_password
1938---------------
1939
1940Set the password expire time for vnc/spice protocols.
1941
1942Arguments:
1943
1944- "protocol": protocol name (json-string)
1945- "time": [ now | never | +secs | secs ] (json-string)
1946
1947Example:
1948
1949-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1950 "time": "+60" } }
1951<- { "return": {} }
1952
1953EQMP
1954
1955 {
Daniel P. Berrange13661082011-06-23 13:31:42 +01001956 .name = "add_client",
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001957 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
Luiz Capitulinob224e5e2012-09-13 16:52:20 -03001958 .mhandler.cmd_new = qmp_marshal_input_add_client,
Daniel P. Berrange13661082011-06-23 13:31:42 +01001959 },
1960
1961SQMP
1962add_client
1963----------
1964
1965Add a graphics client
1966
1967Arguments:
1968
1969- "protocol": protocol name (json-string)
1970- "fdname": file descriptor name (json-string)
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001971- "skipauth": whether to skip authentication (json-bool, optional)
1972- "tls": whether to perform TLS (json-bool, optional)
Daniel P. Berrange13661082011-06-23 13:31:42 +01001973
1974Example:
1975
1976-> { "execute": "add_client", "arguments": { "protocol": "vnc",
1977 "fdname": "myclient" } }
1978<- { "return": {} }
1979
1980EQMP
1981 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001982 .name = "qmp_capabilities",
1983 .args_type = "",
1984 .params = "",
1985 .help = "enable QMP capabilities",
Markus Armbruster485febc2015-03-13 17:25:50 +01001986 .mhandler.cmd_new = qmp_capabilities,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001987 },
1988
1989SQMP
1990qmp_capabilities
1991----------------
1992
1993Enable QMP capabilities.
1994
1995Arguments: None.
1996
1997Example:
1998
1999-> { "execute": "qmp_capabilities" }
2000<- { "return": {} }
2001
2002Note: This command must be issued before issuing any other command.
2003
Luiz Capitulino0268d972010-10-22 10:08:02 -02002004EQMP
2005
2006 {
2007 .name = "human-monitor-command",
2008 .args_type = "command-line:s,cpu-index:i?",
Luiz Capitulinod51a67b2011-11-25 17:52:45 -02002009 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
Luiz Capitulino0268d972010-10-22 10:08:02 -02002010 },
2011
2012SQMP
2013human-monitor-command
2014---------------------
2015
2016Execute a Human Monitor command.
2017
2018Arguments:
2019
2020- command-line: the command name and its arguments, just like the
2021 Human Monitor's shell (json-string)
2022- cpu-index: select the CPU number to be used by commands which access CPU
2023 data, like 'info registers'. The Monitor selects CPU 0 if this
2024 argument is not provided (json-int, optional)
2025
2026Example:
2027
2028-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
2029<- { "return": "kvm support: enabled\r\n" }
2030
2031Notes:
2032
2033(1) The Human Monitor is NOT an stable interface, this means that command
2034 names, arguments and responses can change or be removed at ANY time.
2035 Applications that rely on long term stability guarantees should NOT
2036 use this command
2037
2038(2) Limitations:
2039
2040 o This command is stateless, this means that commands that depend
2041 on state information (such as getfd) might not work
2042
2043 o Commands that prompt the user for data (eg. 'cont' when the block
2044 device is encrypted) don't currently work
2045
Luiz Capitulino82a56f02010-09-13 12:26:00 -030020463. Query Commands
2047=================
2048
2049HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
2050HXCOMM this! We will possibly move query commands definitions inside those
2051HXCOMM sections, just like regular commands.
2052
2053EQMP
2054
2055SQMP
2056query-version
2057-------------
2058
2059Show QEMU version.
2060
2061Return a json-object with the following information:
2062
2063- "qemu": A json-object containing three integer values:
2064 - "major": QEMU's major version (json-int)
2065 - "minor": QEMU's minor version (json-int)
2066 - "micro": QEMU's micro version (json-int)
2067- "package": package's version (json-string)
2068
2069Example:
2070
2071-> { "execute": "query-version" }
2072<- {
2073 "return":{
2074 "qemu":{
2075 "major":0,
2076 "minor":11,
2077 "micro":5
2078 },
2079 "package":""
2080 }
2081 }
2082
2083EQMP
2084
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03002085 {
2086 .name = "query-version",
2087 .args_type = "",
2088 .mhandler.cmd_new = qmp_marshal_input_query_version,
2089 },
2090
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002091SQMP
2092query-commands
2093--------------
2094
2095List QMP available commands.
2096
2097Each command is represented by a json-object, the returned value is a json-array
2098of all commands.
2099
2100Each json-object contain:
2101
2102- "name": command's name (json-string)
2103
2104Example:
2105
2106-> { "execute": "query-commands" }
2107<- {
2108 "return":[
2109 {
2110 "name":"query-balloon"
2111 },
2112 {
2113 "name":"system_powerdown"
2114 }
2115 ]
2116 }
2117
2118Note: This example has been shortened as the real response is too long.
2119
2120EQMP
2121
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03002122 {
2123 .name = "query-commands",
2124 .args_type = "",
2125 .mhandler.cmd_new = qmp_marshal_input_query_commands,
2126 },
2127
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002128SQMP
Daniel P. Berrange48608532012-05-21 17:59:51 +01002129query-events
2130--------------
2131
2132List QMP available events.
2133
2134Each event is represented by a json-object, the returned value is a json-array
2135of all events.
2136
2137Each json-object contains:
2138
2139- "name": event's name (json-string)
2140
2141Example:
2142
2143-> { "execute": "query-events" }
2144<- {
2145 "return":[
2146 {
2147 "name":"SHUTDOWN"
2148 },
2149 {
2150 "name":"RESET"
2151 }
2152 ]
2153 }
2154
2155Note: This example has been shortened as the real response is too long.
2156
2157EQMP
2158
2159 {
2160 .name = "query-events",
2161 .args_type = "",
2162 .mhandler.cmd_new = qmp_marshal_input_query_events,
2163 },
2164
2165SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002166query-chardev
2167-------------
2168
2169Each device is represented by a json-object. The returned value is a json-array
2170of all devices.
2171
2172Each json-object contain the following:
2173
2174- "label": device's label (json-string)
2175- "filename": device's file (json-string)
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002176- "frontend-open": open/closed state of the frontend device attached to this
2177 backend (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002178
2179Example:
2180
2181-> { "execute": "query-chardev" }
2182<- {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002183 "return": [
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002184 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002185 "label": "charchannel0",
2186 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
2187 "frontend-open": false
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002188 },
2189 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02002190 "label": "charmonitor",
2191 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
2192 "frontend-open": true
2193 },
2194 {
2195 "label": "charserial0",
2196 "filename": "pty:/dev/pts/2",
2197 "frontend-open": true
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002198 }
2199 ]
2200 }
2201
2202EQMP
2203
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03002204 {
2205 .name = "query-chardev",
2206 .args_type = "",
2207 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
2208 },
2209
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002210SQMP
Martin Kletzander77d1c3c2014-02-01 12:52:42 +01002211query-chardev-backends
2212-------------
2213
2214List available character device backends.
2215
2216Each backend is represented by a json-object, the returned value is a json-array
2217of all backends.
2218
2219Each json-object contains:
2220
2221- "name": backend name (json-string)
2222
2223Example:
2224
2225-> { "execute": "query-chardev-backends" }
2226<- {
2227 "return":[
2228 {
2229 "name":"udp"
2230 },
2231 {
2232 "name":"tcp"
2233 },
2234 {
2235 "name":"unix"
2236 },
2237 {
2238 "name":"spiceport"
2239 }
2240 ]
2241 }
2242
2243EQMP
2244
2245 {
2246 .name = "query-chardev-backends",
2247 .args_type = "",
2248 .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
2249 },
2250
2251SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002252query-block
2253-----------
2254
2255Show the block devices.
2256
2257Each block device information is stored in a json-object and the returned value
2258is a json-array of all devices.
2259
2260Each json-object contain the following:
2261
2262- "device": device name (json-string)
2263- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002264 - deprecated, retained for backward compatibility
2265 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002266- "removable": true if the device is removable, false otherwise (json-bool)
2267- "locked": true if the device is locked, false otherwise (json-bool)
Michal Privoznik99f42802013-01-29 17:58:41 +01002268- "tray_open": only present if removable, true if the device has a tray,
Markus Armbrustere4def802011-09-06 18:58:53 +02002269 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002270- "inserted": only present if the device is inserted, it is a json-object
2271 containing the following:
2272 - "file": device file name (json-string)
2273 - "ro": true if read-only, false otherwise (json-bool)
2274 - "drv": driver format name (json-string)
Stefan Hajnoczi550830f2014-09-16 15:24:24 +01002275 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002276 "file", "file", "ftp", "ftps", "host_cdrom",
Markus Armbruster92a539d2015-03-17 17:02:20 +01002277 "host_device", "http", "https",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002278 "nbd", "parallels", "qcow", "qcow2", "raw",
2279 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2280 - "backing_file": backing file name (json-string, optional)
Benoît Canet2e3e3312012-08-02 10:22:48 +02002281 - "backing_file_depth": number of files in the backing file chain (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002282 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002283 - "bps": limit total bytes per second (json-int)
2284 - "bps_rd": limit read bytes per second (json-int)
2285 - "bps_wr": limit write bytes per second (json-int)
2286 - "iops": limit total I/O operations per second (json-int)
2287 - "iops_rd": limit read operations per second (json-int)
2288 - "iops_wr": limit write operations per second (json-int)
Benoît Canet3e9fab62013-09-02 14:14:40 +02002289 - "bps_max": total max in bytes (json-int)
2290 - "bps_rd_max": read max in bytes (json-int)
2291 - "bps_wr_max": write max in bytes (json-int)
2292 - "iops_max": total I/O operations max (json-int)
2293 - "iops_rd_max": read I/O operations max (json-int)
2294 - "iops_wr_max": write I/O operations max (json-int)
Benoît Canet2024c1d2013-09-02 14:14:41 +02002295 - "iops_size": I/O size when limiting by iops (json-int)
Peter Lieven465bee12014-05-18 00:58:19 +02002296 - "detect_zeroes": detect and optimize zero writing (json-string)
2297 - Possible values: "off", "on", "unmap"
Francesco Romanie2462112015-01-12 14:11:13 +01002298 - "write_threshold": write offset threshold in bytes, a event will be
2299 emitted if crossed. Zero if disabled (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002300 - "image": the detail of the image, it is a json-object containing
2301 the following:
2302 - "filename": image file name (json-string)
2303 - "format": image format (json-string)
2304 - "virtual-size": image capacity in bytes (json-int)
2305 - "dirty-flag": true if image is not cleanly closed, not present
2306 means clean (json-bool, optional)
2307 - "actual-size": actual size on disk in bytes of the image, not
2308 present when image does not support thin
2309 provision (json-int, optional)
2310 - "cluster-size": size of a cluster in bytes, not present if image
2311 format does not support it (json-int, optional)
2312 - "encrypted": true if the image is encrypted, not present means
2313 false or the image format does not support
2314 encryption (json-bool, optional)
2315 - "backing_file": backing file name, not present means no backing
2316 file is used or the image format does not
2317 support backing file chain
2318 (json-string, optional)
2319 - "full-backing-filename": full path of the backing file, not
2320 present if it equals backing_file or no
2321 backing file is used
2322 (json-string, optional)
2323 - "backing-filename-format": the format of the backing file, not
2324 present means unknown or no backing
2325 file (json-string, optional)
2326 - "snapshots": the internal snapshot info, it is an optional list
2327 of json-object containing the following:
2328 - "id": unique snapshot id (json-string)
2329 - "name": snapshot name (json-string)
2330 - "vm-state-size": size of the VM state in bytes (json-int)
2331 - "date-sec": UTC date of the snapshot in seconds (json-int)
2332 - "date-nsec": fractional part in nanoseconds to be used with
Eric Blake586b5462013-08-30 14:44:11 -06002333 date-sec (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002334 - "vm-clock-sec": VM clock relative to boot in seconds
2335 (json-int)
2336 - "vm-clock-nsec": fractional part in nanoseconds to be used
2337 with vm-clock-sec (json-int)
2338 - "backing-image": the detail of the backing image, it is an
2339 optional json-object only present when a
2340 backing image present for this image
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002341
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002342- "io-status": I/O operation status, only present if the device supports it
2343 and the VM is configured to stop on errors. It's always reset
2344 to "ok" when the "cont" command is issued (json_string, optional)
2345 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002346
2347Example:
2348
2349-> { "execute": "query-block" }
2350<- {
2351 "return":[
2352 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002353 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002354 "device":"ide0-hd0",
2355 "locked":false,
2356 "removable":false,
2357 "inserted":{
2358 "ro":false,
2359 "drv":"qcow2",
2360 "encrypted":false,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002361 "file":"disks/test.qcow2",
2362 "backing_file_depth":1,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002363 "bps":1000000,
2364 "bps_rd":0,
2365 "bps_wr":0,
2366 "iops":1000000,
2367 "iops_rd":0,
2368 "iops_wr":0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02002369 "bps_max": 8000000,
2370 "bps_rd_max": 0,
2371 "bps_wr_max": 0,
2372 "iops_max": 0,
2373 "iops_rd_max": 0,
2374 "iops_wr_max": 0,
Benoît Canet2024c1d2013-09-02 14:14:41 +02002375 "iops_size": 0,
Peter Lieven465bee12014-05-18 00:58:19 +02002376 "detect_zeroes": "on",
Francesco Romanie2462112015-01-12 14:11:13 +01002377 "write_threshold": 0,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002378 "image":{
2379 "filename":"disks/test.qcow2",
2380 "format":"qcow2",
2381 "virtual-size":2048000,
2382 "backing_file":"base.qcow2",
2383 "full-backing-filename":"disks/base.qcow2",
John Snow54034322015-04-28 15:20:41 -04002384 "backing-filename-format":"qcow2",
Wenchao Xia553a7e82013-06-06 12:27:59 +08002385 "snapshots":[
2386 {
2387 "id": "1",
2388 "name": "snapshot1",
2389 "vm-state-size": 0,
2390 "date-sec": 10000200,
2391 "date-nsec": 12,
2392 "vm-clock-sec": 206,
2393 "vm-clock-nsec": 30
2394 }
2395 ],
2396 "backing-image":{
2397 "filename":"disks/base.qcow2",
2398 "format":"qcow2",
2399 "virtual-size":2048000
2400 }
2401 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002402 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002403 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002404 },
2405 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002406 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002407 "device":"ide1-cd0",
2408 "locked":false,
2409 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002410 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002411 },
2412 {
2413 "device":"floppy0",
2414 "locked":false,
2415 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002416 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002417 },
2418 {
2419 "device":"sd0",
2420 "locked":false,
2421 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002422 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002423 }
2424 ]
2425 }
2426
2427EQMP
2428
Luiz Capitulinob2023812011-09-21 17:16:47 -03002429 {
2430 .name = "query-block",
2431 .args_type = "",
2432 .mhandler.cmd_new = qmp_marshal_input_query_block,
2433 },
2434
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002435SQMP
2436query-blockstats
2437----------------
2438
2439Show block device statistics.
2440
2441Each device statistic information is stored in a json-object and the returned
2442value is a json-array of all devices.
2443
2444Each json-object contain the following:
2445
2446- "device": device name (json-string)
2447- "stats": A json-object with the statistics information, it contains:
2448 - "rd_bytes": bytes read (json-int)
2449 - "wr_bytes": bytes written (json-int)
2450 - "rd_operations": read operations (json-int)
2451 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02002452 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002453 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2454 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2455 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002456 - "wr_highest_offset": Highest offset of a sector written since the
2457 BlockDriverState has been opened (json-int)
Peter Lievenf4564d52015-02-02 14:52:18 +01002458 - "rd_merged": number of read requests that have been merged into
2459 another request (json-int)
2460 - "wr_merged": number of write requests that have been merged into
2461 another request (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002462- "parent": Contains recursively the statistics of the underlying
2463 protocol (e.g. the host file for a qcow2 image). If there is
2464 no underlying protocol, this field is omitted
2465 (json-object, optional)
2466
2467Example:
2468
2469-> { "execute": "query-blockstats" }
2470<- {
2471 "return":[
2472 {
2473 "device":"ide0-hd0",
2474 "parent":{
2475 "stats":{
2476 "wr_highest_offset":3686448128,
2477 "wr_bytes":9786368,
2478 "wr_operations":751,
2479 "rd_bytes":122567168,
2480 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002481 "wr_total_times_ns":313253456
2482 "rd_total_times_ns":3465673657
2483 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02002484 "flush_operations":61,
Peter Lievenf4564d52015-02-02 14:52:18 +01002485 "rd_merged":0,
2486 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002487 }
2488 },
2489 "stats":{
2490 "wr_highest_offset":2821110784,
2491 "wr_bytes":9786368,
2492 "wr_operations":692,
2493 "rd_bytes":122739200,
2494 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02002495 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002496 "wr_total_times_ns":313253456
2497 "rd_total_times_ns":3465673657
Peter Lievenf4564d52015-02-02 14:52:18 +01002498 "flush_total_times_ns":49653,
2499 "rd_merged":0,
2500 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002501 }
2502 },
2503 {
2504 "device":"ide1-cd0",
2505 "stats":{
2506 "wr_highest_offset":0,
2507 "wr_bytes":0,
2508 "wr_operations":0,
2509 "rd_bytes":0,
2510 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002511 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002512 "wr_total_times_ns":0
2513 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002514 "flush_total_times_ns":0,
2515 "rd_merged":0,
2516 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002517 }
2518 },
2519 {
2520 "device":"floppy0",
2521 "stats":{
2522 "wr_highest_offset":0,
2523 "wr_bytes":0,
2524 "wr_operations":0,
2525 "rd_bytes":0,
2526 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002527 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002528 "wr_total_times_ns":0
2529 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002530 "flush_total_times_ns":0,
2531 "rd_merged":0,
2532 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002533 }
2534 },
2535 {
2536 "device":"sd0",
2537 "stats":{
2538 "wr_highest_offset":0,
2539 "wr_bytes":0,
2540 "wr_operations":0,
2541 "rd_bytes":0,
2542 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002543 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002544 "wr_total_times_ns":0
2545 "rd_total_times_ns":0
Peter Lievenf4564d52015-02-02 14:52:18 +01002546 "flush_total_times_ns":0,
2547 "rd_merged":0,
2548 "wr_merged":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002549 }
2550 }
2551 ]
2552 }
2553
2554EQMP
2555
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002556 {
2557 .name = "query-blockstats",
Fam Zhengf71eaa72014-10-31 11:32:57 +08002558 .args_type = "query-nodes:b?",
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002559 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2560 },
2561
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002562SQMP
2563query-cpus
2564----------
2565
2566Show CPU information.
2567
2568Return a json-array. Each CPU is represented by a json-object, which contains:
2569
2570- "CPU": CPU index (json-int)
2571- "current": true if this is the current CPU, false otherwise (json-bool)
2572- "halted": true if the cpu is halted, false otherwise (json-bool)
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002573- "qom_path": path to the CPU object in the QOM tree (json-str)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002574- Current program counter. The key's name depends on the architecture:
2575 "pc": i386/x86_64 (json-int)
2576 "nip": PPC (json-int)
2577 "pc" and "npc": sparc (json-int)
2578 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002579- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002580
2581Example:
2582
2583-> { "execute": "query-cpus" }
2584<- {
2585 "return":[
2586 {
2587 "CPU":0,
2588 "current":true,
2589 "halted":false,
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002590 "qom_path":"/machine/unattached/device[0]",
2591 "pc":3227107138,
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002592 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002593 },
2594 {
2595 "CPU":1,
2596 "current":false,
2597 "halted":true,
Eduardo Habkost58f88d42015-05-08 16:04:22 -03002598 "qom_path":"/machine/unattached/device[2]",
2599 "pc":7108165,
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002600 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002601 }
2602 ]
2603 }
2604
2605EQMP
2606
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03002607 {
2608 .name = "query-cpus",
2609 .args_type = "",
2610 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2611 },
2612
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002613SQMP
Stefan Hajnoczidc3dd0d2014-02-27 11:48:42 +01002614query-iothreads
2615---------------
2616
2617Returns a list of information about each iothread.
2618
2619Note this list excludes the QEMU main loop thread, which is not declared
2620using the -object iothread command-line option. It is always the main thread
2621of the process.
2622
2623Return a json-array. Each iothread is represented by a json-object, which contains:
2624
2625- "id": name of iothread (json-str)
2626- "thread-id": ID of the underlying host thread (json-int)
2627
2628Example:
2629
2630-> { "execute": "query-iothreads" }
2631<- {
2632 "return":[
2633 {
2634 "id":"iothread0",
2635 "thread-id":3134
2636 },
2637 {
2638 "id":"iothread1",
2639 "thread-id":3135
2640 }
2641 ]
2642 }
2643
2644EQMP
2645
2646 {
2647 .name = "query-iothreads",
2648 .args_type = "",
2649 .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
2650 },
2651
2652SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002653query-pci
2654---------
2655
2656PCI buses and devices information.
2657
2658The returned value is a json-array of all buses. Each bus is represented by
2659a json-object, which has a key with a json-array of all PCI devices attached
2660to it. Each device is represented by a json-object.
2661
2662The bus json-object contains the following:
2663
2664- "bus": bus number (json-int)
2665- "devices": a json-array of json-objects, each json-object represents a
2666 PCI device
2667
2668The PCI device json-object contains the following:
2669
2670- "bus": identical to the parent's bus number (json-int)
2671- "slot": slot number (json-int)
2672- "function": function number (json-int)
2673- "class_info": a json-object containing:
2674 - "desc": device class description (json-string, optional)
2675 - "class": device class number (json-int)
2676- "id": a json-object containing:
2677 - "device": device ID (json-int)
2678 - "vendor": vendor ID (json-int)
2679- "irq": device's IRQ if assigned (json-int, optional)
2680- "qdev_id": qdev id string (json-string)
2681- "pci_bridge": It's a json-object, only present if this device is a
2682 PCI bridge, contains:
2683 - "bus": bus number (json-int)
2684 - "secondary": secondary bus number (json-int)
2685 - "subordinate": subordinate bus number (json-int)
2686 - "io_range": I/O memory range information, a json-object with the
2687 following members:
2688 - "base": base address, in bytes (json-int)
2689 - "limit": limit address, in bytes (json-int)
2690 - "memory_range": memory range information, a json-object with the
2691 following members:
2692 - "base": base address, in bytes (json-int)
2693 - "limit": limit address, in bytes (json-int)
2694 - "prefetchable_range": Prefetchable memory range information, a
2695 json-object with the following members:
2696 - "base": base address, in bytes (json-int)
2697 - "limit": limit address, in bytes (json-int)
2698 - "devices": a json-array of PCI devices if there's any attached, each
2699 each element is represented by a json-object, which contains
2700 the same members of the 'PCI device json-object' described
2701 above (optional)
2702- "regions": a json-array of json-objects, each json-object represents a
2703 memory region of this device
2704
2705The memory range json-object contains the following:
2706
2707- "base": base memory address (json-int)
2708- "limit": limit value (json-int)
2709
2710The region json-object can be an I/O region or a memory region, an I/O region
2711json-object contains the following:
2712
2713- "type": "io" (json-string, fixed)
2714- "bar": BAR number (json-int)
2715- "address": memory address (json-int)
2716- "size": memory size (json-int)
2717
2718A memory region json-object contains the following:
2719
2720- "type": "memory" (json-string, fixed)
2721- "bar": BAR number (json-int)
2722- "address": memory address (json-int)
2723- "size": memory size (json-int)
2724- "mem_type_64": true or false (json-bool)
2725- "prefetch": true or false (json-bool)
2726
2727Example:
2728
2729-> { "execute": "query-pci" }
2730<- {
2731 "return":[
2732 {
2733 "bus":0,
2734 "devices":[
2735 {
2736 "bus":0,
2737 "qdev_id":"",
2738 "slot":0,
2739 "class_info":{
2740 "class":1536,
2741 "desc":"Host bridge"
2742 },
2743 "id":{
2744 "device":32902,
2745 "vendor":4663
2746 },
2747 "function":0,
2748 "regions":[
2749
2750 ]
2751 },
2752 {
2753 "bus":0,
2754 "qdev_id":"",
2755 "slot":1,
2756 "class_info":{
2757 "class":1537,
2758 "desc":"ISA bridge"
2759 },
2760 "id":{
2761 "device":32902,
2762 "vendor":28672
2763 },
2764 "function":0,
2765 "regions":[
2766
2767 ]
2768 },
2769 {
2770 "bus":0,
2771 "qdev_id":"",
2772 "slot":1,
2773 "class_info":{
2774 "class":257,
2775 "desc":"IDE controller"
2776 },
2777 "id":{
2778 "device":32902,
2779 "vendor":28688
2780 },
2781 "function":1,
2782 "regions":[
2783 {
2784 "bar":4,
2785 "size":16,
2786 "address":49152,
2787 "type":"io"
2788 }
2789 ]
2790 },
2791 {
2792 "bus":0,
2793 "qdev_id":"",
2794 "slot":2,
2795 "class_info":{
2796 "class":768,
2797 "desc":"VGA controller"
2798 },
2799 "id":{
2800 "device":4115,
2801 "vendor":184
2802 },
2803 "function":0,
2804 "regions":[
2805 {
2806 "prefetch":true,
2807 "mem_type_64":false,
2808 "bar":0,
2809 "size":33554432,
2810 "address":4026531840,
2811 "type":"memory"
2812 },
2813 {
2814 "prefetch":false,
2815 "mem_type_64":false,
2816 "bar":1,
2817 "size":4096,
2818 "address":4060086272,
2819 "type":"memory"
2820 },
2821 {
2822 "prefetch":false,
2823 "mem_type_64":false,
2824 "bar":6,
2825 "size":65536,
2826 "address":-1,
2827 "type":"memory"
2828 }
2829 ]
2830 },
2831 {
2832 "bus":0,
2833 "qdev_id":"",
2834 "irq":11,
2835 "slot":4,
2836 "class_info":{
2837 "class":1280,
2838 "desc":"RAM controller"
2839 },
2840 "id":{
2841 "device":6900,
2842 "vendor":4098
2843 },
2844 "function":0,
2845 "regions":[
2846 {
2847 "bar":0,
2848 "size":32,
2849 "address":49280,
2850 "type":"io"
2851 }
2852 ]
2853 }
2854 ]
2855 }
2856 ]
2857 }
2858
2859Note: This example has been shortened as the real response is too long.
2860
2861EQMP
2862
Luiz Capitulino79627472011-10-21 14:15:33 -02002863 {
2864 .name = "query-pci",
2865 .args_type = "",
2866 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2867 },
2868
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002869SQMP
2870query-kvm
2871---------
2872
2873Show KVM information.
2874
2875Return a json-object with the following information:
2876
2877- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2878- "present": true if QEMU has KVM support, false otherwise (json-bool)
2879
2880Example:
2881
2882-> { "execute": "query-kvm" }
2883<- { "return": { "enabled": true, "present": true } }
2884
2885EQMP
2886
Luiz Capitulino292a2602011-09-12 15:10:53 -03002887 {
2888 .name = "query-kvm",
2889 .args_type = "",
2890 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2891 },
2892
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002893SQMP
2894query-status
2895------------
2896
2897Return a json-object with the following information:
2898
2899- "running": true if the VM is running, or false if it is paused (json-bool)
2900- "singlestep": true if the VM is in single step mode,
2901 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002902- "status": one of the following values (json-string)
2903 "debug" - QEMU is running on a debugger
2904 "inmigrate" - guest is paused waiting for an incoming migration
2905 "internal-error" - An internal error that prevents further guest
2906 execution has occurred
2907 "io-error" - the last IOP has failed and the device is configured
2908 to pause on I/O errors
2909 "paused" - guest has been paused via the 'stop' command
2910 "postmigrate" - guest is paused following a successful 'migrate'
2911 "prelaunch" - QEMU was started with -S and guest has not started
2912 "finish-migrate" - guest is paused to finish the migration process
2913 "restore-vm" - guest is paused to restore VM state
2914 "running" - guest is actively running
2915 "save-vm" - guest is paused to save the VM state
2916 "shutdown" - guest is shut down (and -no-shutdown is in use)
2917 "watchdog" - the watchdog action is configured to pause and
2918 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002919
2920Example:
2921
2922-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002923<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002924
2925EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03002926
2927 {
2928 .name = "query-status",
2929 .args_type = "",
2930 .mhandler.cmd_new = qmp_marshal_input_query_status,
2931 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002932
2933SQMP
2934query-mice
2935----------
2936
2937Show VM mice information.
2938
2939Each mouse is represented by a json-object, the returned value is a json-array
2940of all mice.
2941
2942The mouse json-object contains the following:
2943
2944- "name": mouse's name (json-string)
2945- "index": mouse's index (json-int)
2946- "current": true if this mouse is receiving events, false otherwise (json-bool)
2947- "absolute": true if the mouse generates absolute input events (json-bool)
2948
2949Example:
2950
2951-> { "execute": "query-mice" }
2952<- {
2953 "return":[
2954 {
2955 "name":"QEMU Microsoft Mouse",
2956 "index":0,
2957 "current":false,
2958 "absolute":false
2959 },
2960 {
2961 "name":"QEMU PS/2 Mouse",
2962 "index":1,
2963 "current":true,
2964 "absolute":true
2965 }
2966 ]
2967 }
2968
2969EQMP
2970
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03002971 {
2972 .name = "query-mice",
2973 .args_type = "",
2974 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2975 },
2976
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002977SQMP
2978query-vnc
2979---------
2980
2981Show VNC server information.
2982
2983Return a json-object with server information. Connected clients are returned
2984as a json-array of json-objects.
2985
2986The main json-object contains the following:
2987
2988- "enabled": true or false (json-bool)
2989- "host": server's IP address (json-string)
2990- "family": address family (json-string)
2991 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2992- "service": server's port number (json-string)
2993- "auth": authentication method (json-string)
2994 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2995 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2996 "vencrypt+plain", "vencrypt+tls+none",
2997 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2998 "vencrypt+tls+vnc", "vencrypt+x509+none",
2999 "vencrypt+x509+plain", "vencrypt+x509+sasl",
3000 "vencrypt+x509+vnc", "vnc"
3001- "clients": a json-array of all connected clients
3002
3003Clients are described by a json-object, each one contain the following:
3004
3005- "host": client's IP address (json-string)
3006- "family": address family (json-string)
3007 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3008- "service": client's port number (json-string)
3009- "x509_dname": TLS dname (json-string, optional)
3010- "sasl_username": SASL username (json-string, optional)
3011
3012Example:
3013
3014-> { "execute": "query-vnc" }
3015<- {
3016 "return":{
3017 "enabled":true,
3018 "host":"0.0.0.0",
3019 "service":"50402",
3020 "auth":"vnc",
3021 "family":"ipv4",
3022 "clients":[
3023 {
3024 "host":"127.0.0.1",
3025 "service":"50401",
3026 "family":"ipv4"
3027 }
3028 ]
3029 }
3030 }
3031
3032EQMP
3033
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003034 {
3035 .name = "query-vnc",
3036 .args_type = "",
3037 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
3038 },
Gerd Hoffmanndf887682014-12-17 15:49:44 +01003039 {
3040 .name = "query-vnc-servers",
3041 .args_type = "",
3042 .mhandler.cmd_new = qmp_marshal_input_query_vnc_servers,
3043 },
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02003044
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003045SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003046query-spice
3047-----------
3048
3049Show SPICE server information.
3050
3051Return a json-object with server information. Connected clients are returned
3052as a json-array of json-objects.
3053
3054The main json-object contains the following:
3055
3056- "enabled": true or false (json-bool)
3057- "host": server's IP address (json-string)
3058- "port": server's port number (json-int, optional)
3059- "tls-port": server's port number (json-int, optional)
3060- "auth": authentication method (json-string)
3061 - Possible values: "none", "spice"
3062- "channels": a json-array of all active channels clients
3063
3064Channels are described by a json-object, each one contain the following:
3065
3066- "host": client's IP address (json-string)
3067- "family": address family (json-string)
3068 - Possible values: "ipv4", "ipv6", "unix", "unknown"
3069- "port": client's port number (json-string)
3070- "connection-id": spice connection id. All channels with the same id
3071 belong to the same spice session (json-int)
3072- "channel-type": channel type. "1" is the main control channel, filter for
3073 this one if you want track spice sessions only (json-int)
3074- "channel-id": channel id. Usually "0", might be different needed when
3075 multiple channels of the same type exist, such as multiple
3076 display channels in a multihead setup (json-int)
Alberto Garcia3599d462015-02-26 16:35:07 +02003077- "tls": whether the channel is encrypted (json-bool)
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003078
3079Example:
3080
3081-> { "execute": "query-spice" }
3082<- {
3083 "return": {
3084 "enabled": true,
3085 "auth": "spice",
3086 "port": 5920,
3087 "tls-port": 5921,
3088 "host": "0.0.0.0",
3089 "channels": [
3090 {
3091 "port": "54924",
3092 "family": "ipv4",
3093 "channel-type": 1,
3094 "connection-id": 1804289383,
3095 "host": "127.0.0.1",
3096 "channel-id": 0,
3097 "tls": true
3098 },
3099 {
3100 "port": "36710",
3101 "family": "ipv4",
3102 "channel-type": 4,
3103 "connection-id": 1804289383,
3104 "host": "127.0.0.1",
3105 "channel-id": 0,
3106 "tls": false
3107 },
3108 [ ... more channels follow ... ]
3109 ]
3110 }
3111 }
3112
3113EQMP
3114
Luiz Capitulinod1f29642011-10-20 17:01:33 -02003115#if defined(CONFIG_SPICE)
3116 {
3117 .name = "query-spice",
3118 .args_type = "",
3119 .mhandler.cmd_new = qmp_marshal_input_query_spice,
3120 },
3121#endif
3122
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01003123SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003124query-name
3125----------
3126
3127Show VM name.
3128
3129Return a json-object with the following information:
3130
3131- "name": VM's name (json-string, optional)
3132
3133Example:
3134
3135-> { "execute": "query-name" }
3136<- { "return": { "name": "qemu-name" } }
3137
3138EQMP
3139
Anthony Liguori48a32be2011-09-02 12:34:48 -05003140 {
3141 .name = "query-name",
3142 .args_type = "",
3143 .mhandler.cmd_new = qmp_marshal_input_query_name,
3144 },
3145
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003146SQMP
3147query-uuid
3148----------
3149
3150Show VM UUID.
3151
3152Return a json-object with the following information:
3153
3154- "UUID": Universally Unique Identifier (json-string)
3155
3156Example:
3157
3158-> { "execute": "query-uuid" }
3159<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
3160
3161EQMP
3162
Luiz Capitulinoefab7672011-09-13 17:16:25 -03003163 {
3164 .name = "query-uuid",
3165 .args_type = "",
3166 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
3167 },
3168
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003169SQMP
Amos Kong1f8f9872013-04-25 17:50:35 +08003170query-command-line-options
3171--------------------------
3172
3173Show command line option schema.
3174
3175Return a json-array of command line option schema for all options (or for
3176the given option), returning an error if the given option doesn't exist.
3177
3178Each array entry contains the following:
3179
3180- "option": option name (json-string)
3181- "parameters": a json-array describes all parameters of the option:
3182 - "name": parameter name (json-string)
3183 - "type": parameter type (one of 'string', 'boolean', 'number',
3184 or 'size')
3185 - "help": human readable description of the parameter
3186 (json-string, optional)
Chunyan Liue36af942014-06-05 17:20:43 +08003187 - "default": default value string for the parameter
3188 (json-string, optional)
Amos Kong1f8f9872013-04-25 17:50:35 +08003189
3190Example:
3191
3192-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
3193<- { "return": [
3194 {
3195 "parameters": [
3196 {
3197 "name": "romfile",
3198 "type": "string"
3199 },
3200 {
3201 "name": "bootindex",
3202 "type": "number"
3203 }
3204 ],
3205 "option": "option-rom"
3206 }
3207 ]
3208 }
3209
3210EQMP
3211
3212 {
3213 .name = "query-command-line-options",
3214 .args_type = "option:s?",
3215 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
3216 },
3217
3218SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003219query-migrate
3220-------------
3221
3222Migration status.
3223
3224Return a json-object. If migration is active there will be another json-object
3225with RAM migration status and if block migration is active another one with
3226block migration status.
3227
3228The main json-object contains the following:
3229
3230- "status": migration status (json-string)
Peter Feiner3b695952014-05-16 10:40:47 -04003231 - Possible values: "setup", "active", "completed", "failed", "cancelled"
Juan Quintela7aa939a2012-08-18 13:17:10 +02003232- "total-time": total amount of ms since migration started. If
3233 migration has ended, it returns the total migration
Juan Quintela817c6042013-02-11 15:11:10 +01003234 time (json-int)
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003235- "setup-time" amount of setup time in milliseconds _before_ the
3236 iterations begin but _after_ the QMP command is issued.
3237 This is designed to provide an accounting of any activities
3238 (such as RDMA pinning) which may be expensive, but do not
3239 actually occur during the iterative migration rounds
3240 themselves. (json-int)
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003241- "downtime": only present when migration has finished correctly
3242 total amount in ms for downtime that happened (json-int)
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003243- "expected-downtime": only present while migration is active
3244 total amount in ms for downtime that was calculated on
Juan Quintela817c6042013-02-11 15:11:10 +01003245 the last bitmap round (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003246- "ram": only present if "status" is "active", it is a json-object with the
Juan Quintela817c6042013-02-11 15:11:10 +01003247 following RAM information:
3248 - "transferred": amount transferred in bytes (json-int)
3249 - "remaining": amount remaining to transfer in bytes (json-int)
3250 - "total": total amount of memory in bytes (json-int)
3251 - "duplicate": number of pages filled entirely with the same
3252 byte (json-int)
3253 These are sent over the wire much more efficiently.
Peter Lievenf1c72792013-03-26 10:58:37 +01003254 - "skipped": number of skipped zero pages (json-int)
Stefan Weil805a2502013-04-28 11:49:57 +02003255 - "normal" : number of whole pages transferred. I.e. they
Juan Quintela817c6042013-02-11 15:11:10 +01003256 were not sent as duplicate or xbzrle pages (json-int)
3257 - "normal-bytes" : number of bytes transferred in whole
3258 pages. This is just normal pages times size of one page,
3259 but this way upper levels don't need to care about page
3260 size (json-int)
ChenLiang58570ed2014-04-04 17:57:55 +08003261 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003262- "disk": only present if "status" is "active" and it is a block migration,
Juan Quintela817c6042013-02-11 15:11:10 +01003263 it is a json-object with the following disk information:
3264 - "transferred": amount transferred in bytes (json-int)
3265 - "remaining": amount remaining to transfer in bytes json-int)
3266 - "total": total disk size in bytes (json-int)
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003267- "xbzrle-cache": only present if XBZRLE is active.
3268 It is a json-object with the following XBZRLE information:
Juan Quintela817c6042013-02-11 15:11:10 +01003269 - "cache-size": XBZRLE cache size in bytes
3270 - "bytes": number of bytes transferred for XBZRLE compressed pages
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003271 - "pages": number of XBZRLE compressed pages
Juan Quintela817c6042013-02-11 15:11:10 +01003272 - "cache-miss": number of XBRZRLE page cache misses
ChenLiang8bc39232014-04-04 17:57:56 +08003273 - "cache-miss-rate": rate of XBRZRLE page cache misses
Juan Quintela817c6042013-02-11 15:11:10 +01003274 - "overflow": number of times XBZRLE overflows. This means
3275 that the XBZRLE encoding was bigger than just sent the
3276 whole page, and then we sent the whole page instead (as as
3277 normal page).
3278
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003279Examples:
3280
32811. Before the first migration
3282
3283-> { "execute": "query-migrate" }
3284<- { "return": {} }
3285
32862. Migration is done and has succeeded
3287
3288-> { "execute": "query-migrate" }
Orit Wasserman004d4c12012-08-06 21:42:56 +03003289<- { "return": {
3290 "status": "completed",
3291 "ram":{
3292 "transferred":123,
3293 "remaining":123,
3294 "total":246,
3295 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003296 "setup-time":12345,
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003297 "downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003298 "duplicate":123,
3299 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003300 "normal-bytes":123456,
3301 "dirty-sync-count":15
Orit Wasserman004d4c12012-08-06 21:42:56 +03003302 }
3303 }
3304 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003305
33063. Migration is done and has failed
3307
3308-> { "execute": "query-migrate" }
3309<- { "return": { "status": "failed" } }
3310
33114. Migration is being performed and is not a block migration:
3312
3313-> { "execute": "query-migrate" }
3314<- {
3315 "return":{
3316 "status":"active",
3317 "ram":{
3318 "transferred":123,
3319 "remaining":123,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003320 "total":246,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003321 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003322 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003323 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003324 "duplicate":123,
3325 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003326 "normal-bytes":123456,
3327 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003328 }
3329 }
3330 }
3331
33325. Migration is being performed and is a block migration:
3333
3334-> { "execute": "query-migrate" }
3335<- {
3336 "return":{
3337 "status":"active",
3338 "ram":{
3339 "total":1057024,
3340 "remaining":1053304,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003341 "transferred":3720,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003342 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003343 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003344 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003345 "duplicate":123,
3346 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003347 "normal-bytes":123456,
3348 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003349 },
3350 "disk":{
3351 "total":20971520,
3352 "remaining":20880384,
3353 "transferred":91136
3354 }
3355 }
3356 }
3357
Orit Wassermanf36d55a2012-08-06 21:42:57 +030033586. Migration is being performed and XBZRLE is active:
3359
3360-> { "execute": "query-migrate" }
3361<- {
3362 "return":{
3363 "status":"active",
3364 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3365 "ram":{
3366 "total":1057024,
3367 "remaining":1053304,
3368 "transferred":3720,
3369 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003370 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003371 "expected-downtime":12345,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003372 "duplicate":10,
3373 "normal":3333,
ChenLiang58570ed2014-04-04 17:57:55 +08003374 "normal-bytes":3412992,
3375 "dirty-sync-count":15
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003376 },
3377 "xbzrle-cache":{
3378 "cache-size":67108864,
3379 "bytes":20971520,
3380 "pages":2444343,
3381 "cache-miss":2244,
ChenLiang8bc39232014-04-04 17:57:56 +08003382 "cache-miss-rate":0.123,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003383 "overflow":34434
3384 }
3385 }
3386 }
3387
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003388EQMP
3389
Luiz Capitulino791e7c82011-09-13 17:37:16 -03003390 {
3391 .name = "query-migrate",
3392 .args_type = "",
3393 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
3394 },
3395
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003396SQMP
Orit Wasserman00458432012-08-06 21:42:48 +03003397migrate-set-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003398------------------------
Orit Wasserman00458432012-08-06 21:42:48 +03003399
3400Enable/Disable migration capabilities
3401
Juan Quintela817c6042013-02-11 15:11:10 +01003402- "xbzrle": XBZRLE support
zhanghailiangd6d69732014-12-09 14:38:37 +08003403- "rdma-pin-all": pin all pages when using RDMA during migration
3404- "auto-converge": throttle down guest to help convergence of migration
3405- "zero-blocks": compress zero blocks during block migration
Orit Wasserman00458432012-08-06 21:42:48 +03003406
3407Arguments:
3408
3409Example:
3410
3411-> { "execute": "migrate-set-capabilities" , "arguments":
3412 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3413
3414EQMP
3415
3416 {
3417 .name = "migrate-set-capabilities",
Paolo Bonzini43d0a2c2015-04-15 13:30:04 +02003418 .args_type = "capabilities:q",
Orit Wasserman00458432012-08-06 21:42:48 +03003419 .params = "capability:s,state:b",
3420 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
3421 },
3422SQMP
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003423query-migrate-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003424--------------------------
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003425
3426Query current migration capabilities
3427
3428- "capabilities": migration capabilities state
3429 - "xbzrle" : XBZRLE state (json-bool)
zhanghailiangd6d69732014-12-09 14:38:37 +08003430 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
3431 - "auto-converge" : Auto Converge state (json-bool)
3432 - "zero-blocks" : Zero Blocks state (json-bool)
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003433
3434Arguments:
3435
3436Example:
3437
3438-> { "execute": "query-migrate-capabilities" }
Orit Wassermandbca1b32013-01-31 09:12:17 +02003439<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3440
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003441EQMP
3442
3443 {
3444 .name = "query-migrate-capabilities",
3445 .args_type = "",
3446 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
3447 },
3448
3449SQMP
Liang Li85de8322015-03-23 16:32:28 +08003450migrate-set-parameters
3451----------------------
3452
3453Set migration parameters
3454
3455- "compress-level": set compression level during migration (json-int)
3456- "compress-threads": set compression thread count for migration (json-int)
3457- "decompress-threads": set decompression thread count for migration (json-int)
3458
3459Arguments:
3460
3461Example:
3462
3463-> { "execute": "migrate-set-parameters" , "arguments":
3464 { "compress-level": 1 } }
3465
3466EQMP
3467
3468 {
3469 .name = "migrate-set-parameters",
3470 .args_type =
3471 "compress-level:i?,compress-threads:i?,decompress-threads:i?",
3472 .mhandler.cmd_new = qmp_marshal_input_migrate_set_parameters,
3473 },
3474SQMP
3475query-migrate-parameters
3476------------------------
3477
3478Query current migration parameters
3479
3480- "parameters": migration parameters value
3481 - "compress-level" : compression level value (json-int)
3482 - "compress-threads" : compression thread count value (json-int)
3483 - "decompress-threads" : decompression thread count value (json-int)
3484
3485Arguments:
3486
3487Example:
3488
3489-> { "execute": "query-migrate-parameters" }
3490<- {
3491 "return": {
3492 "decompress-threads", 2,
3493 "compress-threads", 8,
3494 "compress-level", 1
3495 }
3496 }
3497
3498EQMP
3499
3500 {
3501 .name = "query-migrate-parameters",
3502 .args_type = "",
3503 .mhandler.cmd_new = qmp_marshal_input_query_migrate_parameters,
3504 },
3505
3506SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003507query-balloon
3508-------------
3509
3510Show balloon information.
3511
3512Make an asynchronous request for balloon info. When the request completes a
3513json-object will be returned containing the following data:
3514
3515- "actual": current balloon value in bytes (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003516
3517Example:
3518
3519-> { "execute": "query-balloon" }
3520<- {
3521 "return":{
3522 "actual":1073741824,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003523 }
3524 }
3525
3526EQMP
3527
Luiz Capitulino96637bc2011-10-21 11:41:37 -02003528 {
3529 .name = "query-balloon",
3530 .args_type = "",
3531 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
3532 },
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003533
3534 {
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00003535 .name = "query-block-jobs",
3536 .args_type = "",
3537 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
3538 },
3539
3540 {
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003541 .name = "qom-list",
3542 .args_type = "path:s",
3543 .mhandler.cmd_new = qmp_marshal_input_qom_list,
3544 },
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003545
3546 {
3547 .name = "qom-set",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01003548 .args_type = "path:s,property:s,value:q",
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003549 .mhandler.cmd_new = qmp_qom_set,
3550 },
3551
3552 {
3553 .name = "qom-get",
3554 .args_type = "path:s,property:s",
3555 .mhandler.cmd_new = qmp_qom_get,
3556 },
Luiz Capitulino270b2432011-12-08 11:45:55 -02003557
3558 {
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003559 .name = "nbd-server-start",
3560 .args_type = "addr:q",
3561 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
3562 },
3563 {
3564 .name = "nbd-server-add",
3565 .args_type = "device:B,writable:b?",
3566 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
3567 },
3568 {
3569 .name = "nbd-server-stop",
3570 .args_type = "",
3571 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
3572 },
3573
3574 {
Luiz Capitulino270b2432011-12-08 11:45:55 -02003575 .name = "change-vnc-password",
3576 .args_type = "password:s",
3577 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
3578 },
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06003579 {
3580 .name = "qom-list-types",
3581 .args_type = "implements:s?,abstract:b?",
3582 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
3583 },
Anthony Liguori1daa31b2012-08-10 11:04:09 -05003584
3585 {
3586 .name = "device-list-properties",
3587 .args_type = "typename:s",
3588 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
3589 },
3590
Anthony Liguori01d3c802012-08-10 11:04:11 -05003591 {
3592 .name = "query-machines",
3593 .args_type = "",
3594 .mhandler.cmd_new = qmp_marshal_input_query_machines,
3595 },
3596
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003597 {
3598 .name = "query-cpu-definitions",
3599 .args_type = "",
3600 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
3601 },
3602
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003603 {
3604 .name = "query-target",
3605 .args_type = "",
3606 .mhandler.cmd_new = qmp_marshal_input_query_target,
3607 },
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003608
3609 {
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003610 .name = "query-tpm",
3611 .args_type = "",
3612 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
3613 },
3614
Corey Bryant28c4fa32013-03-20 12:34:49 -04003615SQMP
3616query-tpm
3617---------
3618
3619Return information about the TPM device.
3620
3621Arguments: None
3622
3623Example:
3624
3625-> { "execute": "query-tpm" }
3626<- { "return":
3627 [
3628 { "model": "tpm-tis",
3629 "options":
3630 { "type": "passthrough",
3631 "data":
3632 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3633 "path": "/dev/tpm0"
3634 }
3635 },
3636 "id": "tpm0"
3637 }
3638 ]
3639 }
3640
3641EQMP
3642
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003643 {
3644 .name = "query-tpm-models",
3645 .args_type = "",
3646 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
3647 },
3648
Corey Bryant28c4fa32013-03-20 12:34:49 -04003649SQMP
3650query-tpm-models
3651----------------
3652
3653Return a list of supported TPM models.
3654
3655Arguments: None
3656
3657Example:
3658
3659-> { "execute": "query-tpm-models" }
3660<- { "return": [ "tpm-tis" ] }
3661
3662EQMP
3663
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003664 {
3665 .name = "query-tpm-types",
3666 .args_type = "",
3667 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
3668 },
3669
Corey Bryant28c4fa32013-03-20 12:34:49 -04003670SQMP
3671query-tpm-types
3672---------------
3673
3674Return a list of supported TPM types.
3675
3676Arguments: None
3677
3678Example:
3679
3680-> { "execute": "query-tpm-types" }
3681<- { "return": [ "passthrough" ] }
3682
3683EQMP
3684
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003685 {
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003686 .name = "chardev-add",
3687 .args_type = "id:s,backend:q",
3688 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3689 },
3690
3691SQMP
3692chardev-add
3693----------------
3694
3695Add a chardev.
3696
3697Arguments:
3698
3699- "id": the chardev's ID, must be unique (json-string)
3700- "backend": chardev backend type + parameters
3701
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003702Examples:
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003703
3704-> { "execute" : "chardev-add",
3705 "arguments" : { "id" : "foo",
3706 "backend" : { "type" : "null", "data" : {} } } }
3707<- { "return": {} }
3708
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003709-> { "execute" : "chardev-add",
3710 "arguments" : { "id" : "bar",
3711 "backend" : { "type" : "file",
3712 "data" : { "out" : "/tmp/bar.log" } } } }
3713<- { "return": {} }
3714
Gerd Hoffmann0a1a7fa2012-12-20 14:39:13 +01003715-> { "execute" : "chardev-add",
3716 "arguments" : { "id" : "baz",
3717 "backend" : { "type" : "pty", "data" : {} } } }
3718<- { "return": { "pty" : "/dev/pty/42" } }
3719
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003720EQMP
3721
3722 {
3723 .name = "chardev-remove",
3724 .args_type = "id:s",
3725 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3726 },
3727
3728
3729SQMP
3730chardev-remove
3731--------------
3732
3733Remove a chardev.
3734
3735Arguments:
3736
3737- "id": the chardev's ID, must exist and not be in use (json-string)
3738
3739Example:
3740
3741-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3742<- { "return": {} }
3743
3744EQMP
Amos Kongb1be4282013-06-14 15:45:52 +08003745 {
3746 .name = "query-rx-filter",
3747 .args_type = "name:s?",
3748 .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
3749 },
3750
3751SQMP
3752query-rx-filter
3753---------------
3754
3755Show rx-filter information.
3756
3757Returns a json-array of rx-filter information for all NICs (or for the
3758given NIC), returning an error if the given NIC doesn't exist, or
3759given NIC doesn't support rx-filter querying, or given net client
3760isn't a NIC.
3761
3762The query will clear the event notification flag of each NIC, then qemu
3763will start to emit event to QMP monitor.
3764
3765Each array entry contains the following:
3766
3767- "name": net client name (json-string)
3768- "promiscuous": promiscuous mode is enabled (json-bool)
3769- "multicast": multicast receive state (one of 'normal', 'none', 'all')
3770- "unicast": unicast receive state (one of 'normal', 'none', 'all')
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003771- "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
Amos Kongb1be4282013-06-14 15:45:52 +08003772- "broadcast-allowed": allow to receive broadcast (json-bool)
3773- "multicast-overflow": multicast table is overflowed (json-bool)
3774- "unicast-overflow": unicast table is overflowed (json-bool)
3775- "main-mac": main macaddr string (json-string)
3776- "vlan-table": a json-array of active vlan id
3777- "unicast-table": a json-array of unicast macaddr string
3778- "multicast-table": a json-array of multicast macaddr string
3779
3780Example:
3781
3782-> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3783<- { "return": [
3784 {
3785 "promiscuous": true,
3786 "name": "vnet0",
3787 "main-mac": "52:54:00:12:34:56",
3788 "unicast": "normal",
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003789 "vlan": "normal",
Amos Kongb1be4282013-06-14 15:45:52 +08003790 "vlan-table": [
3791 4,
3792 0
3793 ],
3794 "unicast-table": [
3795 ],
3796 "multicast": "normal",
3797 "multicast-overflow": false,
3798 "unicast-overflow": false,
3799 "multicast-table": [
3800 "01:00:5e:00:00:01",
3801 "33:33:00:00:00:01",
3802 "33:33:ff:12:34:56"
3803 ],
3804 "broadcast-allowed": false
3805 }
3806 ]
3807 }
3808
3809EQMP
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003810
3811 {
3812 .name = "blockdev-add",
3813 .args_type = "options:q",
3814 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3815 },
3816
3817SQMP
3818blockdev-add
3819------------
3820
3821Add a block device.
3822
Markus Armbrusterda2cf4e2015-03-20 14:32:17 +01003823This command is still a work in progress. It doesn't support all
3824block drivers, it lacks a matching blockdev-del, and more. Stay away
3825from it unless you want to help with its development.
3826
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003827Arguments:
3828
3829- "options": block driver options
3830
3831Example (1):
3832
3833-> { "execute": "blockdev-add",
3834 "arguments": { "options" : { "driver": "qcow2",
3835 "file": { "driver": "file",
3836 "filename": "test.qcow2" } } } }
3837<- { "return": {} }
3838
3839Example (2):
3840
3841-> { "execute": "blockdev-add",
3842 "arguments": {
3843 "options": {
3844 "driver": "qcow2",
3845 "id": "my_disk",
3846 "discard": "unmap",
3847 "cache": {
3848 "direct": true,
3849 "writeback": true
3850 },
3851 "file": {
3852 "driver": "file",
3853 "filename": "/tmp/test.qcow2"
3854 },
3855 "backing": {
3856 "driver": "raw",
3857 "file": {
3858 "driver": "file",
3859 "filename": "/dev/fdset/4"
3860 }
3861 }
3862 }
3863 }
3864 }
3865
3866<- { "return": {} }
3867
3868EQMP
Benoît Canetc13163f2014-01-23 21:31:34 +01003869
3870 {
3871 .name = "query-named-block-nodes",
3872 .args_type = "",
3873 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3874 },
3875
3876SQMP
3877@query-named-block-nodes
3878------------------------
3879
3880Return a list of BlockDeviceInfo for all the named block driver nodes
3881
3882Example:
3883
3884-> { "execute": "query-named-block-nodes" }
3885<- { "return": [ { "ro":false,
3886 "drv":"qcow2",
3887 "encrypted":false,
3888 "file":"disks/test.qcow2",
3889 "node-name": "my-node",
3890 "backing_file_depth":1,
3891 "bps":1000000,
3892 "bps_rd":0,
3893 "bps_wr":0,
3894 "iops":1000000,
3895 "iops_rd":0,
3896 "iops_wr":0,
3897 "bps_max": 8000000,
3898 "bps_rd_max": 0,
3899 "bps_wr_max": 0,
3900 "iops_max": 0,
3901 "iops_rd_max": 0,
3902 "iops_wr_max": 0,
3903 "iops_size": 0,
Francesco Romanie2462112015-01-12 14:11:13 +01003904 "write_threshold": 0,
Benoît Canetc13163f2014-01-23 21:31:34 +01003905 "image":{
3906 "filename":"disks/test.qcow2",
3907 "format":"qcow2",
3908 "virtual-size":2048000,
3909 "backing_file":"base.qcow2",
3910 "full-backing-filename":"disks/base.qcow2",
John Snow54034322015-04-28 15:20:41 -04003911 "backing-filename-format":"qcow2",
Benoît Canetc13163f2014-01-23 21:31:34 +01003912 "snapshots":[
3913 {
3914 "id": "1",
3915 "name": "snapshot1",
3916 "vm-state-size": 0,
3917 "date-sec": 10000200,
3918 "date-nsec": 12,
3919 "vm-clock-sec": 206,
3920 "vm-clock-nsec": 30
3921 }
3922 ],
3923 "backing-image":{
3924 "filename":"disks/base.qcow2",
3925 "format":"qcow2",
3926 "virtual-size":2048000
3927 }
Michael S. Tsirkinc0594512014-06-16 15:20:18 +03003928 } } ] }
Benoît Canetc13163f2014-01-23 21:31:34 +01003929
3930EQMP
Hu Tao76b5d852014-06-16 18:05:41 +08003931
3932 {
3933 .name = "query-memdev",
3934 .args_type = "",
3935 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3936 },
3937
3938SQMP
3939query-memdev
3940------------
3941
3942Show memory devices information.
3943
3944
3945Example (1):
3946
3947-> { "execute": "query-memdev" }
3948<- { "return": [
3949 {
3950 "size": 536870912,
3951 "merge": false,
3952 "dump": true,
3953 "prealloc": false,
3954 "host-nodes": [0, 1],
3955 "policy": "bind"
3956 },
3957 {
3958 "size": 536870912,
3959 "merge": false,
3960 "dump": true,
3961 "prealloc": true,
3962 "host-nodes": [2, 3],
3963 "policy": "preferred"
3964 }
3965 ]
3966 }
3967
3968EQMP
Igor Mammedov6f2e2732014-06-16 19:12:25 +02003969
3970 {
3971 .name = "query-memory-devices",
3972 .args_type = "",
3973 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3974 },
3975
3976SQMP
3977@query-memory-devices
3978--------------------
3979
3980Return a list of memory devices.
3981
3982Example:
3983-> { "execute": "query-memory-devices" }
3984<- { "return": [ { "data":
3985 { "addr": 5368709120,
3986 "hotpluggable": true,
3987 "hotplugged": true,
3988 "id": "d1",
3989 "memdev": "/objects/memX",
3990 "node": 0,
3991 "size": 1073741824,
3992 "slot": 0},
3993 "type": "dimm"
3994 } ] }
3995EQMP
Igor Mammedov02419bc2014-06-16 19:12:28 +02003996
3997 {
3998 .name = "query-acpi-ospm-status",
3999 .args_type = "",
4000 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
4001 },
4002
4003SQMP
4004@query-acpi-ospm-status
4005--------------------
4006
4007Return list of ACPIOSTInfo for devices that support status reporting
4008via ACPI _OST method.
4009
4010Example:
4011-> { "execute": "query-acpi-ospm-status" }
4012<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
4013 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
4014 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
4015 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
4016 ]}
4017EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004018
4019#if defined TARGET_I386
4020 {
4021 .name = "rtc-reset-reinjection",
4022 .args_type = "",
4023 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
4024 },
4025#endif
4026
4027SQMP
4028rtc-reset-reinjection
4029---------------------
4030
4031Reset the RTC interrupt reinjection backlog.
4032
4033Arguments: None.
4034
4035Example:
4036
4037-> { "execute": "rtc-reset-reinjection" }
4038<- { "return": {} }
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004039EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004040
Lluís Vilanova1dde0f42014-08-25 13:19:57 +02004041 {
4042 .name = "trace-event-get-state",
4043 .args_type = "name:s",
4044 .mhandler.cmd_new = qmp_marshal_input_trace_event_get_state,
4045 },
4046
4047SQMP
4048trace-event-get-state
4049---------------------
4050
4051Query the state of events.
4052
4053Example:
4054
4055-> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
4056<- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
4057EQMP
4058
4059 {
4060 .name = "trace-event-set-state",
4061 .args_type = "name:s,enable:b,ignore-unavailable:b?",
4062 .mhandler.cmd_new = qmp_marshal_input_trace_event_set_state,
4063 },
4064
4065SQMP
4066trace-event-set-state
4067---------------------
4068
4069Set the state of events.
4070
4071Example:
4072
4073-> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
4074<- { "return": {} }
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03004075EQMP
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004076
4077 {
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004078 .name = "x-input-send-event",
Amos Kong51fc4472014-11-07 12:41:25 +08004079 .args_type = "console:i?,events:q",
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004080 .mhandler.cmd_new = qmp_marshal_input_x_input_send_event,
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004081 },
4082
4083SQMP
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004084@x-input-send-event
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004085-----------------
4086
4087Send input event to guest.
4088
4089Arguments:
4090
Amos Kong51fc4472014-11-07 12:41:25 +08004091- "console": console index. (json-int, optional)
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004092- "events": list of input events.
4093
4094The consoles are visible in the qom tree, under
4095/backend/console[$index]. They have a device link and head property, so
4096it is possible to map which console belongs to which device and display.
4097
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004098Note: this command is experimental, and not a stable API.
4099
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004100Example (1):
4101
4102Press left mouse button.
4103
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004104-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004105 "arguments": { "console": 0,
4106 "events": [ { "type": "btn",
Amos Kongb5369dd2014-11-25 16:05:56 +08004107 "data" : { "down": true, "button": "Left" } } ] } }
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004108<- { "return": {} }
4109
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004110-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004111 "arguments": { "console": 0,
4112 "events": [ { "type": "btn",
Amos Kongb5369dd2014-11-25 16:05:56 +08004113 "data" : { "down": false, "button": "Left" } } ] } }
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004114<- { "return": {} }
4115
4116Example (2):
4117
4118Press ctrl-alt-del.
4119
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004120-> { "execute": "x-input-send-event",
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004121 "arguments": { "console": 0, "events": [
4122 { "type": "key", "data" : { "down": true,
4123 "key": {"type": "qcode", "data": "ctrl" } } },
4124 { "type": "key", "data" : { "down": true,
4125 "key": {"type": "qcode", "data": "alt" } } },
4126 { "type": "key", "data" : { "down": true,
4127 "key": {"type": "qcode", "data": "delete" } } } ] } }
4128<- { "return": {} }
4129
4130Example (3):
4131
4132Move mouse pointer to absolute coordinates (20000, 400).
4133
Gerd Hoffmanndf5b2ad2014-11-25 14:54:17 +01004134-> { "execute": "x-input-send-event" ,
Marcelo Tosatti50c66172014-09-30 18:10:17 -03004135 "arguments": { "console": 0, "events": [
4136 { "type": "abs", "data" : { "axis": "X", "value" : 20000 } },
4137 { "type": "abs", "data" : { "axis": "Y", "value" : 400 } } ] } }
4138<- { "return": {} }
4139
4140EQMP
Francesco Romanie2462112015-01-12 14:11:13 +01004141
4142 {
4143 .name = "block-set-write-threshold",
4144 .args_type = "node-name:s,write-threshold:l",
4145 .mhandler.cmd_new = qmp_marshal_input_block_set_write_threshold,
4146 },
4147
4148SQMP
4149block-set-write-threshold
4150------------
4151
4152Change the write threshold for a block drive. The threshold is an offset,
4153thus must be non-negative. Default is no write threshold.
4154Setting the threshold to zero disables it.
4155
4156Arguments:
4157
4158- "node-name": the node name in the block driver state graph (json-string)
4159- "write-threshold": the write threshold in bytes (json-int)
4160
4161Example:
4162
4163-> { "execute": "block-set-write-threshold",
4164 "arguments": { "node-name": "mydev",
4165 "write-threshold": 17179869184 } }
4166<- { "return": {} }
4167
4168EQMP
Scott Feldmanfafa4d52015-06-10 18:21:21 -07004169
4170 {
4171 .name = "query-rocker",
4172 .args_type = "name:s",
4173 .mhandler.cmd_new = qmp_marshal_input_query_rocker,
4174 },
4175
4176SQMP
4177Show rocker switch
4178------------------
4179
4180Arguments:
4181
4182- "name": switch name
4183
4184Example:
4185
4186-> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
4187<- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
4188
4189EQMP
4190
4191 {
4192 .name = "query-rocker-ports",
4193 .args_type = "name:s",
4194 .mhandler.cmd_new = qmp_marshal_input_query_rocker_ports,
4195 },
4196
4197SQMP
4198Show rocker switch ports
4199------------------------
4200
4201Arguments:
4202
4203- "name": switch name
4204
4205Example:
4206
4207-> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
4208<- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
4209 "autoneg": "off", "link-up": true, "speed": 10000},
4210 {"duplex": "full", "enabled": true, "name": "sw1.2",
4211 "autoneg": "off", "link-up": true, "speed": 10000}
4212 ]}
4213
4214EQMP
4215
4216 {
4217 .name = "query-rocker-of-dpa-flows",
4218 .args_type = "name:s,tbl-id:i?",
4219 .mhandler.cmd_new = qmp_marshal_input_query_rocker_of_dpa_flows,
4220 },
4221
4222SQMP
4223Show rocker switch OF-DPA flow tables
4224-------------------------------------
4225
4226Arguments:
4227
4228- "name": switch name
4229- "tbl-id": (optional) flow table ID
4230
4231Example:
4232
4233-> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
4234<- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
4235 "hits": 138,
4236 "cookie": 0,
4237 "action": {"goto-tbl": 10},
4238 "mask": {"in-pport": 4294901760}
4239 },
4240 {...more...},
4241 ]}
4242
4243EQMP
4244
4245 {
4246 .name = "query-rocker-of-dpa-groups",
4247 .args_type = "name:s,type:i?",
4248 .mhandler.cmd_new = qmp_marshal_input_query_rocker_of_dpa_groups,
4249 },
4250
4251SQMP
4252Show rocker OF-DPA group tables
4253-------------------------------
4254
4255Arguments:
4256
4257- "name": switch name
4258- "type": (optional) group type
4259
4260Example:
4261
4262-> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
4263<- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
4264 "pop-vlan": 1, "id": 251723778},
4265 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
4266 "pop-vlan": 1, "id": 251723776},
4267 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
4268 "pop-vlan": 1, "id": 251658241},
4269 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
4270 "pop-vlan": 1, "id": 251658240}
4271 ]}