blob: 8534948e3fde92244889de6352f3005b54e9e38b [file] [log] [blame]
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001HXCOMM QMP dispatch table and documentation
2HXCOMM Text between SQMP and EQMP is copied to the QMP documention file and
3HXCOMM does not show up in the other formats.
4
5SQMP
6 QMP Supported Commands
7 ----------------------
8
9This document describes all commands currently supported by QMP.
10
11Most of the time their usage is exactly the same as in the user Monitor, this
12means that any other document which also describe commands (the manpage,
13QEMU's manual, etc) can and should be consulted.
14
15QMP has two types of commands: regular and query commands. Regular commands
16usually change the Virtual Machine's state someway, while query commands just
17return information. The sections below are divided accordingly.
18
19It's important to observe that all communication examples are formatted in
20a reader-friendly way, so that they're easier to understand. However, in real
21protocol usage, they're emitted as a single line.
22
23Also, the following notation is used to denote data flow:
24
25-> data issued by the Client
26<- Server data response
27
28Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed
29information on the Server command and response formats.
30
31NOTE: This document is temporary and will be replaced soon.
32
331. Stability Considerations
34===========================
35
36The current QMP command set (described in this file) may be useful for a
37number of use cases, however it's limited and several commands have bad
38defined semantics, specially with regard to command completion.
39
40These problems are going to be solved incrementally in the next QEMU releases
41and we're going to establish a deprecation policy for badly defined commands.
42
43If you're planning to adopt QMP, please observe the following:
44
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",
279 .user_print = monitor_user_noop,
280 .mhandler.cmd_new = do_device_add,
281 },
282
283SQMP
284device_add
285----------
286
287Add a device.
288
289Arguments:
290
291- "driver": the name of the new device's driver (json-string)
292- "bus": the device's parent bus (device tree path, json-string, optional)
293- "id": the device's ID, must be unique (json-string)
294- device properties
295
296Example:
297
298-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
299<- { "return": {} }
300
301Notes:
302
303(1) For detailed information about this command, please refer to the
304 'docs/qdev-device-use.txt' file.
305
306(2) It's possible to list device properties by running QEMU with the
307 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
308
309EQMP
310
311 {
312 .name = "device_del",
313 .args_type = "id:s",
Luiz Capitulinoa15fef22012-03-29 12:38:50 -0300314 .mhandler.cmd_new = qmp_marshal_input_device_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300315 },
316
317SQMP
318device_del
319----------
320
321Remove a device.
322
323Arguments:
324
325- "id": the device's ID (json-string)
326
327Example:
328
329-> { "execute": "device_del", "arguments": { "id": "net1" } }
330<- { "return": {} }
331
332EQMP
333
334 {
Amos Konge4c8f002012-08-31 10:56:26 +0800335 .name = "send-key",
336 .args_type = "keys:O,hold-time:i?",
337 .mhandler.cmd_new = qmp_marshal_input_send_key,
338 },
339
340SQMP
341send-key
342----------
343
344Send keys to VM.
345
346Arguments:
347
348keys array:
Amos Kongf9b1d9b2013-07-16 19:52:14 +0800349 - "key": key sequence (a json-array of key union values,
350 union can be number or qcode enum)
Amos Konge4c8f002012-08-31 10:56:26 +0800351
352- hold-time: time to delay key up events, milliseconds. Defaults to 100
353 (json-int, optional)
354
355Example:
356
357-> { "execute": "send-key",
Amos Kongf9b1d9b2013-07-16 19:52:14 +0800358 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
359 { "type": "qcode", "data": "alt" },
360 { "type": "qcode", "data": "delete" } ] } }
Amos Konge4c8f002012-08-31 10:56:26 +0800361<- { "return": {} }
362
363EQMP
364
365 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300366 .name = "cpu",
367 .args_type = "index:i",
Luiz Capitulino755f1962011-10-06 14:31:39 -0300368 .mhandler.cmd_new = qmp_marshal_input_cpu,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300369 },
370
371SQMP
372cpu
373---
374
375Set the default CPU.
376
377Arguments:
378
379- "index": the CPU's index (json-int)
380
381Example:
382
383-> { "execute": "cpu", "arguments": { "index": 0 } }
384<- { "return": {} }
385
386Note: CPUs' indexes are obtained with the 'query-cpus' command.
387
388EQMP
389
390 {
Igor Mammedov69ca3ea2013-04-30 15:41:25 +0200391 .name = "cpu-add",
392 .args_type = "id:i",
393 .mhandler.cmd_new = qmp_marshal_input_cpu_add,
394 },
395
396SQMP
397cpu-add
398-------
399
400Adds virtual cpu
401
402Arguments:
403
404- "id": cpu id (json-int)
405
406Example:
407
408-> { "execute": "cpu-add", "arguments": { "id": 2 } }
409<- { "return": {} }
410
411EQMP
412
413 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300414 .name = "memsave",
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200415 .args_type = "val:l,size:i,filename:s,cpu:i?",
416 .mhandler.cmd_new = qmp_marshal_input_memsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300417 },
418
419SQMP
420memsave
421-------
422
423Save to disk virtual memory dump starting at 'val' of size 'size'.
424
425Arguments:
426
427- "val": the starting address (json-int)
428- "size": the memory size, in bytes (json-int)
429- "filename": file path (json-string)
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200430- "cpu": virtual CPU index (json-int, optional)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300431
432Example:
433
434-> { "execute": "memsave",
435 "arguments": { "val": 10,
436 "size": 100,
437 "filename": "/tmp/virtual-mem-dump" } }
438<- { "return": {} }
439
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300440EQMP
441
442 {
443 .name = "pmemsave",
444 .args_type = "val:l,size:i,filename:s",
Luiz Capitulino6d3962b2011-11-22 17:26:46 -0200445 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300446 },
447
448SQMP
449pmemsave
450--------
451
452Save to disk physical memory dump starting at 'val' of size 'size'.
453
454Arguments:
455
456- "val": the starting address (json-int)
457- "size": the memory size, in bytes (json-int)
458- "filename": file path (json-string)
459
460Example:
461
462-> { "execute": "pmemsave",
463 "arguments": { "val": 10,
464 "size": 100,
465 "filename": "/tmp/physical-mem-dump" } }
466<- { "return": {} }
467
468EQMP
469
470 {
Lai Jiangshana4046662011-03-07 17:05:15 +0800471 .name = "inject-nmi",
472 .args_type = "",
Luiz Capitulinoab49ab52011-11-23 12:55:53 -0200473 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
Lai Jiangshana4046662011-03-07 17:05:15 +0800474 },
475
476SQMP
477inject-nmi
478----------
479
480Inject an NMI on guest's CPUs.
481
482Arguments: None.
483
484Example:
485
486-> { "execute": "inject-nmi" }
487<- { "return": {} }
488
Luiz Capitulinode253f12012-07-27 16:18:16 -0300489Note: inject-nmi fails when the guest doesn't support injecting.
Eugene (jno) Dvurechenski7f7f9752012-12-05 15:50:07 +0100490 Currently, only x86 (NMI) and s390x (RESTART) guests do.
Lai Jiangshana4046662011-03-07 17:05:15 +0800491
492EQMP
493
494 {
Markus Armbruster3949e592013-02-06 21:27:24 +0100495 .name = "ringbuf-write",
Markus Armbruster82e59a62013-02-06 21:27:14 +0100496 .args_type = "device:s,data:s,format:s?",
Markus Armbruster3949e592013-02-06 21:27:24 +0100497 .mhandler.cmd_new = qmp_marshal_input_ringbuf_write,
Lei Li1f590cf2013-01-25 00:03:20 +0800498 },
499
500SQMP
Markus Armbruster3949e592013-02-06 21:27:24 +0100501ringbuf-write
Lei Li1f590cf2013-01-25 00:03:20 +0800502-------------
503
Markus Armbruster3949e592013-02-06 21:27:24 +0100504Write to a ring buffer character device.
Lei Li1f590cf2013-01-25 00:03:20 +0800505
506Arguments:
507
Markus Armbruster3949e592013-02-06 21:27:24 +0100508- "device": ring buffer character device name (json-string)
509- "data": data to write (json-string)
510- "format": data format (json-string, optional)
511 - Possible values: "utf8" (default), "base64"
512 Bug: invalid base64 is currently not rejected.
513 Whitespace *is* invalid.
Lei Li1f590cf2013-01-25 00:03:20 +0800514
515Example:
516
Markus Armbruster3949e592013-02-06 21:27:24 +0100517-> { "execute": "ringbuf-write",
518 "arguments": { "device": "foo",
Lei Li1f590cf2013-01-25 00:03:20 +0800519 "data": "abcdefgh",
520 "format": "utf8" } }
521<- { "return": {} }
522
523EQMP
524
525 {
Markus Armbruster3949e592013-02-06 21:27:24 +0100526 .name = "ringbuf-read",
Lei Li49b6d722013-01-25 00:03:21 +0800527 .args_type = "device:s,size:i,format:s?",
Markus Armbruster3949e592013-02-06 21:27:24 +0100528 .mhandler.cmd_new = qmp_marshal_input_ringbuf_read,
Lei Li49b6d722013-01-25 00:03:21 +0800529 },
530
531SQMP
Markus Armbruster3949e592013-02-06 21:27:24 +0100532ringbuf-read
Lei Li49b6d722013-01-25 00:03:21 +0800533-------------
534
Markus Armbruster3949e592013-02-06 21:27:24 +0100535Read from a ring buffer character device.
Lei Li49b6d722013-01-25 00:03:21 +0800536
537Arguments:
538
Markus Armbruster3949e592013-02-06 21:27:24 +0100539- "device": ring buffer character device name (json-string)
540- "size": how many bytes to read at most (json-int)
541 - Number of data bytes, not number of characters in encoded data
542- "format": data format (json-string, optional)
543 - Possible values: "utf8" (default), "base64"
544 - Naturally, format "utf8" works only when the ring buffer
545 contains valid UTF-8 text. Invalid UTF-8 sequences get
546 replaced. Bug: replacement doesn't work. Bug: can screw
547 up on encountering NUL characters, after the ring buffer
548 lost data, and when reading stops because the size limit
549 is reached.
Lei Li49b6d722013-01-25 00:03:21 +0800550
551Example:
552
Markus Armbruster3949e592013-02-06 21:27:24 +0100553-> { "execute": "ringbuf-read",
554 "arguments": { "device": "foo",
Lei Li49b6d722013-01-25 00:03:21 +0800555 "size": 1000,
556 "format": "utf8" } }
Markus Armbruster3ab651f2013-02-06 21:27:15 +0100557<- {"return": "abcdefgh"}
Lei Li49b6d722013-01-25 00:03:21 +0800558
559EQMP
560
561 {
Stefano Stabellinia7ae8352012-01-25 12:24:51 +0000562 .name = "xen-save-devices-state",
563 .args_type = "filename:F",
564 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
565 },
566
567SQMP
568xen-save-devices-state
569-------
570
571Save the state of all devices to file. The RAM and the block devices
572of the VM are not saved by this command.
573
574Arguments:
575
576- "filename": the file to save the state of the devices to as binary
577data. See xen-save-devices-state.txt for a description of the binary
578format.
579
580Example:
581
582-> { "execute": "xen-save-devices-state",
583 "arguments": { "filename": "/tmp/save" } }
584<- { "return": {} }
585
586EQMP
587
588 {
Anthony PERARD39f42432012-10-03 13:48:19 +0000589 .name = "xen-set-global-dirty-log",
590 .args_type = "enable:b",
591 .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
592 },
593
594SQMP
595xen-set-global-dirty-log
596-------
597
598Enable or disable the global dirty log mode.
599
600Arguments:
601
602- "enable": Enable it or disable it.
603
604Example:
605
606-> { "execute": "xen-set-global-dirty-log",
607 "arguments": { "enable": true } }
608<- { "return": {} }
609
610EQMP
611
612 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300613 .name = "migrate",
614 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
Luiz Capitulinoe1c37d02011-12-05 14:48:01 -0200615 .mhandler.cmd_new = qmp_marshal_input_migrate,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300616 },
617
618SQMP
619migrate
620-------
621
622Migrate to URI.
623
624Arguments:
625
626- "blk": block migration, full disk copy (json-bool, optional)
627- "inc": incremental disk copy (json-bool, optional)
628- "uri": Destination URI (json-string)
629
630Example:
631
632-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
633<- { "return": {} }
634
635Notes:
636
637(1) The 'query-migrate' command should be used to check migration's progress
638 and final result (this information is provided by the 'status' member)
639(2) All boolean arguments default to false
640(3) The user Monitor's "detach" argument is invalid in QMP and should not
641 be used
642
643EQMP
644
645 {
646 .name = "migrate_cancel",
647 .args_type = "",
Luiz Capitulino6cdedb02011-11-27 22:54:09 -0200648 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300649 },
650
651SQMP
652migrate_cancel
653--------------
654
655Cancel the current migration.
656
657Arguments: None.
658
659Example:
660
661-> { "execute": "migrate_cancel" }
662<- { "return": {} }
663
664EQMP
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300665{
666 .name = "migrate-set-cache-size",
667 .args_type = "value:o",
668 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
669 },
670
671SQMP
672migrate-set-cache-size
Juan Quintela817c6042013-02-11 15:11:10 +0100673----------------------
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300674
675Set cache size to be used by XBZRLE migration, the cache size will be rounded
676down to the nearest power of 2
677
678Arguments:
679
680- "value": cache size in bytes (json-int)
681
682Example:
683
684-> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
685<- { "return": {} }
686
687EQMP
688 {
689 .name = "query-migrate-cache-size",
690 .args_type = "",
691 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
692 },
693
694SQMP
695query-migrate-cache-size
Juan Quintela817c6042013-02-11 15:11:10 +0100696------------------------
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300697
698Show cache size to be used by XBZRLE migration
699
700returns a json-object with the following information:
701- "size" : json-int
702
703Example:
704
705-> { "execute": "query-migrate-cache-size" }
706<- { "return": 67108864 }
707
708EQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300709
710 {
711 .name = "migrate_set_speed",
Wen Congyang3a019b62010-11-25 09:06:05 +0800712 .args_type = "value:o",
Luiz Capitulino3dc85382011-11-28 11:59:37 -0200713 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300714 },
715
716SQMP
717migrate_set_speed
718-----------------
719
720Set maximum speed for migrations.
721
722Arguments:
723
Luiz Capitulino5569fd72010-12-15 17:56:18 -0200724- "value": maximum speed, in bytes per second (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300725
726Example:
727
728-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
729<- { "return": {} }
730
731EQMP
732
733 {
734 .name = "migrate_set_downtime",
735 .args_type = "value:T",
Luiz Capitulino4f0a9932011-11-27 23:18:01 -0200736 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300737 },
738
739SQMP
740migrate_set_downtime
741--------------------
742
743Set maximum tolerated downtime (in seconds) for migrations.
744
745Arguments:
746
747- "value": maximum downtime (json-number)
748
749Example:
750
751-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
752<- { "return": {} }
753
754EQMP
755
756 {
Jes Sorensenff73edf2011-03-09 14:31:06 +0100757 .name = "client_migrate_info",
758 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
759 .params = "protocol hostname port tls-port cert-subject",
760 .help = "send migration info to spice/vnc client",
761 .user_print = monitor_user_noop,
Yonit Halperinedc5cb12011-10-17 10:03:18 +0200762 .mhandler.cmd_async = client_migrate_info,
763 .flags = MONITOR_CMD_ASYNC,
Jes Sorensenff73edf2011-03-09 14:31:06 +0100764 },
765
766SQMP
767client_migrate_info
768------------------
769
770Set the spice/vnc connection info for the migration target. The spice/vnc
771server will ask the spice/vnc client to automatically reconnect using the
772new parameters (if specified) once the vm migration finished successfully.
773
774Arguments:
775
776- "protocol": protocol: "spice" or "vnc" (json-string)
777- "hostname": migration target hostname (json-string)
778- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
779- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
780- "cert-subject": server certificate subject (json-string, optional)
781
782Example:
783
784-> { "execute": "client_migrate_info",
785 "arguments": { "protocol": "spice",
786 "hostname": "virt42.lab.kraxel.org",
787 "port": 1234 } }
788<- { "return": {} }
789
790EQMP
791
792 {
Wen Congyang783e9b42012-05-07 12:10:47 +0800793 .name = "dump-guest-memory",
qiaonuohanb53ccc32014-02-18 14:11:36 +0800794 .args_type = "paging:b,protocol:s,begin:i?,end:i?,format:s?",
795 .params = "-p protocol [begin] [length] [format]",
Wen Congyang783e9b42012-05-07 12:10:47 +0800796 .help = "dump guest memory to file",
797 .user_print = monitor_user_noop,
798 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
799 },
800
801SQMP
802dump
803
804
805Dump guest memory to file. The file can be processed with crash or gdb.
806
807Arguments:
808
809- "paging": do paging to get guest's memory mapping (json-bool)
810- "protocol": destination file(started with "file:") or destination file
811 descriptor (started with "fd:") (json-string)
812- "begin": the starting physical address. It's optional, and should be specified
813 with length together (json-int)
814- "length": the memory size, in bytes. It's optional, and should be specified
815 with begin together (json-int)
qiaonuohanb53ccc32014-02-18 14:11:36 +0800816- "format": the format of guest memory dump. It's optional, and can be
817 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
818 conflict with paging and filter, ie. begin and length (json-string)
Wen Congyang783e9b42012-05-07 12:10:47 +0800819
820Example:
821
822-> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
823<- { "return": {} }
824
825Notes:
826
827(1) All boolean arguments default to false
828
829EQMP
830
831 {
qiaonuohan7d6dc7f2014-02-18 14:11:38 +0800832 .name = "query-dump-guest-memory-capability",
833 .args_type = "",
834 .mhandler.cmd_new = qmp_marshal_input_query_dump_guest_memory_capability,
835 },
836
837SQMP
838query-dump-guest-memory-capability
839----------
840
841Show available formats for 'dump-guest-memory'
842
843Example:
844
845-> { "execute": "query-dump-guest-memory-capability" }
846<- { "return": { "formats":
847 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
848
849EQMP
850
851 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300852 .name = "netdev_add",
853 .args_type = "netdev:O",
Luiz Capitulino928059a2012-04-18 17:34:15 -0300854 .mhandler.cmd_new = qmp_netdev_add,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300855 },
856
857SQMP
858netdev_add
859----------
860
861Add host network device.
862
863Arguments:
864
865- "type": the device type, "tap", "user", ... (json-string)
866- "id": the device's ID, must be unique (json-string)
867- device options
868
869Example:
870
871-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
872<- { "return": {} }
873
Markus Armbrusteraf347aa2013-02-22 18:31:51 +0100874Note: The supported device options are the same ones supported by the '-netdev'
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300875 command-line argument, which are listed in the '-help' output or QEMU's
876 manual
877
878EQMP
879
880 {
881 .name = "netdev_del",
882 .args_type = "id:s",
Luiz Capitulino5f964152012-04-16 14:36:32 -0300883 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300884 },
885
886SQMP
887netdev_del
888----------
889
890Remove host network device.
891
892Arguments:
893
894- "id": the device's ID, must be unique (json-string)
895
896Example:
897
898-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
899<- { "return": {} }
900
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100901
902EQMP
903
904 {
Paolo Bonzinicff8b2c2013-12-20 23:21:10 +0100905 .name = "object-add",
906 .args_type = "qom-type:s,id:s,props:q?",
907 .mhandler.cmd_new = qmp_object_add,
908 },
909
910SQMP
911object-add
912----------
913
914Create QOM object.
915
916Arguments:
917
918- "qom-type": the object's QOM type, i.e. the class name (json-string)
919- "id": the object's ID, must be unique (json-string)
920- "props": a dictionary of object property values (optional, json-dict)
921
922Example:
923
924-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
925 "props": { "filename": "/dev/hwrng" } } }
926<- { "return": {} }
927
928EQMP
929
930 {
Paolo Bonziniab2d0532013-12-20 23:21:09 +0100931 .name = "object-del",
932 .args_type = "id:s",
933 .mhandler.cmd_new = qmp_marshal_input_object_del,
934 },
935
936SQMP
937object-del
938----------
939
940Remove QOM object.
941
942Arguments:
943
944- "id": the object's ID (json-string)
945
946Example:
947
948-> { "execute": "object-del", "arguments": { "id": "rng1" } }
949<- { "return": {} }
950
951
952EQMP
953
954
955 {
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100956 .name = "block_resize",
Benoît Canet3b1dbd12014-01-23 21:31:37 +0100957 .args_type = "device:s?,node-name:s?,size:o",
Luiz Capitulino5e7caac2011-11-25 14:57:10 -0200958 .mhandler.cmd_new = qmp_marshal_input_block_resize,
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100959 },
960
961SQMP
962block_resize
963------------
964
965Resize a block image while a guest is running.
966
967Arguments:
968
969- "device": the device's ID, must be unique (json-string)
Benoît Canet3b1dbd12014-01-23 21:31:37 +0100970- "node-name": the node name in the block driver state graph (json-string)
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100971- "size": new size
972
973Example:
974
975-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
976<- { "return": {} }
977
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300978EQMP
979
980 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +0100981 .name = "block-stream",
Paolo Bonzini1d809092012-09-28 17:22:59 +0200982 .args_type = "device:B,base:s?,speed:o?,on-error:s?",
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +0000983 .mhandler.cmd_new = qmp_marshal_input_block_stream,
984 },
985
986 {
Jeff Codyed61fc12012-09-27 13:29:16 -0400987 .name = "block-commit",
Jeff Cody7676e2c2014-06-30 15:14:15 +0200988 .args_type = "device:B,base:s?,top:s?,speed:o?",
Jeff Codyed61fc12012-09-27 13:29:16 -0400989 .mhandler.cmd_new = qmp_marshal_input_block_commit,
990 },
991
Jeff Cody37222902014-01-24 09:02:37 -0500992SQMP
993block-commit
994------------
995
996Live commit of data from overlay image nodes into backing nodes - i.e., writes
997data between 'top' and 'base' into 'base'.
998
999Arguments:
1000
1001- "device": The device's ID, must be unique (json-string)
1002- "base": The file name of the backing image to write data into.
1003 If not specified, this is the deepest backing image
1004 (json-string, optional)
1005- "top": The file name of the backing image within the image chain,
Jeff Cody7676e2c2014-06-30 15:14:15 +02001006 which contains the topmost data to be committed down. If
1007 not specified, this is the active layer. (json-string, optional)
Jeff Cody37222902014-01-24 09:02:37 -05001008
1009 If top == base, that is an error.
1010 If top == active, the job will not be completed by itself,
1011 user needs to complete the job with the block-job-complete
1012 command after getting the ready event. (Since 2.0)
1013
1014 If the base image is smaller than top, then the base image
1015 will be resized to be the same size as top. If top is
1016 smaller than the base image, the base will not be
1017 truncated. If you want the base image size to match the
1018 size of the smaller top, you can safely truncate it
1019 yourself once the commit operation successfully completes.
1020 (json-string)
1021- "speed": the maximum speed, in bytes per second (json-int, optional)
1022
1023
1024Example:
1025
1026-> { "execute": "block-commit", "arguments": { "device": "virtio0",
1027 "top": "/tmp/snap1.qcow2" } }
1028<- { "return": {} }
1029
1030EQMP
1031
Jeff Codyed61fc12012-09-27 13:29:16 -04001032 {
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001033 .name = "drive-backup",
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001034 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001035 "on-source-error:s?,on-target-error:s?",
1036 .mhandler.cmd_new = qmp_marshal_input_drive_backup,
1037 },
1038
1039SQMP
1040drive-backup
1041------------
1042
1043Start a point-in-time copy of a block device to a new destination. The
1044status of ongoing drive-backup operations can be checked with
1045query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1046The operation can be stopped before it has completed using the
1047block-job-cancel command.
1048
1049Arguments:
1050
1051- "device": the name of the device which should be copied.
1052 (json-string)
1053- "target": the target of the new image. If the file exists, or if it is a
1054 device, the existing file/device will be used as the new
1055 destination. If it does not exist, a new file will be created.
1056 (json-string)
1057- "format": the format of the new destination, default is to probe if 'mode' is
1058 'existing', else the format of the source
1059 (json-string, optional)
Stefan Hajnoczib53169e2013-06-26 14:11:57 +02001060- "sync": what parts of the disk image should be copied to the destination;
1061 possibilities include "full" for all the disk, "top" for only the sectors
1062 allocated in the topmost image, or "none" to only replicate new I/O
1063 (MirrorSyncMode).
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001064- "mode": whether and how QEMU should create a new image
1065 (NewImageMode, optional, default 'absolute-paths')
1066- "speed": the maximum speed, in bytes per second (json-int, optional)
1067- "on-source-error": the action to take on an error on the source, default
1068 'report'. 'stop' and 'enospc' can only be used
1069 if the block device supports io-status.
1070 (BlockdevOnError, optional)
1071- "on-target-error": the action to take on an error on the target, default
1072 'report' (no limitations, since this applies to
1073 a different block device than device).
1074 (BlockdevOnError, optional)
1075
1076Example:
1077-> { "execute": "drive-backup", "arguments": { "device": "drive0",
Ian Mainfc5d3f82013-07-26 11:39:04 -07001078 "sync": "full",
Stefan Hajnoczi99a9add2013-06-24 17:13:14 +02001079 "target": "backup.img" } }
1080<- { "return": {} }
1081EQMP
1082
1083 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001084 .name = "block-job-set-speed",
Stefan Hajnoczi882ec7c2012-04-25 16:51:02 +01001085 .args_type = "device:B,speed:o",
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001086 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
1087 },
1088
1089 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001090 .name = "block-job-cancel",
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001091 .args_type = "device:B,force:b?",
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001092 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
1093 },
Jeff Codyc1864022012-02-28 15:54:07 -05001094 {
Paolo Bonzini6e37fb82012-09-28 17:22:51 +02001095 .name = "block-job-pause",
1096 .args_type = "device:B",
1097 .mhandler.cmd_new = qmp_marshal_input_block_job_pause,
1098 },
1099 {
1100 .name = "block-job-resume",
1101 .args_type = "device:B",
1102 .mhandler.cmd_new = qmp_marshal_input_block_job_resume,
1103 },
1104 {
Paolo Bonziniaeae8832012-10-18 16:49:21 +02001105 .name = "block-job-complete",
1106 .args_type = "device:B",
1107 .mhandler.cmd_new = qmp_marshal_input_block_job_complete,
1108 },
1109 {
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001110 .name = "transaction",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01001111 .args_type = "actions:q",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001112 .mhandler.cmd_new = qmp_marshal_input_transaction,
Jeff Codyc1864022012-02-28 15:54:07 -05001113 },
1114
1115SQMP
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001116transaction
1117-----------
Jeff Codyc1864022012-02-28 15:54:07 -05001118
Wenchao Xiabbe86012013-09-11 14:04:34 +08001119Atomically operate on one or more block devices. The only supported operations
1120for now are drive-backup, internal and external snapshotting. A list of
1121dictionaries is accepted, that contains the actions to be performed.
1122If there is any failure performing any of the operations, all operations
1123for the group are abandoned.
Jeff Codyc1864022012-02-28 15:54:07 -05001124
Wenchao Xiabbe86012013-09-11 14:04:34 +08001125For external snapshots, the dictionary contains the device, the file to use for
1126the new snapshot, and the format. The default format, if not specified, is
1127qcow2.
Jeff Codyc1864022012-02-28 15:54:07 -05001128
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001129Each new snapshot defaults to being created by QEMU (wiping any
1130contents if the file already exists), but it is also possible to reuse
1131an externally-created file. In the latter case, you should ensure that
1132the new image file has the same contents as the current one; QEMU cannot
1133perform any meaningful check. Typically this is achieved by using the
1134current image file as the backing file for the new image.
1135
Wenchao Xiabbe86012013-09-11 14:04:34 +08001136On failure, the original disks pre-snapshot attempt will be used.
1137
1138For internal snapshots, the dictionary contains the device and the snapshot's
1139name. If an internal snapshot matching name already exists, the request will
1140be rejected. Only some image formats support it, for example, qcow2, rbd,
1141and sheepdog.
1142
1143On failure, qemu will try delete the newly created internal snapshot in the
1144transaction. When an I/O error occurs during deletion, the user needs to fix
1145it later with qemu-img or other command.
1146
Jeff Codyc1864022012-02-28 15:54:07 -05001147Arguments:
1148
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001149actions array:
1150 - "type": the operation to perform. The only supported
1151 value is "blockdev-snapshot-sync". (json-string)
1152 - "data": a dictionary. The contents depend on the value
1153 of "type". When "type" is "blockdev-snapshot-sync":
1154 - "device": device name to snapshot (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001155 - "node-name": graph node name to snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001156 - "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001157 - "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001158 - "format": format of new image (json-string, optional)
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001159 - "mode": whether and how QEMU should create the snapshot file
1160 (NewImageMode, optional, default "absolute-paths")
Wenchao Xiabbe86012013-09-11 14:04:34 +08001161 When "type" is "blockdev-snapshot-internal-sync":
1162 - "device": device name to snapshot (json-string)
1163 - "name": name of the new snapshot (json-string)
Jeff Codyc1864022012-02-28 15:54:07 -05001164
1165Example:
1166
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001167-> { "execute": "transaction",
1168 "arguments": { "actions": [
Eric Blakecd0c5382014-05-06 09:39:03 -06001169 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001170 "snapshot-file": "/some/place/my-image",
1171 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001172 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
Benoît Canet0901f672014-01-23 21:31:38 +01001173 "snapshot-file": "/some/place/my-image2",
1174 "snapshot-node-name": "node3432",
1175 "mode": "existing",
1176 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001177 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001178 "snapshot-file": "/some/place/my-image2",
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001179 "mode": "existing",
Wenchao Xiabbe86012013-09-11 14:04:34 +08001180 "format": "qcow2" } },
Eric Blakecd0c5382014-05-06 09:39:03 -06001181 { "type": "blockdev-snapshot-internal-sync", "data" : {
Wenchao Xiabbe86012013-09-11 14:04:34 +08001182 "device": "ide-hd2",
1183 "name": "snapshot0" } } ] } }
Jeff Codyc1864022012-02-28 15:54:07 -05001184<- { "return": {} }
1185
1186EQMP
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001187
1188 {
Jes Sorensend967b2f2011-07-11 20:01:09 +02001189 .name = "blockdev-snapshot-sync",
Benoît Canet0901f672014-01-23 21:31:38 +01001190 .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 -02001191 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
Jes Sorensend967b2f2011-07-11 20:01:09 +02001192 },
1193
1194SQMP
1195blockdev-snapshot-sync
1196----------------------
1197
1198Synchronous snapshot of a block device. snapshot-file specifies the
1199target of the new image. If the file exists, or if it is a device, the
1200snapshot will be created in the existing file/device. If does not
1201exist, a new file will be created. format specifies the format of the
1202snapshot image, default is qcow2.
1203
1204Arguments:
1205
1206- "device": device name to snapshot (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001207- "node-name": graph node name to snapshot (json-string)
Jes Sorensend967b2f2011-07-11 20:01:09 +02001208- "snapshot-file": name of new image file (json-string)
Benoît Canet0901f672014-01-23 21:31:38 +01001209- "snapshot-node-name": graph node name of the new snapshot (json-string)
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001210- "mode": whether and how QEMU should create the snapshot file
1211 (NewImageMode, optional, default "absolute-paths")
Jes Sorensend967b2f2011-07-11 20:01:09 +02001212- "format": format of new image (json-string, optional)
1213
1214Example:
1215
Luiz Capitulino7f3850c2011-10-10 17:30:08 -03001216-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1217 "snapshot-file":
1218 "/some/place/my-image",
1219 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +02001220<- { "return": {} }
1221
1222EQMP
1223
1224 {
Wenchao Xiaf323bc92013-09-11 14:04:35 +08001225 .name = "blockdev-snapshot-internal-sync",
1226 .args_type = "device:B,name:s",
1227 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_internal_sync,
1228 },
1229
1230SQMP
1231blockdev-snapshot-internal-sync
1232-------------------------------
1233
1234Synchronously take an internal snapshot of a block device when the format of
1235image used supports it. If the name is an empty string, or a snapshot with
1236name already exists, the operation will fail.
1237
1238Arguments:
1239
1240- "device": device name to snapshot (json-string)
1241- "name": name of the new snapshot (json-string)
1242
1243Example:
1244
1245-> { "execute": "blockdev-snapshot-internal-sync",
1246 "arguments": { "device": "ide-hd0",
1247 "name": "snapshot0" }
1248 }
1249<- { "return": {} }
1250
1251EQMP
1252
1253 {
Wenchao Xia44e3e052013-09-11 14:04:36 +08001254 .name = "blockdev-snapshot-delete-internal-sync",
1255 .args_type = "device:B,id:s?,name:s?",
1256 .mhandler.cmd_new =
1257 qmp_marshal_input_blockdev_snapshot_delete_internal_sync,
1258 },
1259
1260SQMP
1261blockdev-snapshot-delete-internal-sync
1262--------------------------------------
1263
1264Synchronously delete an internal snapshot of a block device when the format of
1265image used supports it. The snapshot is identified by name or id or both. One
1266of name or id is required. If the snapshot is not found, the operation will
1267fail.
1268
1269Arguments:
1270
1271- "device": device name (json-string)
1272- "id": ID of the snapshot (json-string, optional)
1273- "name": name of the snapshot (json-string, optional)
1274
1275Example:
1276
1277-> { "execute": "blockdev-snapshot-delete-internal-sync",
1278 "arguments": { "device": "ide-hd0",
1279 "name": "snapshot0" }
1280 }
1281<- { "return": {
1282 "id": "1",
1283 "name": "snapshot0",
1284 "vm-state-size": 0,
1285 "date-sec": 1000012,
1286 "date-nsec": 10,
1287 "vm-clock-sec": 100,
1288 "vm-clock-nsec": 20
1289 }
1290 }
1291
1292EQMP
1293
1294 {
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001295 .name = "drive-mirror",
Paolo Bonzinib952b552012-10-18 16:49:28 +02001296 .args_type = "sync:s,device:B,target:s,speed:i?,mode:s?,format:s?,"
Benoît Canet09158f02014-06-27 18:25:25 +02001297 "node-name:s?,replaces:s?,"
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001298 "on-source-error:s?,on-target-error:s?,"
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001299 "granularity:i?,buf-size:i?",
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001300 .mhandler.cmd_new = qmp_marshal_input_drive_mirror,
1301 },
1302
1303SQMP
1304drive-mirror
1305------------
1306
1307Start mirroring a block device's writes to a new destination. target
1308specifies the target of the new image. If the file exists, or if it is
1309a device, it will be used as the new destination for writes. If it does not
1310exist, a new file will be created. format specifies the format of the
1311mirror image, default is to probe if mode='existing', else the format
1312of the source.
1313
1314Arguments:
1315
1316- "device": device name to operate on (json-string)
1317- "target": name of new image file (json-string)
1318- "format": format of new image (json-string, optional)
Benoît Canet4c828dc2014-06-16 12:00:55 +02001319- "node-name": the name of the new block driver state in the node graph
1320 (json-string, optional)
Benoît Canet09158f02014-06-27 18:25:25 +02001321- "replaces": the block driver node name to replace when finished
1322 (json-string, optional)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001323- "mode": how an image file should be created into the target
1324 file/device (NewImageMode, optional, default 'absolute-paths')
1325- "speed": maximum speed of the streaming job, in bytes per second
1326 (json-int)
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001327- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
Paolo Bonzini08e4ed62013-01-22 09:03:13 +01001328- "buf_size": maximum amount of data in flight from source to target, in bytes
1329 (json-int, default 10M)
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001330- "sync": what parts of the disk image should be copied to the destination;
1331 possibilities include "full" for all the disk, "top" for only the sectors
1332 allocated in the topmost image, or "none" to only replicate new I/O
1333 (MirrorSyncMode).
Paolo Bonzinib952b552012-10-18 16:49:28 +02001334- "on-source-error": the action to take on an error on the source
1335 (BlockdevOnError, default 'report')
1336- "on-target-error": the action to take on an error on the target
1337 (BlockdevOnError, default 'report')
1338
Paolo Bonzinieee13df2013-01-21 17:09:46 +01001339The default value of the granularity is the image cluster size clamped
1340between 4096 and 65536, if the image format defines one. If the format
1341does not define a cluster size, the default value of the granularity
1342is 65536.
Paolo Bonzinid9b902d2012-10-18 16:49:24 +02001343
1344
1345Example:
1346
1347-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1348 "target": "/some/place/my-image",
1349 "sync": "full",
1350 "format": "qcow2" } }
1351<- { "return": {} }
1352
1353EQMP
1354
1355 {
Jeff Codyfa40e652014-07-01 09:52:16 +02001356 .name = "change-backing-file",
1357 .args_type = "device:s,image-node-name:s,backing-file:s",
1358 .mhandler.cmd_new = qmp_marshal_input_change_backing_file,
1359 },
1360
1361SQMP
1362change-backing-file
1363-------------------
1364Since: 2.1
1365
1366Change the backing file in the image file metadata. This does not cause
1367QEMU to reopen the image file to reparse the backing filename (it may,
1368however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1369if needed). The new backing file string is written into the image file
1370metadata, and the QEMU internal strings are updated.
1371
1372Arguments:
1373
1374- "image-node-name": The name of the block driver state node of the
1375 image to modify. The "device" is argument is used to
1376 verify "image-node-name" is in the chain described by
1377 "device".
1378 (json-string, optional)
1379
1380- "device": The name of the device.
1381 (json-string)
1382
1383- "backing-file": The string to write as the backing file. This string is
1384 not validated, so care should be taken when specifying
1385 the string or the image chain may not be able to be
1386 reopened again.
1387 (json-string)
1388
1389Returns: Nothing on success
1390 If "device" does not exist or cannot be determined, DeviceNotFound
1391
1392EQMP
1393
1394 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001395 .name = "balloon",
1396 .args_type = "value:M",
Luiz Capitulinod72f3262011-11-25 14:38:09 -02001397 .mhandler.cmd_new = qmp_marshal_input_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001398 },
1399
1400SQMP
1401balloon
1402-------
1403
1404Request VM to change its memory allocation (in bytes).
1405
1406Arguments:
1407
1408- "value": New memory allocation (json-int)
1409
1410Example:
1411
1412-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1413<- { "return": {} }
1414
1415EQMP
1416
1417 {
1418 .name = "set_link",
1419 .args_type = "name:s,up:b",
Luiz Capitulino4b371562011-11-23 13:11:55 -02001420 .mhandler.cmd_new = qmp_marshal_input_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001421 },
1422
1423SQMP
1424set_link
1425--------
1426
1427Change the link status of a network adapter.
1428
1429Arguments:
1430
1431- "name": network device name (json-string)
1432- "up": status is up (json-bool)
1433
1434Example:
1435
1436-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1437<- { "return": {} }
1438
1439EQMP
1440
1441 {
1442 .name = "getfd",
1443 .args_type = "fdname:s",
1444 .params = "getfd name",
1445 .help = "receive a file descriptor via SCM rights and assign it a name",
Corey Bryant208c9d12012-06-22 14:36:09 -04001446 .mhandler.cmd_new = qmp_marshal_input_getfd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001447 },
1448
1449SQMP
1450getfd
1451-----
1452
1453Receive a file descriptor via SCM rights and assign it a name.
1454
1455Arguments:
1456
1457- "fdname": file descriptor name (json-string)
1458
1459Example:
1460
1461-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1462<- { "return": {} }
1463
Corey Bryant208c9d12012-06-22 14:36:09 -04001464Notes:
1465
1466(1) If the name specified by the "fdname" argument already exists,
1467 the file descriptor assigned to it will be closed and replaced
1468 by the received file descriptor.
1469(2) The 'closefd' command can be used to explicitly close the file
1470 descriptor when it is no longer needed.
1471
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001472EQMP
1473
1474 {
1475 .name = "closefd",
1476 .args_type = "fdname:s",
1477 .params = "closefd name",
1478 .help = "close a file descriptor previously passed via SCM rights",
Corey Bryant208c9d12012-06-22 14:36:09 -04001479 .mhandler.cmd_new = qmp_marshal_input_closefd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001480 },
1481
1482SQMP
1483closefd
1484-------
1485
1486Close a file descriptor previously passed via SCM rights.
1487
1488Arguments:
1489
1490- "fdname": file descriptor name (json-string)
1491
1492Example:
1493
1494-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1495<- { "return": {} }
1496
1497EQMP
1498
Corey Bryantba1c0482012-08-14 16:43:43 -04001499 {
1500 .name = "add-fd",
1501 .args_type = "fdset-id:i?,opaque:s?",
1502 .params = "add-fd fdset-id opaque",
1503 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1504 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1505 },
1506
1507SQMP
1508add-fd
1509-------
1510
1511Add a file descriptor, that was passed via SCM rights, to an fd set.
1512
1513Arguments:
1514
1515- "fdset-id": The ID of the fd set to add the file descriptor to.
1516 (json-int, optional)
1517- "opaque": A free-form string that can be used to describe the fd.
1518 (json-string, optional)
1519
1520Return a json-object with the following information:
1521
1522- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1523- "fd": The file descriptor that was received via SCM rights and added to the
1524 fd set. (json-int)
1525
1526Example:
1527
1528-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1529<- { "return": { "fdset-id": 1, "fd": 3 } }
1530
1531Notes:
1532
1533(1) The list of fd sets is shared by all monitor connections.
1534(2) If "fdset-id" is not specified, a new fd set will be created.
1535
1536EQMP
1537
1538 {
1539 .name = "remove-fd",
1540 .args_type = "fdset-id:i,fd:i?",
1541 .params = "remove-fd fdset-id fd",
1542 .help = "Remove a file descriptor from an fd set",
1543 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1544 },
1545
1546SQMP
1547remove-fd
1548---------
1549
1550Remove a file descriptor from an fd set.
1551
1552Arguments:
1553
1554- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1555 (json-int)
1556- "fd": The file descriptor that is to be removed. (json-int, optional)
1557
1558Example:
1559
1560-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1561<- { "return": {} }
1562
1563Notes:
1564
1565(1) The list of fd sets is shared by all monitor connections.
1566(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1567 removed.
1568
1569EQMP
1570
1571 {
1572 .name = "query-fdsets",
1573 .args_type = "",
1574 .help = "Return information describing all fd sets",
1575 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1576 },
1577
1578SQMP
1579query-fdsets
1580-------------
1581
1582Return information describing all fd sets.
1583
1584Arguments: None
1585
1586Example:
1587
1588-> { "execute": "query-fdsets" }
1589<- { "return": [
1590 {
1591 "fds": [
1592 {
1593 "fd": 30,
1594 "opaque": "rdonly:/path/to/file"
1595 },
1596 {
1597 "fd": 24,
1598 "opaque": "rdwr:/path/to/file"
1599 }
1600 ],
1601 "fdset-id": 1
1602 },
1603 {
1604 "fds": [
1605 {
1606 "fd": 28
1607 },
1608 {
1609 "fd": 29
1610 }
1611 ],
1612 "fdset-id": 0
1613 }
1614 ]
1615 }
1616
1617Note: The list of fd sets is shared by all monitor connections.
1618
1619EQMP
1620
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001621 {
1622 .name = "block_passwd",
Benoît Canet12d3ba82014-01-23 21:31:35 +01001623 .args_type = "device:s?,node-name:s?,password:s",
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -02001624 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001625 },
1626
1627SQMP
1628block_passwd
1629------------
1630
1631Set the password of encrypted block devices.
1632
1633Arguments:
1634
1635- "device": device name (json-string)
Benoît Canet12d3ba82014-01-23 21:31:35 +01001636- "node-name": name in the block driver state graph (json-string)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001637- "password": password (json-string)
1638
1639Example:
1640
1641-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1642 "password": "12345" } }
1643<- { "return": {} }
1644
1645EQMP
1646
1647 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001648 .name = "block_set_io_throttle",
Benoît Canet2024c1d2013-09-02 14:14:41 +02001649 .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?",
Luiz Capitulino80047da2011-12-14 16:49:14 -02001650 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001651 },
1652
1653SQMP
1654block_set_io_throttle
1655------------
1656
1657Change I/O throttle limits for a block drive.
1658
1659Arguments:
1660
1661- "device": device name (json-string)
Eric Blake586b5462013-08-30 14:44:11 -06001662- "bps": total throughput limit in bytes per second (json-int)
1663- "bps_rd": read throughput limit in bytes per second (json-int)
1664- "bps_wr": write throughput limit in bytes per second (json-int)
1665- "iops": total I/O operations per second (json-int)
1666- "iops_rd": read I/O operations per second (json-int)
1667- "iops_wr": write I/O operations per second (json-int)
Benoît Canet3e9fab62013-09-02 14:14:40 +02001668- "bps_max": total max in bytes (json-int)
1669- "bps_rd_max": read max in bytes (json-int)
1670- "bps_wr_max": write max in bytes (json-int)
1671- "iops_max": total I/O operations max (json-int)
1672- "iops_rd_max": read I/O operations max (json-int)
1673- "iops_wr_max": write I/O operations max (json-int)
Benoît Canet2024c1d2013-09-02 14:14:41 +02001674- "iops_size": I/O size in bytes when limiting (json-int)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001675
1676Example:
1677
1678-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
Eric Blake586b5462013-08-30 14:44:11 -06001679 "bps": 1000000,
1680 "bps_rd": 0,
1681 "bps_wr": 0,
1682 "iops": 0,
1683 "iops_rd": 0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02001684 "iops_wr": 0,
1685 "bps_max": 8000000,
1686 "bps_rd_max": 0,
1687 "bps_wr_max": 0,
1688 "iops_max": 0,
1689 "iops_rd_max": 0,
Benoît Canet2024c1d2013-09-02 14:14:41 +02001690 "iops_wr_max": 0,
1691 "iops_size": 0 } }
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001692<- { "return": {} }
1693
1694EQMP
1695
1696 {
Gerd Hoffmann75721502010-10-07 12:22:54 +02001697 .name = "set_password",
1698 .args_type = "protocol:s,password:s,connected:s?",
Luiz Capitulinofbf796f2011-12-07 11:17:51 -02001699 .mhandler.cmd_new = qmp_marshal_input_set_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001700 },
1701
1702SQMP
1703set_password
1704------------
1705
1706Set the password for vnc/spice protocols.
1707
1708Arguments:
1709
1710- "protocol": protocol name (json-string)
1711- "password": password (json-string)
1712- "connected": [ keep | disconnect | fail ] (josn-string, optional)
1713
1714Example:
1715
1716-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1717 "password": "secret" } }
1718<- { "return": {} }
1719
1720EQMP
1721
1722 {
1723 .name = "expire_password",
1724 .args_type = "protocol:s,time:s",
Luiz Capitulino9ad53722011-12-07 11:47:57 -02001725 .mhandler.cmd_new = qmp_marshal_input_expire_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001726 },
1727
1728SQMP
1729expire_password
1730---------------
1731
1732Set the password expire time for vnc/spice protocols.
1733
1734Arguments:
1735
1736- "protocol": protocol name (json-string)
1737- "time": [ now | never | +secs | secs ] (json-string)
1738
1739Example:
1740
1741-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1742 "time": "+60" } }
1743<- { "return": {} }
1744
1745EQMP
1746
1747 {
Daniel P. Berrange13661082011-06-23 13:31:42 +01001748 .name = "add_client",
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001749 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
Luiz Capitulinob224e5e2012-09-13 16:52:20 -03001750 .mhandler.cmd_new = qmp_marshal_input_add_client,
Daniel P. Berrange13661082011-06-23 13:31:42 +01001751 },
1752
1753SQMP
1754add_client
1755----------
1756
1757Add a graphics client
1758
1759Arguments:
1760
1761- "protocol": protocol name (json-string)
1762- "fdname": file descriptor name (json-string)
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001763- "skipauth": whether to skip authentication (json-bool, optional)
1764- "tls": whether to perform TLS (json-bool, optional)
Daniel P. Berrange13661082011-06-23 13:31:42 +01001765
1766Example:
1767
1768-> { "execute": "add_client", "arguments": { "protocol": "vnc",
1769 "fdname": "myclient" } }
1770<- { "return": {} }
1771
1772EQMP
1773 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001774 .name = "qmp_capabilities",
1775 .args_type = "",
1776 .params = "",
1777 .help = "enable QMP capabilities",
1778 .user_print = monitor_user_noop,
1779 .mhandler.cmd_new = do_qmp_capabilities,
1780 },
1781
1782SQMP
1783qmp_capabilities
1784----------------
1785
1786Enable QMP capabilities.
1787
1788Arguments: None.
1789
1790Example:
1791
1792-> { "execute": "qmp_capabilities" }
1793<- { "return": {} }
1794
1795Note: This command must be issued before issuing any other command.
1796
Luiz Capitulino0268d972010-10-22 10:08:02 -02001797EQMP
1798
1799 {
1800 .name = "human-monitor-command",
1801 .args_type = "command-line:s,cpu-index:i?",
Luiz Capitulinod51a67b2011-11-25 17:52:45 -02001802 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
Luiz Capitulino0268d972010-10-22 10:08:02 -02001803 },
1804
1805SQMP
1806human-monitor-command
1807---------------------
1808
1809Execute a Human Monitor command.
1810
1811Arguments:
1812
1813- command-line: the command name and its arguments, just like the
1814 Human Monitor's shell (json-string)
1815- cpu-index: select the CPU number to be used by commands which access CPU
1816 data, like 'info registers'. The Monitor selects CPU 0 if this
1817 argument is not provided (json-int, optional)
1818
1819Example:
1820
1821-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1822<- { "return": "kvm support: enabled\r\n" }
1823
1824Notes:
1825
1826(1) The Human Monitor is NOT an stable interface, this means that command
1827 names, arguments and responses can change or be removed at ANY time.
1828 Applications that rely on long term stability guarantees should NOT
1829 use this command
1830
1831(2) Limitations:
1832
1833 o This command is stateless, this means that commands that depend
1834 on state information (such as getfd) might not work
1835
1836 o Commands that prompt the user for data (eg. 'cont' when the block
1837 device is encrypted) don't currently work
1838
Luiz Capitulino82a56f02010-09-13 12:26:00 -030018393. Query Commands
1840=================
1841
1842HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1843HXCOMM this! We will possibly move query commands definitions inside those
1844HXCOMM sections, just like regular commands.
1845
1846EQMP
1847
1848SQMP
1849query-version
1850-------------
1851
1852Show QEMU version.
1853
1854Return a json-object with the following information:
1855
1856- "qemu": A json-object containing three integer values:
1857 - "major": QEMU's major version (json-int)
1858 - "minor": QEMU's minor version (json-int)
1859 - "micro": QEMU's micro version (json-int)
1860- "package": package's version (json-string)
1861
1862Example:
1863
1864-> { "execute": "query-version" }
1865<- {
1866 "return":{
1867 "qemu":{
1868 "major":0,
1869 "minor":11,
1870 "micro":5
1871 },
1872 "package":""
1873 }
1874 }
1875
1876EQMP
1877
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03001878 {
1879 .name = "query-version",
1880 .args_type = "",
1881 .mhandler.cmd_new = qmp_marshal_input_query_version,
1882 },
1883
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001884SQMP
1885query-commands
1886--------------
1887
1888List QMP available commands.
1889
1890Each command is represented by a json-object, the returned value is a json-array
1891of all commands.
1892
1893Each json-object contain:
1894
1895- "name": command's name (json-string)
1896
1897Example:
1898
1899-> { "execute": "query-commands" }
1900<- {
1901 "return":[
1902 {
1903 "name":"query-balloon"
1904 },
1905 {
1906 "name":"system_powerdown"
1907 }
1908 ]
1909 }
1910
1911Note: This example has been shortened as the real response is too long.
1912
1913EQMP
1914
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03001915 {
1916 .name = "query-commands",
1917 .args_type = "",
1918 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1919 },
1920
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001921SQMP
Daniel P. Berrange48608532012-05-21 17:59:51 +01001922query-events
1923--------------
1924
1925List QMP available events.
1926
1927Each event is represented by a json-object, the returned value is a json-array
1928of all events.
1929
1930Each json-object contains:
1931
1932- "name": event's name (json-string)
1933
1934Example:
1935
1936-> { "execute": "query-events" }
1937<- {
1938 "return":[
1939 {
1940 "name":"SHUTDOWN"
1941 },
1942 {
1943 "name":"RESET"
1944 }
1945 ]
1946 }
1947
1948Note: This example has been shortened as the real response is too long.
1949
1950EQMP
1951
1952 {
1953 .name = "query-events",
1954 .args_type = "",
1955 .mhandler.cmd_new = qmp_marshal_input_query_events,
1956 },
1957
1958SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001959query-chardev
1960-------------
1961
1962Each device is represented by a json-object. The returned value is a json-array
1963of all devices.
1964
1965Each json-object contain the following:
1966
1967- "label": device's label (json-string)
1968- "filename": device's file (json-string)
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02001969- "frontend-open": open/closed state of the frontend device attached to this
1970 backend (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001971
1972Example:
1973
1974-> { "execute": "query-chardev" }
1975<- {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02001976 "return": [
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001977 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02001978 "label": "charchannel0",
1979 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
1980 "frontend-open": false
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001981 },
1982 {
Laszlo Ersek32a97ea2014-06-26 17:50:03 +02001983 "label": "charmonitor",
1984 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
1985 "frontend-open": true
1986 },
1987 {
1988 "label": "charserial0",
1989 "filename": "pty:/dev/pts/2",
1990 "frontend-open": true
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001991 }
1992 ]
1993 }
1994
1995EQMP
1996
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03001997 {
1998 .name = "query-chardev",
1999 .args_type = "",
2000 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
2001 },
2002
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002003SQMP
Martin Kletzander77d1c3c2014-02-01 12:52:42 +01002004query-chardev-backends
2005-------------
2006
2007List available character device backends.
2008
2009Each backend is represented by a json-object, the returned value is a json-array
2010of all backends.
2011
2012Each json-object contains:
2013
2014- "name": backend name (json-string)
2015
2016Example:
2017
2018-> { "execute": "query-chardev-backends" }
2019<- {
2020 "return":[
2021 {
2022 "name":"udp"
2023 },
2024 {
2025 "name":"tcp"
2026 },
2027 {
2028 "name":"unix"
2029 },
2030 {
2031 "name":"spiceport"
2032 }
2033 ]
2034 }
2035
2036EQMP
2037
2038 {
2039 .name = "query-chardev-backends",
2040 .args_type = "",
2041 .mhandler.cmd_new = qmp_marshal_input_query_chardev_backends,
2042 },
2043
2044SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002045query-block
2046-----------
2047
2048Show the block devices.
2049
2050Each block device information is stored in a json-object and the returned value
2051is a json-array of all devices.
2052
2053Each json-object contain the following:
2054
2055- "device": device name (json-string)
2056- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002057 - deprecated, retained for backward compatibility
2058 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002059- "removable": true if the device is removable, false otherwise (json-bool)
2060- "locked": true if the device is locked, false otherwise (json-bool)
Michal Privoznik99f42802013-01-29 17:58:41 +01002061- "tray_open": only present if removable, true if the device has a tray,
Markus Armbrustere4def802011-09-06 18:58:53 +02002062 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002063- "inserted": only present if the device is inserted, it is a json-object
2064 containing the following:
2065 - "file": device file name (json-string)
2066 - "ro": true if read-only, false otherwise (json-bool)
2067 - "drv": driver format name (json-string)
2068 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
2069 "file", "file", "ftp", "ftps", "host_cdrom",
2070 "host_device", "host_floppy", "http", "https",
2071 "nbd", "parallels", "qcow", "qcow2", "raw",
2072 "tftp", "vdi", "vmdk", "vpc", "vvfat"
2073 - "backing_file": backing file name (json-string, optional)
Benoît Canet2e3e3312012-08-02 10:22:48 +02002074 - "backing_file_depth": number of files in the backing file chain (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002075 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002076 - "bps": limit total bytes per second (json-int)
2077 - "bps_rd": limit read bytes per second (json-int)
2078 - "bps_wr": limit write bytes per second (json-int)
2079 - "iops": limit total I/O operations per second (json-int)
2080 - "iops_rd": limit read operations per second (json-int)
2081 - "iops_wr": limit write operations per second (json-int)
Benoît Canet3e9fab62013-09-02 14:14:40 +02002082 - "bps_max": total max in bytes (json-int)
2083 - "bps_rd_max": read max in bytes (json-int)
2084 - "bps_wr_max": write max in bytes (json-int)
2085 - "iops_max": total I/O operations max (json-int)
2086 - "iops_rd_max": read I/O operations max (json-int)
2087 - "iops_wr_max": write I/O operations max (json-int)
Benoît Canet2024c1d2013-09-02 14:14:41 +02002088 - "iops_size": I/O size when limiting by iops (json-int)
Peter Lieven465bee12014-05-18 00:58:19 +02002089 - "detect_zeroes": detect and optimize zero writing (json-string)
2090 - Possible values: "off", "on", "unmap"
Wenchao Xia553a7e82013-06-06 12:27:59 +08002091 - "image": the detail of the image, it is a json-object containing
2092 the following:
2093 - "filename": image file name (json-string)
2094 - "format": image format (json-string)
2095 - "virtual-size": image capacity in bytes (json-int)
2096 - "dirty-flag": true if image is not cleanly closed, not present
2097 means clean (json-bool, optional)
2098 - "actual-size": actual size on disk in bytes of the image, not
2099 present when image does not support thin
2100 provision (json-int, optional)
2101 - "cluster-size": size of a cluster in bytes, not present if image
2102 format does not support it (json-int, optional)
2103 - "encrypted": true if the image is encrypted, not present means
2104 false or the image format does not support
2105 encryption (json-bool, optional)
2106 - "backing_file": backing file name, not present means no backing
2107 file is used or the image format does not
2108 support backing file chain
2109 (json-string, optional)
2110 - "full-backing-filename": full path of the backing file, not
2111 present if it equals backing_file or no
2112 backing file is used
2113 (json-string, optional)
2114 - "backing-filename-format": the format of the backing file, not
2115 present means unknown or no backing
2116 file (json-string, optional)
2117 - "snapshots": the internal snapshot info, it is an optional list
2118 of json-object containing the following:
2119 - "id": unique snapshot id (json-string)
2120 - "name": snapshot name (json-string)
2121 - "vm-state-size": size of the VM state in bytes (json-int)
2122 - "date-sec": UTC date of the snapshot in seconds (json-int)
2123 - "date-nsec": fractional part in nanoseconds to be used with
Eric Blake586b5462013-08-30 14:44:11 -06002124 date-sec (json-int)
Wenchao Xia553a7e82013-06-06 12:27:59 +08002125 - "vm-clock-sec": VM clock relative to boot in seconds
2126 (json-int)
2127 - "vm-clock-nsec": fractional part in nanoseconds to be used
2128 with vm-clock-sec (json-int)
2129 - "backing-image": the detail of the backing image, it is an
2130 optional json-object only present when a
2131 backing image present for this image
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002132
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002133- "io-status": I/O operation status, only present if the device supports it
2134 and the VM is configured to stop on errors. It's always reset
2135 to "ok" when the "cont" command is issued (json_string, optional)
2136 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002137
2138Example:
2139
2140-> { "execute": "query-block" }
2141<- {
2142 "return":[
2143 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002144 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002145 "device":"ide0-hd0",
2146 "locked":false,
2147 "removable":false,
2148 "inserted":{
2149 "ro":false,
2150 "drv":"qcow2",
2151 "encrypted":false,
Wenchao Xia553a7e82013-06-06 12:27:59 +08002152 "file":"disks/test.qcow2",
2153 "backing_file_depth":1,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08002154 "bps":1000000,
2155 "bps_rd":0,
2156 "bps_wr":0,
2157 "iops":1000000,
2158 "iops_rd":0,
2159 "iops_wr":0,
Benoît Canet3e9fab62013-09-02 14:14:40 +02002160 "bps_max": 8000000,
2161 "bps_rd_max": 0,
2162 "bps_wr_max": 0,
2163 "iops_max": 0,
2164 "iops_rd_max": 0,
2165 "iops_wr_max": 0,
Benoît Canet2024c1d2013-09-02 14:14:41 +02002166 "iops_size": 0,
Peter Lieven465bee12014-05-18 00:58:19 +02002167 "detect_zeroes": "on",
Wenchao Xia553a7e82013-06-06 12:27:59 +08002168 "image":{
2169 "filename":"disks/test.qcow2",
2170 "format":"qcow2",
2171 "virtual-size":2048000,
2172 "backing_file":"base.qcow2",
2173 "full-backing-filename":"disks/base.qcow2",
2174 "backing-filename-format:"qcow2",
2175 "snapshots":[
2176 {
2177 "id": "1",
2178 "name": "snapshot1",
2179 "vm-state-size": 0,
2180 "date-sec": 10000200,
2181 "date-nsec": 12,
2182 "vm-clock-sec": 206,
2183 "vm-clock-nsec": 30
2184 }
2185 ],
2186 "backing-image":{
2187 "filename":"disks/base.qcow2",
2188 "format":"qcow2",
2189 "virtual-size":2048000
2190 }
2191 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002192 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002193 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002194 },
2195 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03002196 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002197 "device":"ide1-cd0",
2198 "locked":false,
2199 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002200 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002201 },
2202 {
2203 "device":"floppy0",
2204 "locked":false,
2205 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002206 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002207 },
2208 {
2209 "device":"sd0",
2210 "locked":false,
2211 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02002212 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002213 }
2214 ]
2215 }
2216
2217EQMP
2218
Luiz Capitulinob2023812011-09-21 17:16:47 -03002219 {
2220 .name = "query-block",
2221 .args_type = "",
2222 .mhandler.cmd_new = qmp_marshal_input_query_block,
2223 },
2224
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002225SQMP
2226query-blockstats
2227----------------
2228
2229Show block device statistics.
2230
2231Each device statistic information is stored in a json-object and the returned
2232value is a json-array of all devices.
2233
2234Each json-object contain the following:
2235
2236- "device": device name (json-string)
2237- "stats": A json-object with the statistics information, it contains:
2238 - "rd_bytes": bytes read (json-int)
2239 - "wr_bytes": bytes written (json-int)
2240 - "rd_operations": read operations (json-int)
2241 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02002242 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002243 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
2244 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
2245 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002246 - "wr_highest_offset": Highest offset of a sector written since the
2247 BlockDriverState has been opened (json-int)
2248- "parent": Contains recursively the statistics of the underlying
2249 protocol (e.g. the host file for a qcow2 image). If there is
2250 no underlying protocol, this field is omitted
2251 (json-object, optional)
2252
2253Example:
2254
2255-> { "execute": "query-blockstats" }
2256<- {
2257 "return":[
2258 {
2259 "device":"ide0-hd0",
2260 "parent":{
2261 "stats":{
2262 "wr_highest_offset":3686448128,
2263 "wr_bytes":9786368,
2264 "wr_operations":751,
2265 "rd_bytes":122567168,
2266 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002267 "wr_total_times_ns":313253456
2268 "rd_total_times_ns":3465673657
2269 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02002270 "flush_operations":61,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002271 }
2272 },
2273 "stats":{
2274 "wr_highest_offset":2821110784,
2275 "wr_bytes":9786368,
2276 "wr_operations":692,
2277 "rd_bytes":122739200,
2278 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02002279 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002280 "wr_total_times_ns":313253456
2281 "rd_total_times_ns":3465673657
2282 "flush_total_times_ns":49653
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002283 }
2284 },
2285 {
2286 "device":"ide1-cd0",
2287 "stats":{
2288 "wr_highest_offset":0,
2289 "wr_bytes":0,
2290 "wr_operations":0,
2291 "rd_bytes":0,
2292 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002293 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002294 "wr_total_times_ns":0
2295 "rd_total_times_ns":0
2296 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002297 }
2298 },
2299 {
2300 "device":"floppy0",
2301 "stats":{
2302 "wr_highest_offset":0,
2303 "wr_bytes":0,
2304 "wr_operations":0,
2305 "rd_bytes":0,
2306 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002307 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002308 "wr_total_times_ns":0
2309 "rd_total_times_ns":0
2310 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002311 }
2312 },
2313 {
2314 "device":"sd0",
2315 "stats":{
2316 "wr_highest_offset":0,
2317 "wr_bytes":0,
2318 "wr_operations":0,
2319 "rd_bytes":0,
2320 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02002321 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02002322 "wr_total_times_ns":0
2323 "rd_total_times_ns":0
2324 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002325 }
2326 }
2327 ]
2328 }
2329
2330EQMP
2331
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03002332 {
2333 .name = "query-blockstats",
2334 .args_type = "",
2335 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
2336 },
2337
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002338SQMP
2339query-cpus
2340----------
2341
2342Show CPU information.
2343
2344Return a json-array. Each CPU is represented by a json-object, which contains:
2345
2346- "CPU": CPU index (json-int)
2347- "current": true if this is the current CPU, false otherwise (json-bool)
2348- "halted": true if the cpu is halted, false otherwise (json-bool)
2349- Current program counter. The key's name depends on the architecture:
2350 "pc": i386/x86_64 (json-int)
2351 "nip": PPC (json-int)
2352 "pc" and "npc": sparc (json-int)
2353 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002354- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002355
2356Example:
2357
2358-> { "execute": "query-cpus" }
2359<- {
2360 "return":[
2361 {
2362 "CPU":0,
2363 "current":true,
2364 "halted":false,
2365 "pc":3227107138
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002366 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002367 },
2368 {
2369 "CPU":1,
2370 "current":false,
2371 "halted":true,
2372 "pc":7108165
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01002373 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002374 }
2375 ]
2376 }
2377
2378EQMP
2379
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03002380 {
2381 .name = "query-cpus",
2382 .args_type = "",
2383 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
2384 },
2385
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002386SQMP
Stefan Hajnoczidc3dd0d2014-02-27 11:48:42 +01002387query-iothreads
2388---------------
2389
2390Returns a list of information about each iothread.
2391
2392Note this list excludes the QEMU main loop thread, which is not declared
2393using the -object iothread command-line option. It is always the main thread
2394of the process.
2395
2396Return a json-array. Each iothread is represented by a json-object, which contains:
2397
2398- "id": name of iothread (json-str)
2399- "thread-id": ID of the underlying host thread (json-int)
2400
2401Example:
2402
2403-> { "execute": "query-iothreads" }
2404<- {
2405 "return":[
2406 {
2407 "id":"iothread0",
2408 "thread-id":3134
2409 },
2410 {
2411 "id":"iothread1",
2412 "thread-id":3135
2413 }
2414 ]
2415 }
2416
2417EQMP
2418
2419 {
2420 .name = "query-iothreads",
2421 .args_type = "",
2422 .mhandler.cmd_new = qmp_marshal_input_query_iothreads,
2423 },
2424
2425SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002426query-pci
2427---------
2428
2429PCI buses and devices information.
2430
2431The returned value is a json-array of all buses. Each bus is represented by
2432a json-object, which has a key with a json-array of all PCI devices attached
2433to it. Each device is represented by a json-object.
2434
2435The bus json-object contains the following:
2436
2437- "bus": bus number (json-int)
2438- "devices": a json-array of json-objects, each json-object represents a
2439 PCI device
2440
2441The PCI device json-object contains the following:
2442
2443- "bus": identical to the parent's bus number (json-int)
2444- "slot": slot number (json-int)
2445- "function": function number (json-int)
2446- "class_info": a json-object containing:
2447 - "desc": device class description (json-string, optional)
2448 - "class": device class number (json-int)
2449- "id": a json-object containing:
2450 - "device": device ID (json-int)
2451 - "vendor": vendor ID (json-int)
2452- "irq": device's IRQ if assigned (json-int, optional)
2453- "qdev_id": qdev id string (json-string)
2454- "pci_bridge": It's a json-object, only present if this device is a
2455 PCI bridge, contains:
2456 - "bus": bus number (json-int)
2457 - "secondary": secondary bus number (json-int)
2458 - "subordinate": subordinate bus number (json-int)
2459 - "io_range": I/O memory range information, a json-object with the
2460 following members:
2461 - "base": base address, in bytes (json-int)
2462 - "limit": limit address, in bytes (json-int)
2463 - "memory_range": memory range information, a json-object with the
2464 following members:
2465 - "base": base address, in bytes (json-int)
2466 - "limit": limit address, in bytes (json-int)
2467 - "prefetchable_range": Prefetchable memory range information, a
2468 json-object with the following members:
2469 - "base": base address, in bytes (json-int)
2470 - "limit": limit address, in bytes (json-int)
2471 - "devices": a json-array of PCI devices if there's any attached, each
2472 each element is represented by a json-object, which contains
2473 the same members of the 'PCI device json-object' described
2474 above (optional)
2475- "regions": a json-array of json-objects, each json-object represents a
2476 memory region of this device
2477
2478The memory range json-object contains the following:
2479
2480- "base": base memory address (json-int)
2481- "limit": limit value (json-int)
2482
2483The region json-object can be an I/O region or a memory region, an I/O region
2484json-object contains the following:
2485
2486- "type": "io" (json-string, fixed)
2487- "bar": BAR number (json-int)
2488- "address": memory address (json-int)
2489- "size": memory size (json-int)
2490
2491A memory region json-object contains the following:
2492
2493- "type": "memory" (json-string, fixed)
2494- "bar": BAR number (json-int)
2495- "address": memory address (json-int)
2496- "size": memory size (json-int)
2497- "mem_type_64": true or false (json-bool)
2498- "prefetch": true or false (json-bool)
2499
2500Example:
2501
2502-> { "execute": "query-pci" }
2503<- {
2504 "return":[
2505 {
2506 "bus":0,
2507 "devices":[
2508 {
2509 "bus":0,
2510 "qdev_id":"",
2511 "slot":0,
2512 "class_info":{
2513 "class":1536,
2514 "desc":"Host bridge"
2515 },
2516 "id":{
2517 "device":32902,
2518 "vendor":4663
2519 },
2520 "function":0,
2521 "regions":[
2522
2523 ]
2524 },
2525 {
2526 "bus":0,
2527 "qdev_id":"",
2528 "slot":1,
2529 "class_info":{
2530 "class":1537,
2531 "desc":"ISA bridge"
2532 },
2533 "id":{
2534 "device":32902,
2535 "vendor":28672
2536 },
2537 "function":0,
2538 "regions":[
2539
2540 ]
2541 },
2542 {
2543 "bus":0,
2544 "qdev_id":"",
2545 "slot":1,
2546 "class_info":{
2547 "class":257,
2548 "desc":"IDE controller"
2549 },
2550 "id":{
2551 "device":32902,
2552 "vendor":28688
2553 },
2554 "function":1,
2555 "regions":[
2556 {
2557 "bar":4,
2558 "size":16,
2559 "address":49152,
2560 "type":"io"
2561 }
2562 ]
2563 },
2564 {
2565 "bus":0,
2566 "qdev_id":"",
2567 "slot":2,
2568 "class_info":{
2569 "class":768,
2570 "desc":"VGA controller"
2571 },
2572 "id":{
2573 "device":4115,
2574 "vendor":184
2575 },
2576 "function":0,
2577 "regions":[
2578 {
2579 "prefetch":true,
2580 "mem_type_64":false,
2581 "bar":0,
2582 "size":33554432,
2583 "address":4026531840,
2584 "type":"memory"
2585 },
2586 {
2587 "prefetch":false,
2588 "mem_type_64":false,
2589 "bar":1,
2590 "size":4096,
2591 "address":4060086272,
2592 "type":"memory"
2593 },
2594 {
2595 "prefetch":false,
2596 "mem_type_64":false,
2597 "bar":6,
2598 "size":65536,
2599 "address":-1,
2600 "type":"memory"
2601 }
2602 ]
2603 },
2604 {
2605 "bus":0,
2606 "qdev_id":"",
2607 "irq":11,
2608 "slot":4,
2609 "class_info":{
2610 "class":1280,
2611 "desc":"RAM controller"
2612 },
2613 "id":{
2614 "device":6900,
2615 "vendor":4098
2616 },
2617 "function":0,
2618 "regions":[
2619 {
2620 "bar":0,
2621 "size":32,
2622 "address":49280,
2623 "type":"io"
2624 }
2625 ]
2626 }
2627 ]
2628 }
2629 ]
2630 }
2631
2632Note: This example has been shortened as the real response is too long.
2633
2634EQMP
2635
Luiz Capitulino79627472011-10-21 14:15:33 -02002636 {
2637 .name = "query-pci",
2638 .args_type = "",
2639 .mhandler.cmd_new = qmp_marshal_input_query_pci,
2640 },
2641
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002642SQMP
2643query-kvm
2644---------
2645
2646Show KVM information.
2647
2648Return a json-object with the following information:
2649
2650- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2651- "present": true if QEMU has KVM support, false otherwise (json-bool)
2652
2653Example:
2654
2655-> { "execute": "query-kvm" }
2656<- { "return": { "enabled": true, "present": true } }
2657
2658EQMP
2659
Luiz Capitulino292a2602011-09-12 15:10:53 -03002660 {
2661 .name = "query-kvm",
2662 .args_type = "",
2663 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
2664 },
2665
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002666SQMP
2667query-status
2668------------
2669
2670Return a json-object with the following information:
2671
2672- "running": true if the VM is running, or false if it is paused (json-bool)
2673- "singlestep": true if the VM is in single step mode,
2674 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002675- "status": one of the following values (json-string)
2676 "debug" - QEMU is running on a debugger
2677 "inmigrate" - guest is paused waiting for an incoming migration
2678 "internal-error" - An internal error that prevents further guest
2679 execution has occurred
2680 "io-error" - the last IOP has failed and the device is configured
2681 to pause on I/O errors
2682 "paused" - guest has been paused via the 'stop' command
2683 "postmigrate" - guest is paused following a successful 'migrate'
2684 "prelaunch" - QEMU was started with -S and guest has not started
2685 "finish-migrate" - guest is paused to finish the migration process
2686 "restore-vm" - guest is paused to restore VM state
2687 "running" - guest is actively running
2688 "save-vm" - guest is paused to save the VM state
2689 "shutdown" - guest is shut down (and -no-shutdown is in use)
2690 "watchdog" - the watchdog action is configured to pause and
2691 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002692
2693Example:
2694
2695-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002696<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002697
2698EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03002699
2700 {
2701 .name = "query-status",
2702 .args_type = "",
2703 .mhandler.cmd_new = qmp_marshal_input_query_status,
2704 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002705
2706SQMP
2707query-mice
2708----------
2709
2710Show VM mice information.
2711
2712Each mouse is represented by a json-object, the returned value is a json-array
2713of all mice.
2714
2715The mouse json-object contains the following:
2716
2717- "name": mouse's name (json-string)
2718- "index": mouse's index (json-int)
2719- "current": true if this mouse is receiving events, false otherwise (json-bool)
2720- "absolute": true if the mouse generates absolute input events (json-bool)
2721
2722Example:
2723
2724-> { "execute": "query-mice" }
2725<- {
2726 "return":[
2727 {
2728 "name":"QEMU Microsoft Mouse",
2729 "index":0,
2730 "current":false,
2731 "absolute":false
2732 },
2733 {
2734 "name":"QEMU PS/2 Mouse",
2735 "index":1,
2736 "current":true,
2737 "absolute":true
2738 }
2739 ]
2740 }
2741
2742EQMP
2743
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03002744 {
2745 .name = "query-mice",
2746 .args_type = "",
2747 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2748 },
2749
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002750SQMP
2751query-vnc
2752---------
2753
2754Show VNC server information.
2755
2756Return a json-object with server information. Connected clients are returned
2757as a json-array of json-objects.
2758
2759The main json-object contains the following:
2760
2761- "enabled": true or false (json-bool)
2762- "host": server's IP address (json-string)
2763- "family": address family (json-string)
2764 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2765- "service": server's port number (json-string)
2766- "auth": authentication method (json-string)
2767 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2768 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2769 "vencrypt+plain", "vencrypt+tls+none",
2770 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2771 "vencrypt+tls+vnc", "vencrypt+x509+none",
2772 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2773 "vencrypt+x509+vnc", "vnc"
2774- "clients": a json-array of all connected clients
2775
2776Clients are described by a json-object, each one contain the following:
2777
2778- "host": client's IP address (json-string)
2779- "family": address family (json-string)
2780 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2781- "service": client's port number (json-string)
2782- "x509_dname": TLS dname (json-string, optional)
2783- "sasl_username": SASL username (json-string, optional)
2784
2785Example:
2786
2787-> { "execute": "query-vnc" }
2788<- {
2789 "return":{
2790 "enabled":true,
2791 "host":"0.0.0.0",
2792 "service":"50402",
2793 "auth":"vnc",
2794 "family":"ipv4",
2795 "clients":[
2796 {
2797 "host":"127.0.0.1",
2798 "service":"50401",
2799 "family":"ipv4"
2800 }
2801 ]
2802 }
2803 }
2804
2805EQMP
2806
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02002807 {
2808 .name = "query-vnc",
2809 .args_type = "",
2810 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2811 },
2812
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002813SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01002814query-spice
2815-----------
2816
2817Show SPICE server information.
2818
2819Return a json-object with server information. Connected clients are returned
2820as a json-array of json-objects.
2821
2822The main json-object contains the following:
2823
2824- "enabled": true or false (json-bool)
2825- "host": server's IP address (json-string)
2826- "port": server's port number (json-int, optional)
2827- "tls-port": server's port number (json-int, optional)
2828- "auth": authentication method (json-string)
2829 - Possible values: "none", "spice"
2830- "channels": a json-array of all active channels clients
2831
2832Channels are described by a json-object, each one contain the following:
2833
2834- "host": client's IP address (json-string)
2835- "family": address family (json-string)
2836 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2837- "port": client's port number (json-string)
2838- "connection-id": spice connection id. All channels with the same id
2839 belong to the same spice session (json-int)
2840- "channel-type": channel type. "1" is the main control channel, filter for
2841 this one if you want track spice sessions only (json-int)
2842- "channel-id": channel id. Usually "0", might be different needed when
2843 multiple channels of the same type exist, such as multiple
2844 display channels in a multihead setup (json-int)
2845- "tls": whevener the channel is encrypted (json-bool)
2846
2847Example:
2848
2849-> { "execute": "query-spice" }
2850<- {
2851 "return": {
2852 "enabled": true,
2853 "auth": "spice",
2854 "port": 5920,
2855 "tls-port": 5921,
2856 "host": "0.0.0.0",
2857 "channels": [
2858 {
2859 "port": "54924",
2860 "family": "ipv4",
2861 "channel-type": 1,
2862 "connection-id": 1804289383,
2863 "host": "127.0.0.1",
2864 "channel-id": 0,
2865 "tls": true
2866 },
2867 {
2868 "port": "36710",
2869 "family": "ipv4",
2870 "channel-type": 4,
2871 "connection-id": 1804289383,
2872 "host": "127.0.0.1",
2873 "channel-id": 0,
2874 "tls": false
2875 },
2876 [ ... more channels follow ... ]
2877 ]
2878 }
2879 }
2880
2881EQMP
2882
Luiz Capitulinod1f29642011-10-20 17:01:33 -02002883#if defined(CONFIG_SPICE)
2884 {
2885 .name = "query-spice",
2886 .args_type = "",
2887 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2888 },
2889#endif
2890
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01002891SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002892query-name
2893----------
2894
2895Show VM name.
2896
2897Return a json-object with the following information:
2898
2899- "name": VM's name (json-string, optional)
2900
2901Example:
2902
2903-> { "execute": "query-name" }
2904<- { "return": { "name": "qemu-name" } }
2905
2906EQMP
2907
Anthony Liguori48a32be2011-09-02 12:34:48 -05002908 {
2909 .name = "query-name",
2910 .args_type = "",
2911 .mhandler.cmd_new = qmp_marshal_input_query_name,
2912 },
2913
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002914SQMP
2915query-uuid
2916----------
2917
2918Show VM UUID.
2919
2920Return a json-object with the following information:
2921
2922- "UUID": Universally Unique Identifier (json-string)
2923
2924Example:
2925
2926-> { "execute": "query-uuid" }
2927<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2928
2929EQMP
2930
Luiz Capitulinoefab7672011-09-13 17:16:25 -03002931 {
2932 .name = "query-uuid",
2933 .args_type = "",
2934 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
2935 },
2936
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002937SQMP
Amos Kong1f8f9872013-04-25 17:50:35 +08002938query-command-line-options
2939--------------------------
2940
2941Show command line option schema.
2942
2943Return a json-array of command line option schema for all options (or for
2944the given option), returning an error if the given option doesn't exist.
2945
2946Each array entry contains the following:
2947
2948- "option": option name (json-string)
2949- "parameters": a json-array describes all parameters of the option:
2950 - "name": parameter name (json-string)
2951 - "type": parameter type (one of 'string', 'boolean', 'number',
2952 or 'size')
2953 - "help": human readable description of the parameter
2954 (json-string, optional)
Chunyan Liue36af942014-06-05 17:20:43 +08002955 - "default": default value string for the parameter
2956 (json-string, optional)
Amos Kong1f8f9872013-04-25 17:50:35 +08002957
2958Example:
2959
2960-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2961<- { "return": [
2962 {
2963 "parameters": [
2964 {
2965 "name": "romfile",
2966 "type": "string"
2967 },
2968 {
2969 "name": "bootindex",
2970 "type": "number"
2971 }
2972 ],
2973 "option": "option-rom"
2974 }
2975 ]
2976 }
2977
2978EQMP
2979
2980 {
2981 .name = "query-command-line-options",
2982 .args_type = "option:s?",
2983 .mhandler.cmd_new = qmp_marshal_input_query_command_line_options,
2984 },
2985
2986SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002987query-migrate
2988-------------
2989
2990Migration status.
2991
2992Return a json-object. If migration is active there will be another json-object
2993with RAM migration status and if block migration is active another one with
2994block migration status.
2995
2996The main json-object contains the following:
2997
2998- "status": migration status (json-string)
Peter Feiner3b695952014-05-16 10:40:47 -04002999 - Possible values: "setup", "active", "completed", "failed", "cancelled"
Juan Quintela7aa939a2012-08-18 13:17:10 +02003000- "total-time": total amount of ms since migration started. If
3001 migration has ended, it returns the total migration
Juan Quintela817c6042013-02-11 15:11:10 +01003002 time (json-int)
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003003- "setup-time" amount of setup time in milliseconds _before_ the
3004 iterations begin but _after_ the QMP command is issued.
3005 This is designed to provide an accounting of any activities
3006 (such as RDMA pinning) which may be expensive, but do not
3007 actually occur during the iterative migration rounds
3008 themselves. (json-int)
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003009- "downtime": only present when migration has finished correctly
3010 total amount in ms for downtime that happened (json-int)
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003011- "expected-downtime": only present while migration is active
3012 total amount in ms for downtime that was calculated on
Juan Quintela817c6042013-02-11 15:11:10 +01003013 the last bitmap round (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003014- "ram": only present if "status" is "active", it is a json-object with the
Juan Quintela817c6042013-02-11 15:11:10 +01003015 following RAM information:
3016 - "transferred": amount transferred in bytes (json-int)
3017 - "remaining": amount remaining to transfer in bytes (json-int)
3018 - "total": total amount of memory in bytes (json-int)
3019 - "duplicate": number of pages filled entirely with the same
3020 byte (json-int)
3021 These are sent over the wire much more efficiently.
Peter Lievenf1c72792013-03-26 10:58:37 +01003022 - "skipped": number of skipped zero pages (json-int)
Stefan Weil805a2502013-04-28 11:49:57 +02003023 - "normal" : number of whole pages transferred. I.e. they
Juan Quintela817c6042013-02-11 15:11:10 +01003024 were not sent as duplicate or xbzrle pages (json-int)
3025 - "normal-bytes" : number of bytes transferred in whole
3026 pages. This is just normal pages times size of one page,
3027 but this way upper levels don't need to care about page
3028 size (json-int)
ChenLiang58570ed2014-04-04 17:57:55 +08003029 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003030- "disk": only present if "status" is "active" and it is a block migration,
Juan Quintela817c6042013-02-11 15:11:10 +01003031 it is a json-object with the following disk information:
3032 - "transferred": amount transferred in bytes (json-int)
3033 - "remaining": amount remaining to transfer in bytes json-int)
3034 - "total": total disk size in bytes (json-int)
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003035- "xbzrle-cache": only present if XBZRLE is active.
3036 It is a json-object with the following XBZRLE information:
Juan Quintela817c6042013-02-11 15:11:10 +01003037 - "cache-size": XBZRLE cache size in bytes
3038 - "bytes": number of bytes transferred for XBZRLE compressed pages
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003039 - "pages": number of XBZRLE compressed pages
Juan Quintela817c6042013-02-11 15:11:10 +01003040 - "cache-miss": number of XBRZRLE page cache misses
ChenLiang8bc39232014-04-04 17:57:56 +08003041 - "cache-miss-rate": rate of XBRZRLE page cache misses
Juan Quintela817c6042013-02-11 15:11:10 +01003042 - "overflow": number of times XBZRLE overflows. This means
3043 that the XBZRLE encoding was bigger than just sent the
3044 whole page, and then we sent the whole page instead (as as
3045 normal page).
3046
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003047Examples:
3048
30491. Before the first migration
3050
3051-> { "execute": "query-migrate" }
3052<- { "return": {} }
3053
30542. Migration is done and has succeeded
3055
3056-> { "execute": "query-migrate" }
Orit Wasserman004d4c12012-08-06 21:42:56 +03003057<- { "return": {
3058 "status": "completed",
3059 "ram":{
3060 "transferred":123,
3061 "remaining":123,
3062 "total":246,
3063 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003064 "setup-time":12345,
Juan Quintela9c5a9fc2012-08-13 09:35:16 +02003065 "downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003066 "duplicate":123,
3067 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003068 "normal-bytes":123456,
3069 "dirty-sync-count":15
Orit Wasserman004d4c12012-08-06 21:42:56 +03003070 }
3071 }
3072 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003073
30743. Migration is done and has failed
3075
3076-> { "execute": "query-migrate" }
3077<- { "return": { "status": "failed" } }
3078
30794. Migration is being performed and is not a block migration:
3080
3081-> { "execute": "query-migrate" }
3082<- {
3083 "return":{
3084 "status":"active",
3085 "ram":{
3086 "transferred":123,
3087 "remaining":123,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003088 "total":246,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003089 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003090 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003091 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003092 "duplicate":123,
3093 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003094 "normal-bytes":123456,
3095 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003096 }
3097 }
3098 }
3099
31005. Migration is being performed and is a block migration:
3101
3102-> { "execute": "query-migrate" }
3103<- {
3104 "return":{
3105 "status":"active",
3106 "ram":{
3107 "total":1057024,
3108 "remaining":1053304,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03003109 "transferred":3720,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003110 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003111 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003112 "expected-downtime":12345,
Orit Wasserman004d4c12012-08-06 21:42:56 +03003113 "duplicate":123,
3114 "normal":123,
ChenLiang58570ed2014-04-04 17:57:55 +08003115 "normal-bytes":123456,
3116 "dirty-sync-count":15
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003117 },
3118 "disk":{
3119 "total":20971520,
3120 "remaining":20880384,
3121 "transferred":91136
3122 }
3123 }
3124 }
3125
Orit Wassermanf36d55a2012-08-06 21:42:57 +030031266. Migration is being performed and XBZRLE is active:
3127
3128-> { "execute": "query-migrate" }
3129<- {
3130 "return":{
3131 "status":"active",
3132 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
3133 "ram":{
3134 "total":1057024,
3135 "remaining":1053304,
3136 "transferred":3720,
3137 "total-time":12345,
Michael R. Hines8f3067b2013-08-09 16:05:45 -04003138 "setup-time":12345,
Juan Quintela2c52ddf2012-08-13 09:53:12 +02003139 "expected-downtime":12345,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003140 "duplicate":10,
3141 "normal":3333,
ChenLiang58570ed2014-04-04 17:57:55 +08003142 "normal-bytes":3412992,
3143 "dirty-sync-count":15
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003144 },
3145 "xbzrle-cache":{
3146 "cache-size":67108864,
3147 "bytes":20971520,
3148 "pages":2444343,
3149 "cache-miss":2244,
ChenLiang8bc39232014-04-04 17:57:56 +08003150 "cache-miss-rate":0.123,
Orit Wassermanf36d55a2012-08-06 21:42:57 +03003151 "overflow":34434
3152 }
3153 }
3154 }
3155
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003156EQMP
3157
Luiz Capitulino791e7c82011-09-13 17:37:16 -03003158 {
3159 .name = "query-migrate",
3160 .args_type = "",
3161 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
3162 },
3163
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003164SQMP
Orit Wasserman00458432012-08-06 21:42:48 +03003165migrate-set-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003166------------------------
Orit Wasserman00458432012-08-06 21:42:48 +03003167
3168Enable/Disable migration capabilities
3169
Juan Quintela817c6042013-02-11 15:11:10 +01003170- "xbzrle": XBZRLE support
Orit Wasserman00458432012-08-06 21:42:48 +03003171
3172Arguments:
3173
3174Example:
3175
3176-> { "execute": "migrate-set-capabilities" , "arguments":
3177 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
3178
3179EQMP
3180
3181 {
3182 .name = "migrate-set-capabilities",
3183 .args_type = "capabilities:O",
3184 .params = "capability:s,state:b",
3185 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
3186 },
3187SQMP
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003188query-migrate-capabilities
Juan Quintela817c6042013-02-11 15:11:10 +01003189--------------------------
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003190
3191Query current migration capabilities
3192
3193- "capabilities": migration capabilities state
3194 - "xbzrle" : XBZRLE state (json-bool)
3195
3196Arguments:
3197
3198Example:
3199
3200-> { "execute": "query-migrate-capabilities" }
Orit Wassermandbca1b32013-01-31 09:12:17 +02003201<- { "return": [ { "state": false, "capability": "xbzrle" } ] }
3202
Orit Wassermanbbf6da32012-08-06 21:42:47 +03003203EQMP
3204
3205 {
3206 .name = "query-migrate-capabilities",
3207 .args_type = "",
3208 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
3209 },
3210
3211SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003212query-balloon
3213-------------
3214
3215Show balloon information.
3216
3217Make an asynchronous request for balloon info. When the request completes a
3218json-object will be returned containing the following data:
3219
3220- "actual": current balloon value in bytes (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003221
3222Example:
3223
3224-> { "execute": "query-balloon" }
3225<- {
3226 "return":{
3227 "actual":1073741824,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03003228 }
3229 }
3230
3231EQMP
3232
Luiz Capitulino96637bc2011-10-21 11:41:37 -02003233 {
3234 .name = "query-balloon",
3235 .args_type = "",
3236 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
3237 },
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003238
3239 {
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00003240 .name = "query-block-jobs",
3241 .args_type = "",
3242 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
3243 },
3244
3245 {
Anthony Liguorib4b12c62011-12-12 14:29:34 -06003246 .name = "qom-list",
3247 .args_type = "path:s",
3248 .mhandler.cmd_new = qmp_marshal_input_qom_list,
3249 },
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003250
3251 {
3252 .name = "qom-set",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01003253 .args_type = "path:s,property:s,value:q",
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06003254 .mhandler.cmd_new = qmp_qom_set,
3255 },
3256
3257 {
3258 .name = "qom-get",
3259 .args_type = "path:s,property:s",
3260 .mhandler.cmd_new = qmp_qom_get,
3261 },
Luiz Capitulino270b2432011-12-08 11:45:55 -02003262
3263 {
Paolo Bonzini6dd844d2012-08-22 16:43:07 +02003264 .name = "nbd-server-start",
3265 .args_type = "addr:q",
3266 .mhandler.cmd_new = qmp_marshal_input_nbd_server_start,
3267 },
3268 {
3269 .name = "nbd-server-add",
3270 .args_type = "device:B,writable:b?",
3271 .mhandler.cmd_new = qmp_marshal_input_nbd_server_add,
3272 },
3273 {
3274 .name = "nbd-server-stop",
3275 .args_type = "",
3276 .mhandler.cmd_new = qmp_marshal_input_nbd_server_stop,
3277 },
3278
3279 {
Luiz Capitulino270b2432011-12-08 11:45:55 -02003280 .name = "change-vnc-password",
3281 .args_type = "password:s",
3282 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
3283 },
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06003284 {
3285 .name = "qom-list-types",
3286 .args_type = "implements:s?,abstract:b?",
3287 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
3288 },
Anthony Liguori1daa31b2012-08-10 11:04:09 -05003289
3290 {
3291 .name = "device-list-properties",
3292 .args_type = "typename:s",
3293 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
3294 },
3295
Anthony Liguori01d3c802012-08-10 11:04:11 -05003296 {
3297 .name = "query-machines",
3298 .args_type = "",
3299 .mhandler.cmd_new = qmp_marshal_input_query_machines,
3300 },
3301
Anthony Liguorie4e31c62012-08-10 11:04:13 -05003302 {
3303 .name = "query-cpu-definitions",
3304 .args_type = "",
3305 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
3306 },
3307
Daniel P. Berrange99afc912012-08-20 15:31:38 +01003308 {
3309 .name = "query-target",
3310 .args_type = "",
3311 .mhandler.cmd_new = qmp_marshal_input_query_target,
3312 },
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003313
3314 {
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003315 .name = "query-tpm",
3316 .args_type = "",
3317 .mhandler.cmd_new = qmp_marshal_input_query_tpm,
3318 },
3319
Corey Bryant28c4fa32013-03-20 12:34:49 -04003320SQMP
3321query-tpm
3322---------
3323
3324Return information about the TPM device.
3325
3326Arguments: None
3327
3328Example:
3329
3330-> { "execute": "query-tpm" }
3331<- { "return":
3332 [
3333 { "model": "tpm-tis",
3334 "options":
3335 { "type": "passthrough",
3336 "data":
3337 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3338 "path": "/dev/tpm0"
3339 }
3340 },
3341 "id": "tpm0"
3342 }
3343 ]
3344 }
3345
3346EQMP
3347
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003348 {
3349 .name = "query-tpm-models",
3350 .args_type = "",
3351 .mhandler.cmd_new = qmp_marshal_input_query_tpm_models,
3352 },
3353
Corey Bryant28c4fa32013-03-20 12:34:49 -04003354SQMP
3355query-tpm-models
3356----------------
3357
3358Return a list of supported TPM models.
3359
3360Arguments: None
3361
3362Example:
3363
3364-> { "execute": "query-tpm-models" }
3365<- { "return": [ "tpm-tis" ] }
3366
3367EQMP
3368
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003369 {
3370 .name = "query-tpm-types",
3371 .args_type = "",
3372 .mhandler.cmd_new = qmp_marshal_input_query_tpm_types,
3373 },
3374
Corey Bryant28c4fa32013-03-20 12:34:49 -04003375SQMP
3376query-tpm-types
3377---------------
3378
3379Return a list of supported TPM types.
3380
3381Arguments: None
3382
3383Example:
3384
3385-> { "execute": "query-tpm-types" }
3386<- { "return": [ "passthrough" ] }
3387
3388EQMP
3389
Stefan Bergerd1a0cf72013-02-27 12:47:49 -05003390 {
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003391 .name = "chardev-add",
3392 .args_type = "id:s,backend:q",
3393 .mhandler.cmd_new = qmp_marshal_input_chardev_add,
3394 },
3395
3396SQMP
3397chardev-add
3398----------------
3399
3400Add a chardev.
3401
3402Arguments:
3403
3404- "id": the chardev's ID, must be unique (json-string)
3405- "backend": chardev backend type + parameters
3406
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003407Examples:
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003408
3409-> { "execute" : "chardev-add",
3410 "arguments" : { "id" : "foo",
3411 "backend" : { "type" : "null", "data" : {} } } }
3412<- { "return": {} }
3413
Gerd Hoffmannffbdbe52012-12-19 13:13:57 +01003414-> { "execute" : "chardev-add",
3415 "arguments" : { "id" : "bar",
3416 "backend" : { "type" : "file",
3417 "data" : { "out" : "/tmp/bar.log" } } } }
3418<- { "return": {} }
3419
Gerd Hoffmann0a1a7fa2012-12-20 14:39:13 +01003420-> { "execute" : "chardev-add",
3421 "arguments" : { "id" : "baz",
3422 "backend" : { "type" : "pty", "data" : {} } } }
3423<- { "return": { "pty" : "/dev/pty/42" } }
3424
Gerd Hoffmannf1a1a352012-12-19 10:33:56 +01003425EQMP
3426
3427 {
3428 .name = "chardev-remove",
3429 .args_type = "id:s",
3430 .mhandler.cmd_new = qmp_marshal_input_chardev_remove,
3431 },
3432
3433
3434SQMP
3435chardev-remove
3436--------------
3437
3438Remove a chardev.
3439
3440Arguments:
3441
3442- "id": the chardev's ID, must exist and not be in use (json-string)
3443
3444Example:
3445
3446-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3447<- { "return": {} }
3448
3449EQMP
Amos Kongb1be4282013-06-14 15:45:52 +08003450 {
3451 .name = "query-rx-filter",
3452 .args_type = "name:s?",
3453 .mhandler.cmd_new = qmp_marshal_input_query_rx_filter,
3454 },
3455
3456SQMP
3457query-rx-filter
3458---------------
3459
3460Show rx-filter information.
3461
3462Returns a json-array of rx-filter information for all NICs (or for the
3463given NIC), returning an error if the given NIC doesn't exist, or
3464given NIC doesn't support rx-filter querying, or given net client
3465isn't a NIC.
3466
3467The query will clear the event notification flag of each NIC, then qemu
3468will start to emit event to QMP monitor.
3469
3470Each array entry contains the following:
3471
3472- "name": net client name (json-string)
3473- "promiscuous": promiscuous mode is enabled (json-bool)
3474- "multicast": multicast receive state (one of 'normal', 'none', 'all')
3475- "unicast": unicast receive state (one of 'normal', 'none', 'all')
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003476- "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
Amos Kongb1be4282013-06-14 15:45:52 +08003477- "broadcast-allowed": allow to receive broadcast (json-bool)
3478- "multicast-overflow": multicast table is overflowed (json-bool)
3479- "unicast-overflow": unicast table is overflowed (json-bool)
3480- "main-mac": main macaddr string (json-string)
3481- "vlan-table": a json-array of active vlan id
3482- "unicast-table": a json-array of unicast macaddr string
3483- "multicast-table": a json-array of multicast macaddr string
3484
3485Example:
3486
3487-> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3488<- { "return": [
3489 {
3490 "promiscuous": true,
3491 "name": "vnet0",
3492 "main-mac": "52:54:00:12:34:56",
3493 "unicast": "normal",
Amos Kongf7bc8ef2014-03-26 08:19:43 +08003494 "vlan": "normal",
Amos Kongb1be4282013-06-14 15:45:52 +08003495 "vlan-table": [
3496 4,
3497 0
3498 ],
3499 "unicast-table": [
3500 ],
3501 "multicast": "normal",
3502 "multicast-overflow": false,
3503 "unicast-overflow": false,
3504 "multicast-table": [
3505 "01:00:5e:00:00:01",
3506 "33:33:00:00:00:01",
3507 "33:33:ff:12:34:56"
3508 ],
3509 "broadcast-allowed": false
3510 }
3511 ]
3512 }
3513
3514EQMP
Kevin Wolfd26c9a12013-09-23 15:26:03 +02003515
3516 {
3517 .name = "blockdev-add",
3518 .args_type = "options:q",
3519 .mhandler.cmd_new = qmp_marshal_input_blockdev_add,
3520 },
3521
3522SQMP
3523blockdev-add
3524------------
3525
3526Add a block device.
3527
3528Arguments:
3529
3530- "options": block driver options
3531
3532Example (1):
3533
3534-> { "execute": "blockdev-add",
3535 "arguments": { "options" : { "driver": "qcow2",
3536 "file": { "driver": "file",
3537 "filename": "test.qcow2" } } } }
3538<- { "return": {} }
3539
3540Example (2):
3541
3542-> { "execute": "blockdev-add",
3543 "arguments": {
3544 "options": {
3545 "driver": "qcow2",
3546 "id": "my_disk",
3547 "discard": "unmap",
3548 "cache": {
3549 "direct": true,
3550 "writeback": true
3551 },
3552 "file": {
3553 "driver": "file",
3554 "filename": "/tmp/test.qcow2"
3555 },
3556 "backing": {
3557 "driver": "raw",
3558 "file": {
3559 "driver": "file",
3560 "filename": "/dev/fdset/4"
3561 }
3562 }
3563 }
3564 }
3565 }
3566
3567<- { "return": {} }
3568
3569EQMP
Benoît Canetc13163f2014-01-23 21:31:34 +01003570
3571 {
3572 .name = "query-named-block-nodes",
3573 .args_type = "",
3574 .mhandler.cmd_new = qmp_marshal_input_query_named_block_nodes,
3575 },
3576
3577SQMP
3578@query-named-block-nodes
3579------------------------
3580
3581Return a list of BlockDeviceInfo for all the named block driver nodes
3582
3583Example:
3584
3585-> { "execute": "query-named-block-nodes" }
3586<- { "return": [ { "ro":false,
3587 "drv":"qcow2",
3588 "encrypted":false,
3589 "file":"disks/test.qcow2",
3590 "node-name": "my-node",
3591 "backing_file_depth":1,
3592 "bps":1000000,
3593 "bps_rd":0,
3594 "bps_wr":0,
3595 "iops":1000000,
3596 "iops_rd":0,
3597 "iops_wr":0,
3598 "bps_max": 8000000,
3599 "bps_rd_max": 0,
3600 "bps_wr_max": 0,
3601 "iops_max": 0,
3602 "iops_rd_max": 0,
3603 "iops_wr_max": 0,
3604 "iops_size": 0,
3605 "image":{
3606 "filename":"disks/test.qcow2",
3607 "format":"qcow2",
3608 "virtual-size":2048000,
3609 "backing_file":"base.qcow2",
3610 "full-backing-filename":"disks/base.qcow2",
3611 "backing-filename-format:"qcow2",
3612 "snapshots":[
3613 {
3614 "id": "1",
3615 "name": "snapshot1",
3616 "vm-state-size": 0,
3617 "date-sec": 10000200,
3618 "date-nsec": 12,
3619 "vm-clock-sec": 206,
3620 "vm-clock-nsec": 30
3621 }
3622 ],
3623 "backing-image":{
3624 "filename":"disks/base.qcow2",
3625 "format":"qcow2",
3626 "virtual-size":2048000
3627 }
Michael S. Tsirkinc0594512014-06-16 15:20:18 +03003628 } } ] }
Benoît Canetc13163f2014-01-23 21:31:34 +01003629
3630EQMP
Hu Tao76b5d852014-06-16 18:05:41 +08003631
3632 {
3633 .name = "query-memdev",
3634 .args_type = "",
3635 .mhandler.cmd_new = qmp_marshal_input_query_memdev,
3636 },
3637
3638SQMP
3639query-memdev
3640------------
3641
3642Show memory devices information.
3643
3644
3645Example (1):
3646
3647-> { "execute": "query-memdev" }
3648<- { "return": [
3649 {
3650 "size": 536870912,
3651 "merge": false,
3652 "dump": true,
3653 "prealloc": false,
3654 "host-nodes": [0, 1],
3655 "policy": "bind"
3656 },
3657 {
3658 "size": 536870912,
3659 "merge": false,
3660 "dump": true,
3661 "prealloc": true,
3662 "host-nodes": [2, 3],
3663 "policy": "preferred"
3664 }
3665 ]
3666 }
3667
3668EQMP
Igor Mammedov6f2e2732014-06-16 19:12:25 +02003669
3670 {
3671 .name = "query-memory-devices",
3672 .args_type = "",
3673 .mhandler.cmd_new = qmp_marshal_input_query_memory_devices,
3674 },
3675
3676SQMP
3677@query-memory-devices
3678--------------------
3679
3680Return a list of memory devices.
3681
3682Example:
3683-> { "execute": "query-memory-devices" }
3684<- { "return": [ { "data":
3685 { "addr": 5368709120,
3686 "hotpluggable": true,
3687 "hotplugged": true,
3688 "id": "d1",
3689 "memdev": "/objects/memX",
3690 "node": 0,
3691 "size": 1073741824,
3692 "slot": 0},
3693 "type": "dimm"
3694 } ] }
3695EQMP
Igor Mammedov02419bc2014-06-16 19:12:28 +02003696
3697 {
3698 .name = "query-acpi-ospm-status",
3699 .args_type = "",
3700 .mhandler.cmd_new = qmp_marshal_input_query_acpi_ospm_status,
3701 },
3702
3703SQMP
3704@query-acpi-ospm-status
3705--------------------
3706
3707Return list of ACPIOSTInfo for devices that support status reporting
3708via ACPI _OST method.
3709
3710Example:
3711-> { "execute": "query-acpi-ospm-status" }
3712<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3713 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3714 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3715 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3716 ]}
3717EQMP
Marcelo Tosattif2ae8ab2014-06-24 18:55:11 -03003718
3719#if defined TARGET_I386
3720 {
3721 .name = "rtc-reset-reinjection",
3722 .args_type = "",
3723 .mhandler.cmd_new = qmp_marshal_input_rtc_reset_reinjection,
3724 },
3725#endif
3726
3727SQMP
3728rtc-reset-reinjection
3729---------------------
3730
3731Reset the RTC interrupt reinjection backlog.
3732
3733Arguments: None.
3734
3735Example:
3736
3737-> { "execute": "rtc-reset-reinjection" }
3738<- { "return": {} }
3739
3740EQMP