blob: 470f08ed997dff342fba8f47ab1b6c7b7cb7ed44 [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",
149 .params = "filename",
150 .help = "save screen into PPM image 'filename'",
151 .user_print = monitor_user_noop,
152 .mhandler.cmd_new = do_screen_dump,
153 },
154
155SQMP
156screendump
157----------
158
159Save screen into PPM image.
160
161Arguments:
162
163- "filename": file path (json-string)
164
165Example:
166
167-> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
168<- { "return": {} }
169
170EQMP
171
172 {
173 .name = "stop",
174 .args_type = "",
Luiz Capitulino5f158f22011-09-15 14:34:39 -0300175 .mhandler.cmd_new = qmp_marshal_input_stop,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300176 },
177
178SQMP
179stop
180----
181
182Stop the emulator.
183
184Arguments: None.
185
186Example:
187
188-> { "execute": "stop" }
189<- { "return": {} }
190
191EQMP
192
193 {
194 .name = "cont",
195 .args_type = "",
Luiz Capitulinoe42e8182011-11-22 17:58:31 -0200196 .mhandler.cmd_new = qmp_marshal_input_cont,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300197 },
198
199SQMP
200cont
201----
202
203Resume emulation.
204
205Arguments: None.
206
207Example:
208
209-> { "execute": "cont" }
210<- { "return": {} }
211
212EQMP
213
214 {
Gerd Hoffmann9b9df252012-02-23 13:45:21 +0100215 .name = "system_wakeup",
216 .args_type = "",
217 .mhandler.cmd_new = qmp_marshal_input_system_wakeup,
218 },
219
220SQMP
221system_wakeup
222-------------
223
224Wakeup guest from suspend.
225
226Arguments: None.
227
228Example:
229
230-> { "execute": "system_wakeup" }
231<- { "return": {} }
232
233EQMP
234
235 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300236 .name = "system_reset",
237 .args_type = "",
Luiz Capitulino38d22652011-09-15 14:41:46 -0300238 .mhandler.cmd_new = qmp_marshal_input_system_reset,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300239 },
240
241SQMP
242system_reset
243------------
244
245Reset the system.
246
247Arguments: None.
248
249Example:
250
251-> { "execute": "system_reset" }
252<- { "return": {} }
253
254EQMP
255
256 {
257 .name = "system_powerdown",
258 .args_type = "",
Luiz Capitulino22e1bb92011-11-27 22:40:03 -0200259 .mhandler.cmd_new = qmp_marshal_input_system_powerdown,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300260 },
261
262SQMP
263system_powerdown
264----------------
265
266Send system power down event.
267
268Arguments: None.
269
270Example:
271
272-> { "execute": "system_powerdown" }
273<- { "return": {} }
274
275EQMP
276
277 {
278 .name = "device_add",
279 .args_type = "device:O",
280 .params = "driver[,prop=value][,...]",
281 .help = "add device, like -device on the command line",
282 .user_print = monitor_user_noop,
283 .mhandler.cmd_new = do_device_add,
284 },
285
286SQMP
287device_add
288----------
289
290Add a device.
291
292Arguments:
293
294- "driver": the name of the new device's driver (json-string)
295- "bus": the device's parent bus (device tree path, json-string, optional)
296- "id": the device's ID, must be unique (json-string)
297- device properties
298
299Example:
300
301-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
302<- { "return": {} }
303
304Notes:
305
306(1) For detailed information about this command, please refer to the
307 'docs/qdev-device-use.txt' file.
308
309(2) It's possible to list device properties by running QEMU with the
310 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
311
312EQMP
313
314 {
315 .name = "device_del",
316 .args_type = "id:s",
Luiz Capitulinoa15fef22012-03-29 12:38:50 -0300317 .mhandler.cmd_new = qmp_marshal_input_device_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300318 },
319
320SQMP
321device_del
322----------
323
324Remove a device.
325
326Arguments:
327
328- "id": the device's ID (json-string)
329
330Example:
331
332-> { "execute": "device_del", "arguments": { "id": "net1" } }
333<- { "return": {} }
334
335EQMP
336
337 {
Amos Konge4c8f002012-08-31 10:56:26 +0800338 .name = "send-key",
339 .args_type = "keys:O,hold-time:i?",
340 .mhandler.cmd_new = qmp_marshal_input_send_key,
341 },
342
343SQMP
344send-key
345----------
346
347Send keys to VM.
348
349Arguments:
350
351keys array:
352 - "key": key sequence (a json-array of key enum values)
353
354- hold-time: time to delay key up events, milliseconds. Defaults to 100
355 (json-int, optional)
356
357Example:
358
359-> { "execute": "send-key",
360 "arguments": { 'keys': [ 'ctrl', 'alt', 'delete' ] } }
361<- { "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 {
391 .name = "memsave",
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200392 .args_type = "val:l,size:i,filename:s,cpu:i?",
393 .mhandler.cmd_new = qmp_marshal_input_memsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300394 },
395
396SQMP
397memsave
398-------
399
400Save to disk virtual memory dump starting at 'val' of size 'size'.
401
402Arguments:
403
404- "val": the starting address (json-int)
405- "size": the memory size, in bytes (json-int)
406- "filename": file path (json-string)
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200407- "cpu": virtual CPU index (json-int, optional)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300408
409Example:
410
411-> { "execute": "memsave",
412 "arguments": { "val": 10,
413 "size": 100,
414 "filename": "/tmp/virtual-mem-dump" } }
415<- { "return": {} }
416
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300417EQMP
418
419 {
420 .name = "pmemsave",
421 .args_type = "val:l,size:i,filename:s",
Luiz Capitulino6d3962b2011-11-22 17:26:46 -0200422 .mhandler.cmd_new = qmp_marshal_input_pmemsave,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300423 },
424
425SQMP
426pmemsave
427--------
428
429Save to disk physical memory dump starting at 'val' of size 'size'.
430
431Arguments:
432
433- "val": the starting address (json-int)
434- "size": the memory size, in bytes (json-int)
435- "filename": file path (json-string)
436
437Example:
438
439-> { "execute": "pmemsave",
440 "arguments": { "val": 10,
441 "size": 100,
442 "filename": "/tmp/physical-mem-dump" } }
443<- { "return": {} }
444
445EQMP
446
447 {
Lai Jiangshana4046662011-03-07 17:05:15 +0800448 .name = "inject-nmi",
449 .args_type = "",
Luiz Capitulinoab49ab52011-11-23 12:55:53 -0200450 .mhandler.cmd_new = qmp_marshal_input_inject_nmi,
Lai Jiangshana4046662011-03-07 17:05:15 +0800451 },
452
453SQMP
454inject-nmi
455----------
456
457Inject an NMI on guest's CPUs.
458
459Arguments: None.
460
461Example:
462
463-> { "execute": "inject-nmi" }
464<- { "return": {} }
465
Luiz Capitulinode253f12012-07-27 16:18:16 -0300466Note: inject-nmi fails when the guest doesn't support injecting.
467 Currently, only x86 guests do.
Lai Jiangshana4046662011-03-07 17:05:15 +0800468
469EQMP
470
471 {
Stefano Stabellinia7ae8352012-01-25 12:24:51 +0000472 .name = "xen-save-devices-state",
473 .args_type = "filename:F",
474 .mhandler.cmd_new = qmp_marshal_input_xen_save_devices_state,
475 },
476
477SQMP
478xen-save-devices-state
479-------
480
481Save the state of all devices to file. The RAM and the block devices
482of the VM are not saved by this command.
483
484Arguments:
485
486- "filename": the file to save the state of the devices to as binary
487data. See xen-save-devices-state.txt for a description of the binary
488format.
489
490Example:
491
492-> { "execute": "xen-save-devices-state",
493 "arguments": { "filename": "/tmp/save" } }
494<- { "return": {} }
495
496EQMP
497
498 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300499 .name = "migrate",
500 .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
Luiz Capitulinoe1c37d02011-12-05 14:48:01 -0200501 .mhandler.cmd_new = qmp_marshal_input_migrate,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300502 },
503
504SQMP
505migrate
506-------
507
508Migrate to URI.
509
510Arguments:
511
512- "blk": block migration, full disk copy (json-bool, optional)
513- "inc": incremental disk copy (json-bool, optional)
514- "uri": Destination URI (json-string)
515
516Example:
517
518-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
519<- { "return": {} }
520
521Notes:
522
523(1) The 'query-migrate' command should be used to check migration's progress
524 and final result (this information is provided by the 'status' member)
525(2) All boolean arguments default to false
526(3) The user Monitor's "detach" argument is invalid in QMP and should not
527 be used
528
529EQMP
530
531 {
532 .name = "migrate_cancel",
533 .args_type = "",
Luiz Capitulino6cdedb02011-11-27 22:54:09 -0200534 .mhandler.cmd_new = qmp_marshal_input_migrate_cancel,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300535 },
536
537SQMP
538migrate_cancel
539--------------
540
541Cancel the current migration.
542
543Arguments: None.
544
545Example:
546
547-> { "execute": "migrate_cancel" }
548<- { "return": {} }
549
550EQMP
Orit Wasserman9e1ba4c2012-08-06 21:42:54 +0300551{
552 .name = "migrate-set-cache-size",
553 .args_type = "value:o",
554 .mhandler.cmd_new = qmp_marshal_input_migrate_set_cache_size,
555 },
556
557SQMP
558migrate-set-cache-size
559---------------------
560
561Set cache size to be used by XBZRLE migration, the cache size will be rounded
562down to the nearest power of 2
563
564Arguments:
565
566- "value": cache size in bytes (json-int)
567
568Example:
569
570-> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
571<- { "return": {} }
572
573EQMP
574 {
575 .name = "query-migrate-cache-size",
576 .args_type = "",
577 .mhandler.cmd_new = qmp_marshal_input_query_migrate_cache_size,
578 },
579
580SQMP
581query-migrate-cache-size
582---------------------
583
584Show cache size to be used by XBZRLE migration
585
586returns a json-object with the following information:
587- "size" : json-int
588
589Example:
590
591-> { "execute": "query-migrate-cache-size" }
592<- { "return": 67108864 }
593
594EQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300595
596 {
597 .name = "migrate_set_speed",
Wen Congyang3a019b62010-11-25 09:06:05 +0800598 .args_type = "value:o",
Luiz Capitulino3dc85382011-11-28 11:59:37 -0200599 .mhandler.cmd_new = qmp_marshal_input_migrate_set_speed,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300600 },
601
602SQMP
603migrate_set_speed
604-----------------
605
606Set maximum speed for migrations.
607
608Arguments:
609
Luiz Capitulino5569fd72010-12-15 17:56:18 -0200610- "value": maximum speed, in bytes per second (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300611
612Example:
613
614-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
615<- { "return": {} }
616
617EQMP
618
619 {
620 .name = "migrate_set_downtime",
621 .args_type = "value:T",
Luiz Capitulino4f0a9932011-11-27 23:18:01 -0200622 .mhandler.cmd_new = qmp_marshal_input_migrate_set_downtime,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300623 },
624
625SQMP
626migrate_set_downtime
627--------------------
628
629Set maximum tolerated downtime (in seconds) for migrations.
630
631Arguments:
632
633- "value": maximum downtime (json-number)
634
635Example:
636
637-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
638<- { "return": {} }
639
640EQMP
641
642 {
Jes Sorensenff73edf2011-03-09 14:31:06 +0100643 .name = "client_migrate_info",
644 .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?",
645 .params = "protocol hostname port tls-port cert-subject",
646 .help = "send migration info to spice/vnc client",
647 .user_print = monitor_user_noop,
Yonit Halperinedc5cb12011-10-17 10:03:18 +0200648 .mhandler.cmd_async = client_migrate_info,
649 .flags = MONITOR_CMD_ASYNC,
Jes Sorensenff73edf2011-03-09 14:31:06 +0100650 },
651
652SQMP
653client_migrate_info
654------------------
655
656Set the spice/vnc connection info for the migration target. The spice/vnc
657server will ask the spice/vnc client to automatically reconnect using the
658new parameters (if specified) once the vm migration finished successfully.
659
660Arguments:
661
662- "protocol": protocol: "spice" or "vnc" (json-string)
663- "hostname": migration target hostname (json-string)
664- "port": spice/vnc tcp port for plaintext channels (json-int, optional)
665- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
666- "cert-subject": server certificate subject (json-string, optional)
667
668Example:
669
670-> { "execute": "client_migrate_info",
671 "arguments": { "protocol": "spice",
672 "hostname": "virt42.lab.kraxel.org",
673 "port": 1234 } }
674<- { "return": {} }
675
676EQMP
677
678 {
Wen Congyang783e9b42012-05-07 12:10:47 +0800679 .name = "dump-guest-memory",
680 .args_type = "paging:b,protocol:s,begin:i?,end:i?",
681 .params = "-p protocol [begin] [length]",
682 .help = "dump guest memory to file",
683 .user_print = monitor_user_noop,
684 .mhandler.cmd_new = qmp_marshal_input_dump_guest_memory,
685 },
686
687SQMP
688dump
689
690
691Dump guest memory to file. The file can be processed with crash or gdb.
692
693Arguments:
694
695- "paging": do paging to get guest's memory mapping (json-bool)
696- "protocol": destination file(started with "file:") or destination file
697 descriptor (started with "fd:") (json-string)
698- "begin": the starting physical address. It's optional, and should be specified
699 with length together (json-int)
700- "length": the memory size, in bytes. It's optional, and should be specified
701 with begin together (json-int)
702
703Example:
704
705-> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
706<- { "return": {} }
707
708Notes:
709
710(1) All boolean arguments default to false
711
712EQMP
713
714 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300715 .name = "netdev_add",
716 .args_type = "netdev:O",
Luiz Capitulino928059a2012-04-18 17:34:15 -0300717 .mhandler.cmd_new = qmp_netdev_add,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300718 },
719
720SQMP
721netdev_add
722----------
723
724Add host network device.
725
726Arguments:
727
728- "type": the device type, "tap", "user", ... (json-string)
729- "id": the device's ID, must be unique (json-string)
730- device options
731
732Example:
733
734-> { "execute": "netdev_add", "arguments": { "type": "user", "id": "netdev1" } }
735<- { "return": {} }
736
737Note: The supported device options are the same ones supported by the '-net'
738 command-line argument, which are listed in the '-help' output or QEMU's
739 manual
740
741EQMP
742
743 {
744 .name = "netdev_del",
745 .args_type = "id:s",
Luiz Capitulino5f964152012-04-16 14:36:32 -0300746 .mhandler.cmd_new = qmp_marshal_input_netdev_del,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300747 },
748
749SQMP
750netdev_del
751----------
752
753Remove host network device.
754
755Arguments:
756
757- "id": the device's ID, must be unique (json-string)
758
759Example:
760
761-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
762<- { "return": {} }
763
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100764
765EQMP
766
767 {
768 .name = "block_resize",
769 .args_type = "device:B,size:o",
Luiz Capitulino5e7caac2011-11-25 14:57:10 -0200770 .mhandler.cmd_new = qmp_marshal_input_block_resize,
Christoph Hellwig6d4a2b32011-01-24 13:32:33 +0100771 },
772
773SQMP
774block_resize
775------------
776
777Resize a block image while a guest is running.
778
779Arguments:
780
781- "device": the device's ID, must be unique (json-string)
782- "size": new size
783
784Example:
785
786-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
787<- { "return": {} }
788
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300789EQMP
790
791 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +0100792 .name = "block-stream",
Stefan Hajnoczic83c66c2012-04-25 16:51:03 +0100793 .args_type = "device:B,base:s?,speed:o?",
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +0000794 .mhandler.cmd_new = qmp_marshal_input_block_stream,
795 },
796
797 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +0100798 .name = "block-job-set-speed",
Stefan Hajnoczi882ec7c2012-04-25 16:51:02 +0100799 .args_type = "device:B,speed:o",
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +0000800 .mhandler.cmd_new = qmp_marshal_input_block_job_set_speed,
801 },
802
803 {
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +0100804 .name = "block-job-cancel",
Stefan Hajnoczi370521a2012-01-18 14:40:48 +0000805 .args_type = "device:B",
806 .mhandler.cmd_new = qmp_marshal_input_block_job_cancel,
807 },
Jeff Codyc1864022012-02-28 15:54:07 -0500808 {
Paolo Bonzini52e7c242012-03-06 18:55:57 +0100809 .name = "transaction",
Paolo Bonzinib9f89782012-03-22 12:51:11 +0100810 .args_type = "actions:q",
Paolo Bonzini52e7c242012-03-06 18:55:57 +0100811 .mhandler.cmd_new = qmp_marshal_input_transaction,
Jeff Codyc1864022012-02-28 15:54:07 -0500812 },
813
814SQMP
Paolo Bonzini52e7c242012-03-06 18:55:57 +0100815transaction
816-----------
Jeff Codyc1864022012-02-28 15:54:07 -0500817
Paolo Bonzini52e7c242012-03-06 18:55:57 +0100818Atomically operate on one or more block devices. The only supported
819operation for now is snapshotting. If there is any failure performing
820any of the operations, all snapshots for the group are abandoned, and
821the original disks pre-snapshot attempt are used.
Jeff Codyc1864022012-02-28 15:54:07 -0500822
Paolo Bonzini52e7c242012-03-06 18:55:57 +0100823A list of dictionaries is accepted, that contains the actions to be performed.
824For snapshots this is the device, the file to use for the new snapshot,
825and the format. The default format, if not specified, is qcow2.
Jeff Codyc1864022012-02-28 15:54:07 -0500826
Paolo Bonzinibc8b0942012-03-06 18:55:58 +0100827Each new snapshot defaults to being created by QEMU (wiping any
828contents if the file already exists), but it is also possible to reuse
829an externally-created file. In the latter case, you should ensure that
830the new image file has the same contents as the current one; QEMU cannot
831perform any meaningful check. Typically this is achieved by using the
832current image file as the backing file for the new image.
833
Jeff Codyc1864022012-02-28 15:54:07 -0500834Arguments:
835
Paolo Bonzini52e7c242012-03-06 18:55:57 +0100836actions array:
837 - "type": the operation to perform. The only supported
838 value is "blockdev-snapshot-sync". (json-string)
839 - "data": a dictionary. The contents depend on the value
840 of "type". When "type" is "blockdev-snapshot-sync":
841 - "device": device name to snapshot (json-string)
842 - "snapshot-file": name of new image file (json-string)
843 - "format": format of new image (json-string, optional)
Paolo Bonzinibc8b0942012-03-06 18:55:58 +0100844 - "mode": whether and how QEMU should create the snapshot file
845 (NewImageMode, optional, default "absolute-paths")
Jeff Codyc1864022012-02-28 15:54:07 -0500846
847Example:
848
Paolo Bonzini52e7c242012-03-06 18:55:57 +0100849-> { "execute": "transaction",
850 "arguments": { "actions": [
851 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd0",
852 "snapshot-file": "/some/place/my-image",
853 "format": "qcow2" } },
854 { 'type': 'blockdev-snapshot-sync', 'data' : { "device": "ide-hd1",
855 "snapshot-file": "/some/place/my-image2",
Paolo Bonzinibc8b0942012-03-06 18:55:58 +0100856 "mode": "existing",
Paolo Bonzini52e7c242012-03-06 18:55:57 +0100857 "format": "qcow2" } } ] } }
Jeff Codyc1864022012-02-28 15:54:07 -0500858<- { "return": {} }
859
860EQMP
Stefan Hajnoczi370521a2012-01-18 14:40:48 +0000861
862 {
Jes Sorensend967b2f2011-07-11 20:01:09 +0200863 .name = "blockdev-snapshot-sync",
Paolo Bonzini31155b92012-04-12 14:00:58 +0200864 .args_type = "device:B,snapshot-file:s,format:s?,mode:s?",
Luiz Capitulino6106e242011-11-25 16:15:19 -0200865 .mhandler.cmd_new = qmp_marshal_input_blockdev_snapshot_sync,
Jes Sorensend967b2f2011-07-11 20:01:09 +0200866 },
867
868SQMP
869blockdev-snapshot-sync
870----------------------
871
872Synchronous snapshot of a block device. snapshot-file specifies the
873target of the new image. If the file exists, or if it is a device, the
874snapshot will be created in the existing file/device. If does not
875exist, a new file will be created. format specifies the format of the
876snapshot image, default is qcow2.
877
878Arguments:
879
880- "device": device name to snapshot (json-string)
881- "snapshot-file": name of new image file (json-string)
Paolo Bonzini6cc2a412012-03-06 18:55:59 +0100882- "mode": whether and how QEMU should create the snapshot file
883 (NewImageMode, optional, default "absolute-paths")
Jes Sorensend967b2f2011-07-11 20:01:09 +0200884- "format": format of new image (json-string, optional)
885
886Example:
887
Luiz Capitulino7f3850c2011-10-10 17:30:08 -0300888-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
889 "snapshot-file":
890 "/some/place/my-image",
891 "format": "qcow2" } }
Jes Sorensend967b2f2011-07-11 20:01:09 +0200892<- { "return": {} }
893
894EQMP
895
896 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300897 .name = "balloon",
898 .args_type = "value:M",
Luiz Capitulinod72f3262011-11-25 14:38:09 -0200899 .mhandler.cmd_new = qmp_marshal_input_balloon,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300900 },
901
902SQMP
903balloon
904-------
905
906Request VM to change its memory allocation (in bytes).
907
908Arguments:
909
910- "value": New memory allocation (json-int)
911
912Example:
913
914-> { "execute": "balloon", "arguments": { "value": 536870912 } }
915<- { "return": {} }
916
917EQMP
918
919 {
920 .name = "set_link",
921 .args_type = "name:s,up:b",
Luiz Capitulino4b371562011-11-23 13:11:55 -0200922 .mhandler.cmd_new = qmp_marshal_input_set_link,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300923 },
924
925SQMP
926set_link
927--------
928
929Change the link status of a network adapter.
930
931Arguments:
932
933- "name": network device name (json-string)
934- "up": status is up (json-bool)
935
936Example:
937
938-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
939<- { "return": {} }
940
941EQMP
942
943 {
944 .name = "getfd",
945 .args_type = "fdname:s",
946 .params = "getfd name",
947 .help = "receive a file descriptor via SCM rights and assign it a name",
Corey Bryant208c9d12012-06-22 14:36:09 -0400948 .mhandler.cmd_new = qmp_marshal_input_getfd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300949 },
950
951SQMP
952getfd
953-----
954
955Receive a file descriptor via SCM rights and assign it a name.
956
957Arguments:
958
959- "fdname": file descriptor name (json-string)
960
961Example:
962
963-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
964<- { "return": {} }
965
Corey Bryant208c9d12012-06-22 14:36:09 -0400966Notes:
967
968(1) If the name specified by the "fdname" argument already exists,
969 the file descriptor assigned to it will be closed and replaced
970 by the received file descriptor.
971(2) The 'closefd' command can be used to explicitly close the file
972 descriptor when it is no longer needed.
973
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300974EQMP
975
976 {
977 .name = "closefd",
978 .args_type = "fdname:s",
979 .params = "closefd name",
980 .help = "close a file descriptor previously passed via SCM rights",
Corey Bryant208c9d12012-06-22 14:36:09 -0400981 .mhandler.cmd_new = qmp_marshal_input_closefd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -0300982 },
983
984SQMP
985closefd
986-------
987
988Close a file descriptor previously passed via SCM rights.
989
990Arguments:
991
992- "fdname": file descriptor name (json-string)
993
994Example:
995
996-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
997<- { "return": {} }
998
999EQMP
1000
Corey Bryantba1c0482012-08-14 16:43:43 -04001001 {
1002 .name = "add-fd",
1003 .args_type = "fdset-id:i?,opaque:s?",
1004 .params = "add-fd fdset-id opaque",
1005 .help = "Add a file descriptor, that was passed via SCM rights, to an fd set",
1006 .mhandler.cmd_new = qmp_marshal_input_add_fd,
1007 },
1008
1009SQMP
1010add-fd
1011-------
1012
1013Add a file descriptor, that was passed via SCM rights, to an fd set.
1014
1015Arguments:
1016
1017- "fdset-id": The ID of the fd set to add the file descriptor to.
1018 (json-int, optional)
1019- "opaque": A free-form string that can be used to describe the fd.
1020 (json-string, optional)
1021
1022Return a json-object with the following information:
1023
1024- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1025- "fd": The file descriptor that was received via SCM rights and added to the
1026 fd set. (json-int)
1027
1028Example:
1029
1030-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1031<- { "return": { "fdset-id": 1, "fd": 3 } }
1032
1033Notes:
1034
1035(1) The list of fd sets is shared by all monitor connections.
1036(2) If "fdset-id" is not specified, a new fd set will be created.
1037
1038EQMP
1039
1040 {
1041 .name = "remove-fd",
1042 .args_type = "fdset-id:i,fd:i?",
1043 .params = "remove-fd fdset-id fd",
1044 .help = "Remove a file descriptor from an fd set",
1045 .mhandler.cmd_new = qmp_marshal_input_remove_fd,
1046 },
1047
1048SQMP
1049remove-fd
1050---------
1051
1052Remove a file descriptor from an fd set.
1053
1054Arguments:
1055
1056- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1057 (json-int)
1058- "fd": The file descriptor that is to be removed. (json-int, optional)
1059
1060Example:
1061
1062-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1063<- { "return": {} }
1064
1065Notes:
1066
1067(1) The list of fd sets is shared by all monitor connections.
1068(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1069 removed.
1070
1071EQMP
1072
1073 {
1074 .name = "query-fdsets",
1075 .args_type = "",
1076 .help = "Return information describing all fd sets",
1077 .mhandler.cmd_new = qmp_marshal_input_query_fdsets,
1078 },
1079
1080SQMP
1081query-fdsets
1082-------------
1083
1084Return information describing all fd sets.
1085
1086Arguments: None
1087
1088Example:
1089
1090-> { "execute": "query-fdsets" }
1091<- { "return": [
1092 {
1093 "fds": [
1094 {
1095 "fd": 30,
1096 "opaque": "rdonly:/path/to/file"
1097 },
1098 {
1099 "fd": 24,
1100 "opaque": "rdwr:/path/to/file"
1101 }
1102 ],
1103 "fdset-id": 1
1104 },
1105 {
1106 "fds": [
1107 {
1108 "fd": 28
1109 },
1110 {
1111 "fd": 29
1112 }
1113 ],
1114 "fdset-id": 0
1115 }
1116 ]
1117 }
1118
1119Note: The list of fd sets is shared by all monitor connections.
1120
1121EQMP
1122
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001123 {
1124 .name = "block_passwd",
1125 .args_type = "device:B,password:s",
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -02001126 .mhandler.cmd_new = qmp_marshal_input_block_passwd,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001127 },
1128
1129SQMP
1130block_passwd
1131------------
1132
1133Set the password of encrypted block devices.
1134
1135Arguments:
1136
1137- "device": device name (json-string)
1138- "password": password (json-string)
1139
1140Example:
1141
1142-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1143 "password": "12345" } }
1144<- { "return": {} }
1145
1146EQMP
1147
1148 {
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001149 .name = "block_set_io_throttle",
1150 .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l",
Luiz Capitulino80047da2011-12-14 16:49:14 -02001151 .mhandler.cmd_new = qmp_marshal_input_block_set_io_throttle,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001152 },
1153
1154SQMP
1155block_set_io_throttle
1156------------
1157
1158Change I/O throttle limits for a block drive.
1159
1160Arguments:
1161
1162- "device": device name (json-string)
1163- "bps": total throughput limit in bytes per second(json-int)
1164- "bps_rd": read throughput limit in bytes per second(json-int)
1165- "bps_wr": read throughput limit in bytes per second(json-int)
1166- "iops": total I/O operations per second(json-int)
1167- "iops_rd": read I/O operations per second(json-int)
1168- "iops_wr": write I/O operations per second(json-int)
1169
1170Example:
1171
1172-> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0",
1173 "bps": "1000000",
1174 "bps_rd": "0",
1175 "bps_wr": "0",
1176 "iops": "0",
1177 "iops_rd": "0",
1178 "iops_wr": "0" } }
1179<- { "return": {} }
1180
1181EQMP
1182
1183 {
Gerd Hoffmann75721502010-10-07 12:22:54 +02001184 .name = "set_password",
1185 .args_type = "protocol:s,password:s,connected:s?",
Luiz Capitulinofbf796f2011-12-07 11:17:51 -02001186 .mhandler.cmd_new = qmp_marshal_input_set_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001187 },
1188
1189SQMP
1190set_password
1191------------
1192
1193Set the password for vnc/spice protocols.
1194
1195Arguments:
1196
1197- "protocol": protocol name (json-string)
1198- "password": password (json-string)
1199- "connected": [ keep | disconnect | fail ] (josn-string, optional)
1200
1201Example:
1202
1203-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1204 "password": "secret" } }
1205<- { "return": {} }
1206
1207EQMP
1208
1209 {
1210 .name = "expire_password",
1211 .args_type = "protocol:s,time:s",
Luiz Capitulino9ad53722011-12-07 11:47:57 -02001212 .mhandler.cmd_new = qmp_marshal_input_expire_password,
Gerd Hoffmann75721502010-10-07 12:22:54 +02001213 },
1214
1215SQMP
1216expire_password
1217---------------
1218
1219Set the password expire time for vnc/spice protocols.
1220
1221Arguments:
1222
1223- "protocol": protocol name (json-string)
1224- "time": [ now | never | +secs | secs ] (json-string)
1225
1226Example:
1227
1228-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1229 "time": "+60" } }
1230<- { "return": {} }
1231
1232EQMP
1233
1234 {
Daniel P. Berrange13661082011-06-23 13:31:42 +01001235 .name = "add_client",
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001236 .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?",
1237 .params = "protocol fdname skipauth tls",
Daniel P. Berrange13661082011-06-23 13:31:42 +01001238 .help = "add a graphics client",
1239 .user_print = monitor_user_noop,
1240 .mhandler.cmd_new = add_graphics_client,
1241 },
1242
1243SQMP
1244add_client
1245----------
1246
1247Add a graphics client
1248
1249Arguments:
1250
1251- "protocol": protocol name (json-string)
1252- "fdname": file descriptor name (json-string)
Daniel P. Berrangef1f5f402012-02-13 13:43:08 +00001253- "skipauth": whether to skip authentication (json-bool, optional)
1254- "tls": whether to perform TLS (json-bool, optional)
Daniel P. Berrange13661082011-06-23 13:31:42 +01001255
1256Example:
1257
1258-> { "execute": "add_client", "arguments": { "protocol": "vnc",
1259 "fdname": "myclient" } }
1260<- { "return": {} }
1261
1262EQMP
1263 {
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001264 .name = "qmp_capabilities",
1265 .args_type = "",
1266 .params = "",
1267 .help = "enable QMP capabilities",
1268 .user_print = monitor_user_noop,
1269 .mhandler.cmd_new = do_qmp_capabilities,
1270 },
1271
1272SQMP
1273qmp_capabilities
1274----------------
1275
1276Enable QMP capabilities.
1277
1278Arguments: None.
1279
1280Example:
1281
1282-> { "execute": "qmp_capabilities" }
1283<- { "return": {} }
1284
1285Note: This command must be issued before issuing any other command.
1286
Luiz Capitulino0268d972010-10-22 10:08:02 -02001287EQMP
1288
1289 {
1290 .name = "human-monitor-command",
1291 .args_type = "command-line:s,cpu-index:i?",
Luiz Capitulinod51a67b2011-11-25 17:52:45 -02001292 .mhandler.cmd_new = qmp_marshal_input_human_monitor_command,
Luiz Capitulino0268d972010-10-22 10:08:02 -02001293 },
1294
1295SQMP
1296human-monitor-command
1297---------------------
1298
1299Execute a Human Monitor command.
1300
1301Arguments:
1302
1303- command-line: the command name and its arguments, just like the
1304 Human Monitor's shell (json-string)
1305- cpu-index: select the CPU number to be used by commands which access CPU
1306 data, like 'info registers'. The Monitor selects CPU 0 if this
1307 argument is not provided (json-int, optional)
1308
1309Example:
1310
1311-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1312<- { "return": "kvm support: enabled\r\n" }
1313
1314Notes:
1315
1316(1) The Human Monitor is NOT an stable interface, this means that command
1317 names, arguments and responses can change or be removed at ANY time.
1318 Applications that rely on long term stability guarantees should NOT
1319 use this command
1320
1321(2) Limitations:
1322
1323 o This command is stateless, this means that commands that depend
1324 on state information (such as getfd) might not work
1325
1326 o Commands that prompt the user for data (eg. 'cont' when the block
1327 device is encrypted) don't currently work
1328
Luiz Capitulino82a56f02010-09-13 12:26:00 -030013293. Query Commands
1330=================
1331
1332HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change
1333HXCOMM this! We will possibly move query commands definitions inside those
1334HXCOMM sections, just like regular commands.
1335
1336EQMP
1337
1338SQMP
1339query-version
1340-------------
1341
1342Show QEMU version.
1343
1344Return a json-object with the following information:
1345
1346- "qemu": A json-object containing three integer values:
1347 - "major": QEMU's major version (json-int)
1348 - "minor": QEMU's minor version (json-int)
1349 - "micro": QEMU's micro version (json-int)
1350- "package": package's version (json-string)
1351
1352Example:
1353
1354-> { "execute": "query-version" }
1355<- {
1356 "return":{
1357 "qemu":{
1358 "major":0,
1359 "minor":11,
1360 "micro":5
1361 },
1362 "package":""
1363 }
1364 }
1365
1366EQMP
1367
Luiz Capitulinob9c15f12011-08-26 17:38:13 -03001368 {
1369 .name = "query-version",
1370 .args_type = "",
1371 .mhandler.cmd_new = qmp_marshal_input_query_version,
1372 },
1373
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001374SQMP
1375query-commands
1376--------------
1377
1378List QMP available commands.
1379
1380Each command is represented by a json-object, the returned value is a json-array
1381of all commands.
1382
1383Each json-object contain:
1384
1385- "name": command's name (json-string)
1386
1387Example:
1388
1389-> { "execute": "query-commands" }
1390<- {
1391 "return":[
1392 {
1393 "name":"query-balloon"
1394 },
1395 {
1396 "name":"system_powerdown"
1397 }
1398 ]
1399 }
1400
1401Note: This example has been shortened as the real response is too long.
1402
1403EQMP
1404
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -03001405 {
1406 .name = "query-commands",
1407 .args_type = "",
1408 .mhandler.cmd_new = qmp_marshal_input_query_commands,
1409 },
1410
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001411SQMP
Daniel P. Berrange48608532012-05-21 17:59:51 +01001412query-events
1413--------------
1414
1415List QMP available events.
1416
1417Each event is represented by a json-object, the returned value is a json-array
1418of all events.
1419
1420Each json-object contains:
1421
1422- "name": event's name (json-string)
1423
1424Example:
1425
1426-> { "execute": "query-events" }
1427<- {
1428 "return":[
1429 {
1430 "name":"SHUTDOWN"
1431 },
1432 {
1433 "name":"RESET"
1434 }
1435 ]
1436 }
1437
1438Note: This example has been shortened as the real response is too long.
1439
1440EQMP
1441
1442 {
1443 .name = "query-events",
1444 .args_type = "",
1445 .mhandler.cmd_new = qmp_marshal_input_query_events,
1446 },
1447
1448SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001449query-chardev
1450-------------
1451
1452Each device is represented by a json-object. The returned value is a json-array
1453of all devices.
1454
1455Each json-object contain the following:
1456
1457- "label": device's label (json-string)
1458- "filename": device's file (json-string)
1459
1460Example:
1461
1462-> { "execute": "query-chardev" }
1463<- {
1464 "return":[
1465 {
1466 "label":"monitor",
1467 "filename":"stdio"
1468 },
1469 {
1470 "label":"serial0",
1471 "filename":"vc"
1472 }
1473 ]
1474 }
1475
1476EQMP
1477
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -03001478 {
1479 .name = "query-chardev",
1480 .args_type = "",
1481 .mhandler.cmd_new = qmp_marshal_input_query_chardev,
1482 },
1483
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001484SQMP
1485query-block
1486-----------
1487
1488Show the block devices.
1489
1490Each block device information is stored in a json-object and the returned value
1491is a json-array of all devices.
1492
1493Each json-object contain the following:
1494
1495- "device": device name (json-string)
1496- "type": device type (json-string)
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001497 - deprecated, retained for backward compatibility
1498 - Possible values: "unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001499- "removable": true if the device is removable, false otherwise (json-bool)
1500- "locked": true if the device is locked, false otherwise (json-bool)
Markus Armbrustere4def802011-09-06 18:58:53 +02001501- "tray-open": only present if removable, true if the device has a tray,
1502 and it is open (json-bool)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001503- "inserted": only present if the device is inserted, it is a json-object
1504 containing the following:
1505 - "file": device file name (json-string)
1506 - "ro": true if read-only, false otherwise (json-bool)
1507 - "drv": driver format name (json-string)
1508 - Possible values: "blkdebug", "bochs", "cloop", "cow", "dmg",
1509 "file", "file", "ftp", "ftps", "host_cdrom",
1510 "host_device", "host_floppy", "http", "https",
1511 "nbd", "parallels", "qcow", "qcow2", "raw",
1512 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1513 - "backing_file": backing file name (json-string, optional)
Benoît Canet2e3e3312012-08-02 10:22:48 +02001514 - "backing_file_depth": number of files in the backing file chain (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001515 - "encrypted": true if encrypted, false otherwise (json-bool)
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001516 - "bps": limit total bytes per second (json-int)
1517 - "bps_rd": limit read bytes per second (json-int)
1518 - "bps_wr": limit write bytes per second (json-int)
1519 - "iops": limit total I/O operations per second (json-int)
1520 - "iops_rd": limit read operations per second (json-int)
1521 - "iops_wr": limit write operations per second (json-int)
1522
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001523- "io-status": I/O operation status, only present if the device supports it
1524 and the VM is configured to stop on errors. It's always reset
1525 to "ok" when the "cont" command is issued (json_string, optional)
1526 - Possible values: "ok", "failed", "nospace"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001527
1528Example:
1529
1530-> { "execute": "query-block" }
1531<- {
1532 "return":[
1533 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001534 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001535 "device":"ide0-hd0",
1536 "locked":false,
1537 "removable":false,
1538 "inserted":{
1539 "ro":false,
1540 "drv":"qcow2",
1541 "encrypted":false,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001542 "file":"disks/test.img",
Benoît Canet2e3e3312012-08-02 10:22:48 +02001543 "backing_file_depth":0,
Zhi Yong Wu727f0052011-11-08 13:00:31 +08001544 "bps":1000000,
1545 "bps_rd":0,
1546 "bps_wr":0,
1547 "iops":1000000,
1548 "iops_rd":0,
1549 "iops_wr":0,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001550 },
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001551 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001552 },
1553 {
Luiz Capitulinof04ef602011-09-26 17:43:54 -03001554 "io-status": "ok",
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001555 "device":"ide1-cd0",
1556 "locked":false,
1557 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001558 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001559 },
1560 {
1561 "device":"floppy0",
1562 "locked":false,
1563 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001564 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001565 },
1566 {
1567 "device":"sd0",
1568 "locked":false,
1569 "removable":true,
Markus Armbrusterd8aeeb32011-05-16 15:04:55 +02001570 "type":"unknown"
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001571 }
1572 ]
1573 }
1574
1575EQMP
1576
Luiz Capitulinob2023812011-09-21 17:16:47 -03001577 {
1578 .name = "query-block",
1579 .args_type = "",
1580 .mhandler.cmd_new = qmp_marshal_input_query_block,
1581 },
1582
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001583SQMP
1584query-blockstats
1585----------------
1586
1587Show block device statistics.
1588
1589Each device statistic information is stored in a json-object and the returned
1590value is a json-array of all devices.
1591
1592Each json-object contain the following:
1593
1594- "device": device name (json-string)
1595- "stats": A json-object with the statistics information, it contains:
1596 - "rd_bytes": bytes read (json-int)
1597 - "wr_bytes": bytes written (json-int)
1598 - "rd_operations": read operations (json-int)
1599 - "wr_operations": write operations (json-int)
Christoph Hellwige8045d62011-08-22 00:25:58 +02001600 - "flush_operations": cache flush operations (json-int)
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001601 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1602 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1603 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001604 - "wr_highest_offset": Highest offset of a sector written since the
1605 BlockDriverState has been opened (json-int)
1606- "parent": Contains recursively the statistics of the underlying
1607 protocol (e.g. the host file for a qcow2 image). If there is
1608 no underlying protocol, this field is omitted
1609 (json-object, optional)
1610
1611Example:
1612
1613-> { "execute": "query-blockstats" }
1614<- {
1615 "return":[
1616 {
1617 "device":"ide0-hd0",
1618 "parent":{
1619 "stats":{
1620 "wr_highest_offset":3686448128,
1621 "wr_bytes":9786368,
1622 "wr_operations":751,
1623 "rd_bytes":122567168,
1624 "rd_operations":36772
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001625 "wr_total_times_ns":313253456
1626 "rd_total_times_ns":3465673657
1627 "flush_total_times_ns":49653
Christoph Hellwige8045d62011-08-22 00:25:58 +02001628 "flush_operations":61,
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001629 }
1630 },
1631 "stats":{
1632 "wr_highest_offset":2821110784,
1633 "wr_bytes":9786368,
1634 "wr_operations":692,
1635 "rd_bytes":122739200,
1636 "rd_operations":36604
Christoph Hellwige8045d62011-08-22 00:25:58 +02001637 "flush_operations":51,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001638 "wr_total_times_ns":313253456
1639 "rd_total_times_ns":3465673657
1640 "flush_total_times_ns":49653
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001641 }
1642 },
1643 {
1644 "device":"ide1-cd0",
1645 "stats":{
1646 "wr_highest_offset":0,
1647 "wr_bytes":0,
1648 "wr_operations":0,
1649 "rd_bytes":0,
1650 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001651 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001652 "wr_total_times_ns":0
1653 "rd_total_times_ns":0
1654 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001655 }
1656 },
1657 {
1658 "device":"floppy0",
1659 "stats":{
1660 "wr_highest_offset":0,
1661 "wr_bytes":0,
1662 "wr_operations":0,
1663 "rd_bytes":0,
1664 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001665 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001666 "wr_total_times_ns":0
1667 "rd_total_times_ns":0
1668 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001669 }
1670 },
1671 {
1672 "device":"sd0",
1673 "stats":{
1674 "wr_highest_offset":0,
1675 "wr_bytes":0,
1676 "wr_operations":0,
1677 "rd_bytes":0,
1678 "rd_operations":0
Christoph Hellwige8045d62011-08-22 00:25:58 +02001679 "flush_operations":0,
Christoph Hellwigc488c7f2011-08-25 08:26:10 +02001680 "wr_total_times_ns":0
1681 "rd_total_times_ns":0
1682 "flush_total_times_ns":0
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001683 }
1684 }
1685 ]
1686 }
1687
1688EQMP
1689
Luiz Capitulinof11f57e2011-09-22 15:56:36 -03001690 {
1691 .name = "query-blockstats",
1692 .args_type = "",
1693 .mhandler.cmd_new = qmp_marshal_input_query_blockstats,
1694 },
1695
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001696SQMP
1697query-cpus
1698----------
1699
1700Show CPU information.
1701
1702Return a json-array. Each CPU is represented by a json-object, which contains:
1703
1704- "CPU": CPU index (json-int)
1705- "current": true if this is the current CPU, false otherwise (json-bool)
1706- "halted": true if the cpu is halted, false otherwise (json-bool)
1707- Current program counter. The key's name depends on the architecture:
1708 "pc": i386/x86_64 (json-int)
1709 "nip": PPC (json-int)
1710 "pc" and "npc": sparc (json-int)
1711 "PC": mips (json-int)
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001712- "thread_id": ID of the underlying host thread (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001713
1714Example:
1715
1716-> { "execute": "query-cpus" }
1717<- {
1718 "return":[
1719 {
1720 "CPU":0,
1721 "current":true,
1722 "halted":false,
1723 "pc":3227107138
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001724 "thread_id":3134
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001725 },
1726 {
1727 "CPU":1,
1728 "current":false,
1729 "halted":true,
1730 "pc":7108165
Jan Kiszkadc7a09c2011-03-15 12:26:31 +01001731 "thread_id":3135
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001732 }
1733 ]
1734 }
1735
1736EQMP
1737
Luiz Capitulinode0b36b2011-09-21 16:38:35 -03001738 {
1739 .name = "query-cpus",
1740 .args_type = "",
1741 .mhandler.cmd_new = qmp_marshal_input_query_cpus,
1742 },
1743
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001744SQMP
1745query-pci
1746---------
1747
1748PCI buses and devices information.
1749
1750The returned value is a json-array of all buses. Each bus is represented by
1751a json-object, which has a key with a json-array of all PCI devices attached
1752to it. Each device is represented by a json-object.
1753
1754The bus json-object contains the following:
1755
1756- "bus": bus number (json-int)
1757- "devices": a json-array of json-objects, each json-object represents a
1758 PCI device
1759
1760The PCI device json-object contains the following:
1761
1762- "bus": identical to the parent's bus number (json-int)
1763- "slot": slot number (json-int)
1764- "function": function number (json-int)
1765- "class_info": a json-object containing:
1766 - "desc": device class description (json-string, optional)
1767 - "class": device class number (json-int)
1768- "id": a json-object containing:
1769 - "device": device ID (json-int)
1770 - "vendor": vendor ID (json-int)
1771- "irq": device's IRQ if assigned (json-int, optional)
1772- "qdev_id": qdev id string (json-string)
1773- "pci_bridge": It's a json-object, only present if this device is a
1774 PCI bridge, contains:
1775 - "bus": bus number (json-int)
1776 - "secondary": secondary bus number (json-int)
1777 - "subordinate": subordinate bus number (json-int)
1778 - "io_range": I/O memory range information, a json-object with the
1779 following members:
1780 - "base": base address, in bytes (json-int)
1781 - "limit": limit address, in bytes (json-int)
1782 - "memory_range": memory range information, a json-object with the
1783 following members:
1784 - "base": base address, in bytes (json-int)
1785 - "limit": limit address, in bytes (json-int)
1786 - "prefetchable_range": Prefetchable memory range information, a
1787 json-object with the following members:
1788 - "base": base address, in bytes (json-int)
1789 - "limit": limit address, in bytes (json-int)
1790 - "devices": a json-array of PCI devices if there's any attached, each
1791 each element is represented by a json-object, which contains
1792 the same members of the 'PCI device json-object' described
1793 above (optional)
1794- "regions": a json-array of json-objects, each json-object represents a
1795 memory region of this device
1796
1797The memory range json-object contains the following:
1798
1799- "base": base memory address (json-int)
1800- "limit": limit value (json-int)
1801
1802The region json-object can be an I/O region or a memory region, an I/O region
1803json-object contains the following:
1804
1805- "type": "io" (json-string, fixed)
1806- "bar": BAR number (json-int)
1807- "address": memory address (json-int)
1808- "size": memory size (json-int)
1809
1810A memory region json-object contains the following:
1811
1812- "type": "memory" (json-string, fixed)
1813- "bar": BAR number (json-int)
1814- "address": memory address (json-int)
1815- "size": memory size (json-int)
1816- "mem_type_64": true or false (json-bool)
1817- "prefetch": true or false (json-bool)
1818
1819Example:
1820
1821-> { "execute": "query-pci" }
1822<- {
1823 "return":[
1824 {
1825 "bus":0,
1826 "devices":[
1827 {
1828 "bus":0,
1829 "qdev_id":"",
1830 "slot":0,
1831 "class_info":{
1832 "class":1536,
1833 "desc":"Host bridge"
1834 },
1835 "id":{
1836 "device":32902,
1837 "vendor":4663
1838 },
1839 "function":0,
1840 "regions":[
1841
1842 ]
1843 },
1844 {
1845 "bus":0,
1846 "qdev_id":"",
1847 "slot":1,
1848 "class_info":{
1849 "class":1537,
1850 "desc":"ISA bridge"
1851 },
1852 "id":{
1853 "device":32902,
1854 "vendor":28672
1855 },
1856 "function":0,
1857 "regions":[
1858
1859 ]
1860 },
1861 {
1862 "bus":0,
1863 "qdev_id":"",
1864 "slot":1,
1865 "class_info":{
1866 "class":257,
1867 "desc":"IDE controller"
1868 },
1869 "id":{
1870 "device":32902,
1871 "vendor":28688
1872 },
1873 "function":1,
1874 "regions":[
1875 {
1876 "bar":4,
1877 "size":16,
1878 "address":49152,
1879 "type":"io"
1880 }
1881 ]
1882 },
1883 {
1884 "bus":0,
1885 "qdev_id":"",
1886 "slot":2,
1887 "class_info":{
1888 "class":768,
1889 "desc":"VGA controller"
1890 },
1891 "id":{
1892 "device":4115,
1893 "vendor":184
1894 },
1895 "function":0,
1896 "regions":[
1897 {
1898 "prefetch":true,
1899 "mem_type_64":false,
1900 "bar":0,
1901 "size":33554432,
1902 "address":4026531840,
1903 "type":"memory"
1904 },
1905 {
1906 "prefetch":false,
1907 "mem_type_64":false,
1908 "bar":1,
1909 "size":4096,
1910 "address":4060086272,
1911 "type":"memory"
1912 },
1913 {
1914 "prefetch":false,
1915 "mem_type_64":false,
1916 "bar":6,
1917 "size":65536,
1918 "address":-1,
1919 "type":"memory"
1920 }
1921 ]
1922 },
1923 {
1924 "bus":0,
1925 "qdev_id":"",
1926 "irq":11,
1927 "slot":4,
1928 "class_info":{
1929 "class":1280,
1930 "desc":"RAM controller"
1931 },
1932 "id":{
1933 "device":6900,
1934 "vendor":4098
1935 },
1936 "function":0,
1937 "regions":[
1938 {
1939 "bar":0,
1940 "size":32,
1941 "address":49280,
1942 "type":"io"
1943 }
1944 ]
1945 }
1946 ]
1947 }
1948 ]
1949 }
1950
1951Note: This example has been shortened as the real response is too long.
1952
1953EQMP
1954
Luiz Capitulino79627472011-10-21 14:15:33 -02001955 {
1956 .name = "query-pci",
1957 .args_type = "",
1958 .mhandler.cmd_new = qmp_marshal_input_query_pci,
1959 },
1960
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001961SQMP
1962query-kvm
1963---------
1964
1965Show KVM information.
1966
1967Return a json-object with the following information:
1968
1969- "enabled": true if KVM support is enabled, false otherwise (json-bool)
1970- "present": true if QEMU has KVM support, false otherwise (json-bool)
1971
1972Example:
1973
1974-> { "execute": "query-kvm" }
1975<- { "return": { "enabled": true, "present": true } }
1976
1977EQMP
1978
Luiz Capitulino292a2602011-09-12 15:10:53 -03001979 {
1980 .name = "query-kvm",
1981 .args_type = "",
1982 .mhandler.cmd_new = qmp_marshal_input_query_kvm,
1983 },
1984
Luiz Capitulino82a56f02010-09-13 12:26:00 -03001985SQMP
1986query-status
1987------------
1988
1989Return a json-object with the following information:
1990
1991- "running": true if the VM is running, or false if it is paused (json-bool)
1992- "singlestep": true if the VM is in single step mode,
1993 false otherwise (json-bool)
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03001994- "status": one of the following values (json-string)
1995 "debug" - QEMU is running on a debugger
1996 "inmigrate" - guest is paused waiting for an incoming migration
1997 "internal-error" - An internal error that prevents further guest
1998 execution has occurred
1999 "io-error" - the last IOP has failed and the device is configured
2000 to pause on I/O errors
2001 "paused" - guest has been paused via the 'stop' command
2002 "postmigrate" - guest is paused following a successful 'migrate'
2003 "prelaunch" - QEMU was started with -S and guest has not started
2004 "finish-migrate" - guest is paused to finish the migration process
2005 "restore-vm" - guest is paused to restore VM state
2006 "running" - guest is actively running
2007 "save-vm" - guest is paused to save the VM state
2008 "shutdown" - guest is shut down (and -no-shutdown is in use)
2009 "watchdog" - the watchdog action is configured to pause and
2010 has been triggered
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002011
2012Example:
2013
2014-> { "execute": "query-status" }
Luiz Capitulino9e37b9d2011-08-29 16:02:57 -03002015<- { "return": { "running": true, "singlestep": false, "status": "running" } }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002016
2017EQMP
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -03002018
2019 {
2020 .name = "query-status",
2021 .args_type = "",
2022 .mhandler.cmd_new = qmp_marshal_input_query_status,
2023 },
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002024
2025SQMP
2026query-mice
2027----------
2028
2029Show VM mice information.
2030
2031Each mouse is represented by a json-object, the returned value is a json-array
2032of all mice.
2033
2034The mouse json-object contains the following:
2035
2036- "name": mouse's name (json-string)
2037- "index": mouse's index (json-int)
2038- "current": true if this mouse is receiving events, false otherwise (json-bool)
2039- "absolute": true if the mouse generates absolute input events (json-bool)
2040
2041Example:
2042
2043-> { "execute": "query-mice" }
2044<- {
2045 "return":[
2046 {
2047 "name":"QEMU Microsoft Mouse",
2048 "index":0,
2049 "current":false,
2050 "absolute":false
2051 },
2052 {
2053 "name":"QEMU PS/2 Mouse",
2054 "index":1,
2055 "current":true,
2056 "absolute":true
2057 }
2058 ]
2059 }
2060
2061EQMP
2062
Luiz Capitulinoe235cec2011-09-21 15:29:55 -03002063 {
2064 .name = "query-mice",
2065 .args_type = "",
2066 .mhandler.cmd_new = qmp_marshal_input_query_mice,
2067 },
2068
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002069SQMP
2070query-vnc
2071---------
2072
2073Show VNC server information.
2074
2075Return a json-object with server information. Connected clients are returned
2076as a json-array of json-objects.
2077
2078The main json-object contains the following:
2079
2080- "enabled": true or false (json-bool)
2081- "host": server's IP address (json-string)
2082- "family": address family (json-string)
2083 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2084- "service": server's port number (json-string)
2085- "auth": authentication method (json-string)
2086 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2087 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2088 "vencrypt+plain", "vencrypt+tls+none",
2089 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2090 "vencrypt+tls+vnc", "vencrypt+x509+none",
2091 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2092 "vencrypt+x509+vnc", "vnc"
2093- "clients": a json-array of all connected clients
2094
2095Clients are described by a json-object, each one contain the following:
2096
2097- "host": client's IP address (json-string)
2098- "family": address family (json-string)
2099 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2100- "service": client's port number (json-string)
2101- "x509_dname": TLS dname (json-string, optional)
2102- "sasl_username": SASL username (json-string, optional)
2103
2104Example:
2105
2106-> { "execute": "query-vnc" }
2107<- {
2108 "return":{
2109 "enabled":true,
2110 "host":"0.0.0.0",
2111 "service":"50402",
2112 "auth":"vnc",
2113 "family":"ipv4",
2114 "clients":[
2115 {
2116 "host":"127.0.0.1",
2117 "service":"50401",
2118 "family":"ipv4"
2119 }
2120 ]
2121 }
2122 }
2123
2124EQMP
2125
Luiz Capitulino2b54aa82011-10-17 16:41:22 -02002126 {
2127 .name = "query-vnc",
2128 .args_type = "",
2129 .mhandler.cmd_new = qmp_marshal_input_query_vnc,
2130 },
2131
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002132SQMP
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01002133query-spice
2134-----------
2135
2136Show SPICE server information.
2137
2138Return a json-object with server information. Connected clients are returned
2139as a json-array of json-objects.
2140
2141The main json-object contains the following:
2142
2143- "enabled": true or false (json-bool)
2144- "host": server's IP address (json-string)
2145- "port": server's port number (json-int, optional)
2146- "tls-port": server's port number (json-int, optional)
2147- "auth": authentication method (json-string)
2148 - Possible values: "none", "spice"
2149- "channels": a json-array of all active channels clients
2150
2151Channels are described by a json-object, each one contain the following:
2152
2153- "host": client's IP address (json-string)
2154- "family": address family (json-string)
2155 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2156- "port": client's port number (json-string)
2157- "connection-id": spice connection id. All channels with the same id
2158 belong to the same spice session (json-int)
2159- "channel-type": channel type. "1" is the main control channel, filter for
2160 this one if you want track spice sessions only (json-int)
2161- "channel-id": channel id. Usually "0", might be different needed when
2162 multiple channels of the same type exist, such as multiple
2163 display channels in a multihead setup (json-int)
2164- "tls": whevener the channel is encrypted (json-bool)
2165
2166Example:
2167
2168-> { "execute": "query-spice" }
2169<- {
2170 "return": {
2171 "enabled": true,
2172 "auth": "spice",
2173 "port": 5920,
2174 "tls-port": 5921,
2175 "host": "0.0.0.0",
2176 "channels": [
2177 {
2178 "port": "54924",
2179 "family": "ipv4",
2180 "channel-type": 1,
2181 "connection-id": 1804289383,
2182 "host": "127.0.0.1",
2183 "channel-id": 0,
2184 "tls": true
2185 },
2186 {
2187 "port": "36710",
2188 "family": "ipv4",
2189 "channel-type": 4,
2190 "connection-id": 1804289383,
2191 "host": "127.0.0.1",
2192 "channel-id": 0,
2193 "tls": false
2194 },
2195 [ ... more channels follow ... ]
2196 ]
2197 }
2198 }
2199
2200EQMP
2201
Luiz Capitulinod1f29642011-10-20 17:01:33 -02002202#if defined(CONFIG_SPICE)
2203 {
2204 .name = "query-spice",
2205 .args_type = "",
2206 .mhandler.cmd_new = qmp_marshal_input_query_spice,
2207 },
2208#endif
2209
Gerd Hoffmanncb42a872010-11-30 11:02:51 +01002210SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002211query-name
2212----------
2213
2214Show VM name.
2215
2216Return a json-object with the following information:
2217
2218- "name": VM's name (json-string, optional)
2219
2220Example:
2221
2222-> { "execute": "query-name" }
2223<- { "return": { "name": "qemu-name" } }
2224
2225EQMP
2226
Anthony Liguori48a32be2011-09-02 12:34:48 -05002227 {
2228 .name = "query-name",
2229 .args_type = "",
2230 .mhandler.cmd_new = qmp_marshal_input_query_name,
2231 },
2232
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002233SQMP
2234query-uuid
2235----------
2236
2237Show VM UUID.
2238
2239Return a json-object with the following information:
2240
2241- "UUID": Universally Unique Identifier (json-string)
2242
2243Example:
2244
2245-> { "execute": "query-uuid" }
2246<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2247
2248EQMP
2249
Luiz Capitulinoefab7672011-09-13 17:16:25 -03002250 {
2251 .name = "query-uuid",
2252 .args_type = "",
2253 .mhandler.cmd_new = qmp_marshal_input_query_uuid,
2254 },
2255
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002256SQMP
2257query-migrate
2258-------------
2259
2260Migration status.
2261
2262Return a json-object. If migration is active there will be another json-object
2263with RAM migration status and if block migration is active another one with
2264block migration status.
2265
2266The main json-object contains the following:
2267
2268- "status": migration status (json-string)
2269 - Possible values: "active", "completed", "failed", "cancelled"
Juan Quintela7aa939a2012-08-18 13:17:10 +02002270- "total-time": total amount of ms since migration started. If
2271 migration has ended, it returns the total migration
2272 time (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002273- "ram": only present if "status" is "active", it is a json-object with the
2274 following RAM information (in bytes):
2275 - "transferred": amount transferred (json-int)
2276 - "remaining": amount remaining (json-int)
2277 - "total": total (json-int)
Orit Wasserman004d4c12012-08-06 21:42:56 +03002278 - "duplicate": number of duplicated pages (json-int)
2279 - "normal" : number of normal pages transferred (json-int)
2280 - "normal-bytes" : number of normal bytes transferred (json-int)
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002281- "disk": only present if "status" is "active" and it is a block migration,
2282 it is a json-object with the following disk information (in bytes):
2283 - "transferred": amount transferred (json-int)
2284 - "remaining": amount remaining (json-int)
2285 - "total": total (json-int)
Orit Wassermanf36d55a2012-08-06 21:42:57 +03002286- "xbzrle-cache": only present if XBZRLE is active.
2287 It is a json-object with the following XBZRLE information:
2288 - "cache-size": XBZRLE cache size
2289 - "bytes": total XBZRLE bytes transferred
2290 - "pages": number of XBZRLE compressed pages
2291 - "cache-miss": number of cache misses
2292 - "overflow": number of XBZRLE overflows
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002293Examples:
2294
22951. Before the first migration
2296
2297-> { "execute": "query-migrate" }
2298<- { "return": {} }
2299
23002. Migration is done and has succeeded
2301
2302-> { "execute": "query-migrate" }
Orit Wasserman004d4c12012-08-06 21:42:56 +03002303<- { "return": {
2304 "status": "completed",
2305 "ram":{
2306 "transferred":123,
2307 "remaining":123,
2308 "total":246,
2309 "total-time":12345,
2310 "duplicate":123,
2311 "normal":123,
2312 "normal-bytes":123456
2313 }
2314 }
2315 }
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002316
23173. Migration is done and has failed
2318
2319-> { "execute": "query-migrate" }
2320<- { "return": { "status": "failed" } }
2321
23224. Migration is being performed and is not a block migration:
2323
2324-> { "execute": "query-migrate" }
2325<- {
2326 "return":{
2327 "status":"active",
2328 "ram":{
2329 "transferred":123,
2330 "remaining":123,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03002331 "total":246,
Orit Wasserman004d4c12012-08-06 21:42:56 +03002332 "total-time":12345,
2333 "duplicate":123,
2334 "normal":123,
2335 "normal-bytes":123456
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002336 }
2337 }
2338 }
2339
23405. Migration is being performed and is a block migration:
2341
2342-> { "execute": "query-migrate" }
2343<- {
2344 "return":{
2345 "status":"active",
2346 "ram":{
2347 "total":1057024,
2348 "remaining":1053304,
Orit Wasserman62d4e3f2012-08-06 21:42:55 +03002349 "transferred":3720,
Orit Wasserman004d4c12012-08-06 21:42:56 +03002350 "total-time":12345,
2351 "duplicate":123,
2352 "normal":123,
2353 "normal-bytes":123456
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002354 },
2355 "disk":{
2356 "total":20971520,
2357 "remaining":20880384,
2358 "transferred":91136
2359 }
2360 }
2361 }
2362
Orit Wassermanf36d55a2012-08-06 21:42:57 +030023636. Migration is being performed and XBZRLE is active:
2364
2365-> { "execute": "query-migrate" }
2366<- {
2367 "return":{
2368 "status":"active",
2369 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2370 "ram":{
2371 "total":1057024,
2372 "remaining":1053304,
2373 "transferred":3720,
2374 "total-time":12345,
2375 "duplicate":10,
2376 "normal":3333,
2377 "normal-bytes":3412992
2378 },
2379 "xbzrle-cache":{
2380 "cache-size":67108864,
2381 "bytes":20971520,
2382 "pages":2444343,
2383 "cache-miss":2244,
2384 "overflow":34434
2385 }
2386 }
2387 }
2388
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002389EQMP
2390
Luiz Capitulino791e7c82011-09-13 17:37:16 -03002391 {
2392 .name = "query-migrate",
2393 .args_type = "",
2394 .mhandler.cmd_new = qmp_marshal_input_query_migrate,
2395 },
2396
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002397SQMP
Orit Wasserman00458432012-08-06 21:42:48 +03002398migrate-set-capabilities
2399-------
2400
2401Enable/Disable migration capabilities
2402
2403- "xbzrle": xbzrle support
2404
2405Arguments:
2406
2407Example:
2408
2409-> { "execute": "migrate-set-capabilities" , "arguments":
2410 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2411
2412EQMP
2413
2414 {
2415 .name = "migrate-set-capabilities",
2416 .args_type = "capabilities:O",
2417 .params = "capability:s,state:b",
2418 .mhandler.cmd_new = qmp_marshal_input_migrate_set_capabilities,
2419 },
2420SQMP
Orit Wassermanbbf6da32012-08-06 21:42:47 +03002421query-migrate-capabilities
2422-------
2423
2424Query current migration capabilities
2425
2426- "capabilities": migration capabilities state
2427 - "xbzrle" : XBZRLE state (json-bool)
2428
2429Arguments:
2430
2431Example:
2432
2433-> { "execute": "query-migrate-capabilities" }
2434<- { "return": {
2435 "capabilities" : [ { "capability" : "xbzrle", "state" : false } ]
2436 }
2437 }
2438EQMP
2439
2440 {
2441 .name = "query-migrate-capabilities",
2442 .args_type = "",
2443 .mhandler.cmd_new = qmp_marshal_input_query_migrate_capabilities,
2444 },
2445
2446SQMP
Luiz Capitulino82a56f02010-09-13 12:26:00 -03002447query-balloon
2448-------------
2449
2450Show balloon information.
2451
2452Make an asynchronous request for balloon info. When the request completes a
2453json-object will be returned containing the following data:
2454
2455- "actual": current balloon value in bytes (json-int)
2456- "mem_swapped_in": Amount of memory swapped in bytes (json-int, optional)
2457- "mem_swapped_out": Amount of memory swapped out in bytes (json-int, optional)
2458- "major_page_faults": Number of major faults (json-int, optional)
2459- "minor_page_faults": Number of minor faults (json-int, optional)
2460- "free_mem": Total amount of free and unused memory in
2461 bytes (json-int, optional)
2462- "total_mem": Total amount of available memory in bytes (json-int, optional)
2463
2464Example:
2465
2466-> { "execute": "query-balloon" }
2467<- {
2468 "return":{
2469 "actual":1073741824,
2470 "mem_swapped_in":0,
2471 "mem_swapped_out":0,
2472 "major_page_faults":142,
2473 "minor_page_faults":239245,
2474 "free_mem":1014185984,
2475 "total_mem":1044668416
2476 }
2477 }
2478
2479EQMP
2480
Luiz Capitulino96637bc2011-10-21 11:41:37 -02002481 {
2482 .name = "query-balloon",
2483 .args_type = "",
2484 .mhandler.cmd_new = qmp_marshal_input_query_balloon,
2485 },
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002486
2487 {
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +00002488 .name = "query-block-jobs",
2489 .args_type = "",
2490 .mhandler.cmd_new = qmp_marshal_input_query_block_jobs,
2491 },
2492
2493 {
Anthony Liguorib4b12c62011-12-12 14:29:34 -06002494 .name = "qom-list",
2495 .args_type = "path:s",
2496 .mhandler.cmd_new = qmp_marshal_input_qom_list,
2497 },
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002498
2499 {
2500 .name = "qom-set",
Paolo Bonzinib9f89782012-03-22 12:51:11 +01002501 .args_type = "path:s,property:s,value:q",
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06002502 .mhandler.cmd_new = qmp_qom_set,
2503 },
2504
2505 {
2506 .name = "qom-get",
2507 .args_type = "path:s,property:s",
2508 .mhandler.cmd_new = qmp_qom_get,
2509 },
Luiz Capitulino270b2432011-12-08 11:45:55 -02002510
2511 {
2512 .name = "change-vnc-password",
2513 .args_type = "password:s",
2514 .mhandler.cmd_new = qmp_marshal_input_change_vnc_password,
2515 },
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06002516 {
2517 .name = "qom-list-types",
2518 .args_type = "implements:s?,abstract:b?",
2519 .mhandler.cmd_new = qmp_marshal_input_qom_list_types,
2520 },
Anthony Liguori1daa31b2012-08-10 11:04:09 -05002521
2522 {
2523 .name = "device-list-properties",
2524 .args_type = "typename:s",
2525 .mhandler.cmd_new = qmp_marshal_input_device_list_properties,
2526 },
2527
Anthony Liguori01d3c802012-08-10 11:04:11 -05002528 {
2529 .name = "query-machines",
2530 .args_type = "",
2531 .mhandler.cmd_new = qmp_marshal_input_query_machines,
2532 },
2533
Anthony Liguorie4e31c62012-08-10 11:04:13 -05002534 {
2535 .name = "query-cpu-definitions",
2536 .args_type = "",
2537 .mhandler.cmd_new = qmp_marshal_input_query_cpu_definitions,
2538 },
2539
Daniel P. Berrange99afc912012-08-20 15:31:38 +01002540 {
2541 .name = "query-target",
2542 .args_type = "",
2543 .mhandler.cmd_new = qmp_marshal_input_query_target,
2544 },