]> Git Repo - qemu.git/blame - docs/qmp-commands.txt
qemu-iotests: Test streaming to a Quorum child
[qemu.git] / docs / qmp-commands.txt
CommitLineData
82a56f0d
LC
1 QMP Supported Commands
2 ----------------------
3
4This document describes all commands currently supported by QMP.
5
6Most of the time their usage is exactly the same as in the user Monitor, this
7means that any other document which also describe commands (the manpage,
8QEMU's manual, etc) can and should be consulted.
9
10QMP has two types of commands: regular and query commands. Regular commands
11usually change the Virtual Machine's state someway, while query commands just
12return information. The sections below are divided accordingly.
13
14It's important to observe that all communication examples are formatted in
15a reader-friendly way, so that they're easier to understand. However, in real
16protocol usage, they're emitted as a single line.
17
18Also, the following notation is used to denote data flow:
19
20-> data issued by the Client
21<- Server data response
22
77a6da26 23Please, refer to the QMP specification (docs/qmp-spec.txt) for detailed
82a56f0d
LC
24information on the Server command and response formats.
25
26NOTE: This document is temporary and will be replaced soon.
27
281. Stability Considerations
29===========================
30
31The current QMP command set (described in this file) may be useful for a
32number of use cases, however it's limited and several commands have bad
33defined semantics, specially with regard to command completion.
34
35These problems are going to be solved incrementally in the next QEMU releases
36and we're going to establish a deprecation policy for badly defined commands.
37
38If you're planning to adopt QMP, please observe the following:
39
c20cdf8b 40 1. The deprecation policy will take effect and be documented soon, please
82a56f0d
LC
41 check the documentation of each used command as soon as a new release of
42 QEMU is available
43
44 2. DO NOT rely on anything which is not explicit documented
45
46 3. Errors, in special, are not documented. Applications should NOT check
47 for specific errors classes or data (it's strongly recommended to only
48 check for the "error" key)
49
502. Regular Commands
51===================
52
53Server's responses in the examples below are always a success response, please
54refer to the QMP specification for more details on error responses.
55
82a56f0d
LC
56quit
57----
58
59Quit the emulator.
60
61Arguments: None.
62
63Example:
64
65-> { "execute": "quit" }
66<- { "return": {} }
67
82a56f0d
LC
68eject
69-----
70
71Eject a removable medium.
72
bdf05133 73Arguments:
82a56f0d 74
fbe2d816
KW
75- "force": force ejection (json-bool, optional)
76- "device": block device name (deprecated, use @id instead)
77 (json-string, optional)
78- "id": the name or QOM path of the guest device (json-string, optional)
82a56f0d
LC
79
80Example:
81
fbe2d816 82-> { "execute": "eject", "arguments": { "id": "ide0-1-0" } }
82a56f0d
LC
83<- { "return": {} }
84
85Note: The "force" argument defaults to false.
86
82a56f0d
LC
87change
88------
89
90Change a removable medium or VNC configuration.
91
92Arguments:
93
94- "device": device name (json-string)
95- "target": filename or item (json-string)
96- "arg": additional argument (json-string, optional)
97
98Examples:
99
1001. Change a removable medium
101
102-> { "execute": "change",
103 "arguments": { "device": "ide1-cd0",
104 "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
105<- { "return": {} }
106
1072. Change VNC password
108
109-> { "execute": "change",
110 "arguments": { "device": "vnc", "target": "password",
111 "arg": "foobar1" } }
112<- { "return": {} }
113
82a56f0d
LC
114screendump
115----------
116
117Save screen into PPM image.
118
119Arguments:
120
121- "filename": file path (json-string)
122
123Example:
124
125-> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } }
126<- { "return": {} }
127
82a56f0d
LC
128stop
129----
130
131Stop the emulator.
132
133Arguments: None.
134
135Example:
136
137-> { "execute": "stop" }
138<- { "return": {} }
139
82a56f0d
LC
140cont
141----
142
143Resume emulation.
144
145Arguments: None.
146
147Example:
148
149-> { "execute": "cont" }
150<- { "return": {} }
9b9df25a 151
9b9df25a
GH
152system_wakeup
153-------------
154
155Wakeup guest from suspend.
156
157Arguments: None.
158
159Example:
160
161-> { "execute": "system_wakeup" }
162<- { "return": {} }
82a56f0d 163
82a56f0d
LC
164system_reset
165------------
166
167Reset the system.
168
169Arguments: None.
170
171Example:
172
173-> { "execute": "system_reset" }
174<- { "return": {} }
175
82a56f0d
LC
176system_powerdown
177----------------
178
179Send system power down event.
180
181Arguments: None.
182
183Example:
184
185-> { "execute": "system_powerdown" }
186<- { "return": {} }
187
82a56f0d
LC
188device_add
189----------
190
191Add a device.
192
193Arguments:
194
195- "driver": the name of the new device's driver (json-string)
196- "bus": the device's parent bus (device tree path, json-string, optional)
197- "id": the device's ID, must be unique (json-string)
198- device properties
199
200Example:
201
202-> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
203<- { "return": {} }
204
205Notes:
206
207(1) For detailed information about this command, please refer to the
208 'docs/qdev-device-use.txt' file.
209
210(2) It's possible to list device properties by running QEMU with the
211 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
212
82a56f0d
LC
213device_del
214----------
215
216Remove a device.
217
218Arguments:
219
6287d827 220- "id": the device's ID or QOM path (json-string)
82a56f0d
LC
221
222Example:
223
224-> { "execute": "device_del", "arguments": { "id": "net1" } }
225<- { "return": {} }
226
6287d827
DB
227Example:
228
229-> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
230<- { "return": {} }
231
e4c8f004
AK
232send-key
233----------
234
235Send keys to VM.
236
237Arguments:
238
239keys array:
f9b1d9b2
AK
240 - "key": key sequence (a json-array of key union values,
241 union can be number or qcode enum)
e4c8f004
AK
242
243- hold-time: time to delay key up events, milliseconds. Defaults to 100
244 (json-int, optional)
245
246Example:
247
248-> { "execute": "send-key",
f9b1d9b2
AK
249 "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
250 { "type": "qcode", "data": "alt" },
251 { "type": "qcode", "data": "delete" } ] } }
e4c8f004
AK
252<- { "return": {} }
253
82a56f0d
LC
254cpu
255---
256
257Set the default CPU.
258
259Arguments:
260
261- "index": the CPU's index (json-int)
262
263Example:
264
265-> { "execute": "cpu", "arguments": { "index": 0 } }
266<- { "return": {} }
267
268Note: CPUs' indexes are obtained with the 'query-cpus' command.
269
69ca3ea5
IM
270cpu-add
271-------
272
273Adds virtual cpu
274
275Arguments:
276
277- "id": cpu id (json-int)
278
279Example:
280
281-> { "execute": "cpu-add", "arguments": { "id": 2 } }
282<- { "return": {} }
283
82a56f0d
LC
284memsave
285-------
286
287Save to disk virtual memory dump starting at 'val' of size 'size'.
288
289Arguments:
290
291- "val": the starting address (json-int)
292- "size": the memory size, in bytes (json-int)
293- "filename": file path (json-string)
0cfd6a9a 294- "cpu": virtual CPU index (json-int, optional)
82a56f0d
LC
295
296Example:
297
298-> { "execute": "memsave",
299 "arguments": { "val": 10,
300 "size": 100,
301 "filename": "/tmp/virtual-mem-dump" } }
302<- { "return": {} }
303
82a56f0d
LC
304pmemsave
305--------
306
307Save to disk physical memory dump starting at 'val' of size 'size'.
308
309Arguments:
310
311- "val": the starting address (json-int)
312- "size": the memory size, in bytes (json-int)
313- "filename": file path (json-string)
314
315Example:
316
317-> { "execute": "pmemsave",
318 "arguments": { "val": 10,
319 "size": 100,
320 "filename": "/tmp/physical-mem-dump" } }
321<- { "return": {} }
322
a4046664
LJ
323inject-nmi
324----------
325
9cb805fd 326Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64).
a4046664
LJ
327
328Arguments: None.
329
330Example:
331
332-> { "execute": "inject-nmi" }
333<- { "return": {} }
334
de253f14 335Note: inject-nmi fails when the guest doesn't support injecting.
a4046664 336
3949e594 337ringbuf-write
1f590cf9
LL
338-------------
339
3949e594 340Write to a ring buffer character device.
1f590cf9
LL
341
342Arguments:
343
3949e594
MA
344- "device": ring buffer character device name (json-string)
345- "data": data to write (json-string)
346- "format": data format (json-string, optional)
347 - Possible values: "utf8" (default), "base64"
1f590cf9
LL
348
349Example:
350
3949e594
MA
351-> { "execute": "ringbuf-write",
352 "arguments": { "device": "foo",
1f590cf9
LL
353 "data": "abcdefgh",
354 "format": "utf8" } }
355<- { "return": {} }
356
3949e594 357ringbuf-read
49b6d722
LL
358-------------
359
3949e594 360Read from a ring buffer character device.
49b6d722
LL
361
362Arguments:
363
3949e594
MA
364- "device": ring buffer character device name (json-string)
365- "size": how many bytes to read at most (json-int)
366 - Number of data bytes, not number of characters in encoded data
367- "format": data format (json-string, optional)
368 - Possible values: "utf8" (default), "base64"
369 - Naturally, format "utf8" works only when the ring buffer
370 contains valid UTF-8 text. Invalid UTF-8 sequences get
371 replaced. Bug: replacement doesn't work. Bug: can screw
372 up on encountering NUL characters, after the ring buffer
373 lost data, and when reading stops because the size limit
374 is reached.
49b6d722
LL
375
376Example:
377
3949e594
MA
378-> { "execute": "ringbuf-read",
379 "arguments": { "device": "foo",
49b6d722
LL
380 "size": 1000,
381 "format": "utf8" } }
3ab651fc 382<- {"return": "abcdefgh"}
49b6d722 383
a7ae8355
SS
384xen-save-devices-state
385-------
386
387Save the state of all devices to file. The RAM and the block devices
388of the VM are not saved by this command.
389
390Arguments:
391
392- "filename": the file to save the state of the devices to as binary
393data. See xen-save-devices-state.txt for a description of the binary
394format.
395
396Example:
397
398-> { "execute": "xen-save-devices-state",
399 "arguments": { "filename": "/tmp/save" } }
400<- { "return": {} }
401
88c16567
WC
402xen-load-devices-state
403----------------------
404
405Load the state of all devices from file. The RAM and the block devices
406of the VM are not loaded by this command.
407
408Arguments:
409
410- "filename": the file to load the state of the devices from as binary
411data. See xen-save-devices-state.txt for a description of the binary
412format.
413
414Example:
415
416-> { "execute": "xen-load-devices-state",
417 "arguments": { "filename": "/tmp/resume" } }
418<- { "return": {} }
419
39f42439
AP
420xen-set-global-dirty-log
421-------
422
423Enable or disable the global dirty log mode.
424
425Arguments:
426
427- "enable": Enable it or disable it.
428
429Example:
430
431-> { "execute": "xen-set-global-dirty-log",
432 "arguments": { "enable": true } }
433<- { "return": {} }
434
82a56f0d
LC
435migrate
436-------
437
438Migrate to URI.
439
440Arguments:
441
442- "blk": block migration, full disk copy (json-bool, optional)
443- "inc": incremental disk copy (json-bool, optional)
444- "uri": Destination URI (json-string)
445
446Example:
447
448-> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
449<- { "return": {} }
450
451Notes:
452
453(1) The 'query-migrate' command should be used to check migration's progress
454 and final result (this information is provided by the 'status' member)
455(2) All boolean arguments default to false
456(3) The user Monitor's "detach" argument is invalid in QMP and should not
457 be used
458
82a56f0d
LC
459migrate_cancel
460--------------
461
462Cancel the current migration.
463
464Arguments: None.
465
466Example:
467
468-> { "execute": "migrate_cancel" }
469<- { "return": {} }
470
bf1ae1f4
DDAG
471migrate-incoming
472----------------
473
474Continue an incoming migration
475
476Arguments:
477
478- "uri": Source/listening URI (json-string)
479
480Example:
481
482-> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } }
483<- { "return": {} }
484
485Notes:
486
487(1) QEMU must be started with -incoming defer to allow migrate-incoming to
488 be used
4aab6282 489(2) The uri format is the same as for -incoming
bf1ae1f4 490
9e1ba4cc 491migrate-set-cache-size
817c6045 492----------------------
9e1ba4cc
OW
493
494Set cache size to be used by XBZRLE migration, the cache size will be rounded
495down to the nearest power of 2
496
497Arguments:
498
499- "value": cache size in bytes (json-int)
500
501Example:
502
503-> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } }
504<- { "return": {} }
505
4886a1bc
DDAG
506migrate-start-postcopy
507----------------------
508
509Switch an in-progress migration to postcopy mode. Ignored after the end of
510migration (or once already in postcopy).
511
512Example:
513-> { "execute": "migrate-start-postcopy" }
514<- { "return": {} }
515
9e1ba4cc 516query-migrate-cache-size
817c6045 517------------------------
9e1ba4cc
OW
518
519Show cache size to be used by XBZRLE migration
520
521returns a json-object with the following information:
522- "size" : json-int
523
524Example:
525
526-> { "execute": "query-migrate-cache-size" }
527<- { "return": 67108864 }
528
ff73edf5
JS
529migrate_set_speed
530-----------------
e866e239 531
ff73edf5 532Set maximum speed for migrations.
e866e239
GH
533
534Arguments:
535
ff73edf5 536- "value": maximum speed, in bytes per second (json-int)
e866e239
GH
537
538Example:
539
ff73edf5 540-> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
e866e239
GH
541<- { "return": {} }
542
ff73edf5
JS
543migrate_set_downtime
544--------------------
82a56f0d 545
ff73edf5 546Set maximum tolerated downtime (in seconds) for migrations.
82a56f0d
LC
547
548Arguments:
549
ff73edf5 550- "value": maximum downtime (json-number)
82a56f0d
LC
551
552Example:
553
ff73edf5 554-> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
82a56f0d
LC
555<- { "return": {} }
556
d89e666e
HZ
557x-colo-lost-heartbeat
558--------------------
559
560Tell COLO that heartbeat is lost, a failover or takeover is needed.
561
562Example:
563
564-> { "execute": "x-colo-lost-heartbeat" }
565<- { "return": {} }
566
ff73edf5 567client_migrate_info
13cadefb 568-------------------
82a56f0d 569
13cadefb
MA
570Set migration information for remote display. This makes the server
571ask the client to automatically reconnect using the new parameters
572once migration finished successfully. Only implemented for SPICE.
82a56f0d
LC
573
574Arguments:
575
13cadefb 576- "protocol": must be "spice" (json-string)
ff73edf5 577- "hostname": migration target hostname (json-string)
13cadefb 578- "port": spice tcp port for plaintext channels (json-int, optional)
ff73edf5
JS
579- "tls-port": spice tcp port for tls-secured channels (json-int, optional)
580- "cert-subject": server certificate subject (json-string, optional)
82a56f0d
LC
581
582Example:
583
ff73edf5
JS
584-> { "execute": "client_migrate_info",
585 "arguments": { "protocol": "spice",
586 "hostname": "virt42.lab.kraxel.org",
587 "port": 1234 } }
82a56f0d
LC
588<- { "return": {} }
589
783e9b48
WC
590dump
591
592
593Dump guest memory to file. The file can be processed with crash or gdb.
594
595Arguments:
596
597- "paging": do paging to get guest's memory mapping (json-bool)
598- "protocol": destination file(started with "file:") or destination file
599 descriptor (started with "fd:") (json-string)
228de9cf 600- "detach": if specified, command will return immediately, without waiting
39ba2ea6
PX
601 for the dump to finish. The user can track progress using
602 "query-dump". (json-bool)
783e9b48
WC
603- "begin": the starting physical address. It's optional, and should be specified
604 with length together (json-int)
605- "length": the memory size, in bytes. It's optional, and should be specified
606 with begin together (json-int)
b53ccc30
QN
607- "format": the format of guest memory dump. It's optional, and can be
608 elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will
609 conflict with paging and filter, ie. begin and length (json-string)
783e9b48
WC
610
611Example:
612
613-> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } }
614<- { "return": {} }
615
616Notes:
617
618(1) All boolean arguments default to false
619
7d6dc7f3
QN
620query-dump-guest-memory-capability
621----------
622
623Show available formats for 'dump-guest-memory'
624
625Example:
626
627-> { "execute": "query-dump-guest-memory-capability" }
628<- { "return": { "formats":
629 ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
630
39ba2ea6
PX
631query-dump
632----------
633
634Query background dump status.
635
636Arguments: None.
637
638Example:
639
640-> { "execute": "query-dump" }
641<- { "return": { "status": "active", "completed": 1024000,
642 "total": 2048000 } }
643
7ee0c3e3
JH
644dump-skeys
645----------
646
647Save guest storage keys to file.
648
649Arguments:
650
651- "filename": file path (json-string)
652
653Example:
654
655-> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } }
656<- { "return": {} }
657
82a56f0d
LC
658netdev_add
659----------
660
661Add host network device.
662
663Arguments:
664
665- "type": the device type, "tap", "user", ... (json-string)
666- "id": the device's ID, must be unique (json-string)
667- device options
668
669Example:
670
b8a98326
MA
671-> { "execute": "netdev_add",
672 "arguments": { "type": "user", "id": "netdev1",
673 "dnssearch": "example.org" } }
82a56f0d
LC
674<- { "return": {} }
675
af347aa5 676Note: The supported device options are the same ones supported by the '-netdev'
82a56f0d
LC
677 command-line argument, which are listed in the '-help' output or QEMU's
678 manual
679
82a56f0d
LC
680netdev_del
681----------
682
683Remove host network device.
684
685Arguments:
686
687- "id": the device's ID, must be unique (json-string)
688
689Example:
690
691-> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
692<- { "return": {} }
693
6d4a2b3a 694
cff8b2c6
PB
695object-add
696----------
697
698Create QOM object.
699
700Arguments:
701
702- "qom-type": the object's QOM type, i.e. the class name (json-string)
703- "id": the object's ID, must be unique (json-string)
704- "props": a dictionary of object property values (optional, json-dict)
705
706Example:
707
708-> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1",
709 "props": { "filename": "/dev/hwrng" } } }
710<- { "return": {} }
711
ab2d0531
PB
712object-del
713----------
714
715Remove QOM object.
716
717Arguments:
718
719- "id": the object's ID (json-string)
720
721Example:
722
723-> { "execute": "object-del", "arguments": { "id": "rng1" } }
724<- { "return": {} }
725
726
6d4a2b3a
CH
727block_resize
728------------
729
730Resize a block image while a guest is running.
731
732Arguments:
733
734- "device": the device's ID, must be unique (json-string)
3b1dbd11 735- "node-name": the node name in the block driver state graph (json-string)
6d4a2b3a
CH
736- "size": new size
737
738Example:
739
740-> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } }
741<- { "return": {} }
742
ec683d60
SH
743block-stream
744------------
745
746Copy data from a backing file into a block device.
747
748Arguments:
749
2323322e
AG
750- "job-id": Identifier for the newly-created block job. If omitted,
751 the device name will be used. (json-string, optional)
b6c1bae5 752- "device": The device name or node-name of a root node (json-string)
ec683d60
SH
753- "base": The file name of the backing image above which copying starts
754 (json-string, optional)
755- "backing-file": The backing file string to write into the active layer. This
756 filename is not validated.
757
758 If a pathname string is such that it cannot be resolved by
759 QEMU, that means that subsequent QMP or HMP commands must use
760 node-names for the image in question, as filename lookup
761 methods will fail.
762
763 If not specified, QEMU will automatically determine the
764 backing file string to use, or error out if there is no
765 obvious choice. Care should be taken when specifying the
766 string, to specify a valid filename or protocol.
767 (json-string, optional) (Since 2.1)
768- "speed": the maximum speed, in bytes per second (json-int, optional)
769- "on-error": the action to take on an error (default 'report'). 'stop' and
770 'enospc' can only be used if the block device supports io-status.
771 (json-string, optional) (Since 2.1)
772
773Example:
774
775-> { "execute": "block-stream", "arguments": { "device": "virtio0",
776 "base": "/tmp/master.qcow2" } }
777<- { "return": {} }
778
37222900
JC
779block-commit
780------------
781
782Live commit of data from overlay image nodes into backing nodes - i.e., writes
783data between 'top' and 'base' into 'base'.
784
785Arguments:
786
fd62c609
AG
787- "job-id": Identifier for the newly-created block job. If omitted,
788 the device name will be used. (json-string, optional)
1d13b167 789- "device": The device name or node-name of a root node (json-string)
37222900
JC
790- "base": The file name of the backing image to write data into.
791 If not specified, this is the deepest backing image
792 (json-string, optional)
793- "top": The file name of the backing image within the image chain,
7676e2c5
JC
794 which contains the topmost data to be committed down. If
795 not specified, this is the active layer. (json-string, optional)
37222900 796
54e26900
JC
797- backing-file: The backing file string to write into the overlay
798 image of 'top'. If 'top' is the active layer,
799 specifying a backing file string is an error. This
800 filename is not validated.
801
802 If a pathname string is such that it cannot be
803 resolved by QEMU, that means that subsequent QMP or
804 HMP commands must use node-names for the image in
805 question, as filename lookup methods will fail.
806
807 If not specified, QEMU will automatically determine
808 the backing file string to use, or error out if
809 there is no obvious choice. Care should be taken
810 when specifying the string, to specify a valid
811 filename or protocol.
812 (json-string, optional) (Since 2.1)
813
37222900
JC
814 If top == base, that is an error.
815 If top == active, the job will not be completed by itself,
816 user needs to complete the job with the block-job-complete
817 command after getting the ready event. (Since 2.0)
818
819 If the base image is smaller than top, then the base image
820 will be resized to be the same size as top. If top is
821 smaller than the base image, the base will not be
822 truncated. If you want the base image size to match the
823 size of the smaller top, you can safely truncate it
824 yourself once the commit operation successfully completes.
825 (json-string)
826- "speed": the maximum speed, in bytes per second (json-int, optional)
827
828
829Example:
830
831-> { "execute": "block-commit", "arguments": { "device": "virtio0",
832 "top": "/tmp/snap1.qcow2" } }
833<- { "return": {} }
834
99a9addf
SH
835drive-backup
836------------
837
838Start a point-in-time copy of a block device to a new destination. The
839status of ongoing drive-backup operations can be checked with
840query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
841The operation can be stopped before it has completed using the
842block-job-cancel command.
843
844Arguments:
845
70559d49
AG
846- "job-id": Identifier for the newly-created block job. If omitted,
847 the device name will be used. (json-string, optional)
b7e4fa22 848- "device": the device name or node-name of a root node which should be copied.
99a9addf
SH
849 (json-string)
850- "target": the target of the new image. If the file exists, or if it is a
851 device, the existing file/device will be used as the new
852 destination. If it does not exist, a new file will be created.
853 (json-string)
854- "format": the format of the new destination, default is to probe if 'mode' is
855 'existing', else the format of the source
856 (json-string, optional)
b53169ea
SH
857- "sync": what parts of the disk image should be copied to the destination;
858 possibilities include "full" for all the disk, "top" for only the sectors
4b80ab2b 859 allocated in the topmost image, "incremental" for only the dirty sectors in
d58d8453 860 the bitmap, or "none" to only replicate new I/O (MirrorSyncMode).
4b80ab2b
JS
861- "bitmap": dirty bitmap name for sync==incremental. Must be present if sync
862 is "incremental", must NOT be present otherwise.
99a9addf
SH
863- "mode": whether and how QEMU should create a new image
864 (NewImageMode, optional, default 'absolute-paths')
865- "speed": the maximum speed, in bytes per second (json-int, optional)
13b9414b
PB
866- "compress": true to compress data, if the target format supports it.
867 (json-bool, optional, default false)
99a9addf
SH
868- "on-source-error": the action to take on an error on the source, default
869 'report'. 'stop' and 'enospc' can only be used
870 if the block device supports io-status.
871 (BlockdevOnError, optional)
872- "on-target-error": the action to take on an error on the target, default
873 'report' (no limitations, since this applies to
874 a different block device than device).
875 (BlockdevOnError, optional)
876
877Example:
878-> { "execute": "drive-backup", "arguments": { "device": "drive0",
fc5d3f84 879 "sync": "full",
99a9addf
SH
880 "target": "backup.img" } }
881<- { "return": {} }
c29c1dd3 882
c29c1dd3
FZ
883blockdev-backup
884---------------
885
886The device version of drive-backup: this command takes an existing named device
887as backup target.
888
889Arguments:
890
70559d49
AG
891- "job-id": Identifier for the newly-created block job. If omitted,
892 the device name will be used. (json-string, optional)
cef34eeb 893- "device": the device name or node-name of a root node which should be copied.
c29c1dd3
FZ
894 (json-string)
895- "target": the name of the backup target device. (json-string)
896- "sync": what parts of the disk image should be copied to the destination;
897 possibilities include "full" for all the disk, "top" for only the
898 sectors allocated in the topmost image, or "none" to only replicate
899 new I/O (MirrorSyncMode).
900- "speed": the maximum speed, in bytes per second (json-int, optional)
3b7b1236
PB
901- "compress": true to compress data, if the target format supports it.
902 (json-bool, optional, default false)
c29c1dd3
FZ
903- "on-source-error": the action to take on an error on the source, default
904 'report'. 'stop' and 'enospc' can only be used
905 if the block device supports io-status.
906 (BlockdevOnError, optional)
907- "on-target-error": the action to take on an error on the target, default
908 'report' (no limitations, since this applies to
909 a different block device than device).
910 (BlockdevOnError, optional)
911
912Example:
913-> { "execute": "blockdev-backup", "arguments": { "device": "src-id",
914 "sync": "full",
915 "target": "tgt-id" } }
916<- { "return": {} }
917
52e7c241
PB
918transaction
919-----------
c186402c 920
a910523a
KC
921Atomically operate on one or more block devices. Operations that are
922currently supported:
923
924 - drive-backup
925 - blockdev-backup
926 - blockdev-snapshot-sync
927 - blockdev-snapshot-internal-sync
928 - abort
929 - block-dirty-bitmap-add
930 - block-dirty-bitmap-clear
931
932Refer to the qemu/qapi-schema.json file for minimum required QEMU
933versions for these operations. A list of dictionaries is accepted,
934that contains the actions to be performed. If there is any failure
935performing any of the operations, all operations for the group are
936abandoned.
c186402c 937
bbe86010
WX
938For external snapshots, the dictionary contains the device, the file to use for
939the new snapshot, and the format. The default format, if not specified, is
940qcow2.
c186402c 941
bc8b094f
PB
942Each new snapshot defaults to being created by QEMU (wiping any
943contents if the file already exists), but it is also possible to reuse
944an externally-created file. In the latter case, you should ensure that
945the new image file has the same contents as the current one; QEMU cannot
946perform any meaningful check. Typically this is achieved by using the
947current image file as the backing file for the new image.
948
bbe86010
WX
949On failure, the original disks pre-snapshot attempt will be used.
950
951For internal snapshots, the dictionary contains the device and the snapshot's
952name. If an internal snapshot matching name already exists, the request will
953be rejected. Only some image formats support it, for example, qcow2, rbd,
954and sheepdog.
955
956On failure, qemu will try delete the newly created internal snapshot in the
957transaction. When an I/O error occurs during deletion, the user needs to fix
958it later with qemu-img or other command.
959
c186402c
JC
960Arguments:
961
52e7c241 962actions array:
a910523a
KC
963 - "type": the operation to perform (json-string). Possible
964 values: "drive-backup", "blockdev-backup",
965 "blockdev-snapshot-sync",
966 "blockdev-snapshot-internal-sync",
967 "abort", "block-dirty-bitmap-add",
968 "block-dirty-bitmap-clear"
52e7c241
PB
969 - "data": a dictionary. The contents depend on the value
970 of "type". When "type" is "blockdev-snapshot-sync":
971 - "device": device name to snapshot (json-string)
0901f67e 972 - "node-name": graph node name to snapshot (json-string)
52e7c241 973 - "snapshot-file": name of new image file (json-string)
0901f67e 974 - "snapshot-node-name": graph node name of the new snapshot (json-string)
52e7c241 975 - "format": format of new image (json-string, optional)
bc8b094f
PB
976 - "mode": whether and how QEMU should create the snapshot file
977 (NewImageMode, optional, default "absolute-paths")
bbe86010 978 When "type" is "blockdev-snapshot-internal-sync":
75dfd402
KW
979 - "device": the device name or node-name of a root node to snapshot
980 (json-string)
bbe86010 981 - "name": name of the new snapshot (json-string)
c186402c
JC
982
983Example:
984
52e7c241
PB
985-> { "execute": "transaction",
986 "arguments": { "actions": [
cd0c5389 987 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
52e7c241
PB
988 "snapshot-file": "/some/place/my-image",
989 "format": "qcow2" } },
cd0c5389 990 { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
0901f67e
BC
991 "snapshot-file": "/some/place/my-image2",
992 "snapshot-node-name": "node3432",
993 "mode": "existing",
994 "format": "qcow2" } },
cd0c5389 995 { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
52e7c241 996 "snapshot-file": "/some/place/my-image2",
bc8b094f 997 "mode": "existing",
bbe86010 998 "format": "qcow2" } },
cd0c5389 999 { "type": "blockdev-snapshot-internal-sync", "data" : {
bbe86010
WX
1000 "device": "ide-hd2",
1001 "name": "snapshot0" } } ] } }
c186402c
JC
1002<- { "return": {} }
1003
341ebc2f
JS
1004block-dirty-bitmap-add
1005----------------------
1006Since 2.4
1007
1008Create a dirty bitmap with a name on the device, and start tracking the writes.
1009
1010Arguments:
1011
1012- "node": device/node on which to create dirty bitmap (json-string)
1013- "name": name of the new dirty bitmap (json-string)
1014- "granularity": granularity to track writes with (int, optional)
1015
1016Example:
1017
1018-> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0",
1019 "name": "bitmap0" } }
1020<- { "return": {} }
1021
341ebc2f
JS
1022block-dirty-bitmap-remove
1023-------------------------
1024Since 2.4
1025
1026Stop write tracking and remove the dirty bitmap that was created with
1027block-dirty-bitmap-add.
1028
1029Arguments:
1030
1031- "node": device/node on which to remove dirty bitmap (json-string)
1032- "name": name of the dirty bitmap to remove (json-string)
1033
1034Example:
1035
1036-> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0",
1037 "name": "bitmap0" } }
1038<- { "return": {} }
1039
e74e6b78
JS
1040block-dirty-bitmap-clear
1041------------------------
1042Since 2.4
1043
1044Reset the dirty bitmap associated with a node so that an incremental backup
1045from this point in time forward will only backup clusters modified after this
1046clear operation.
1047
1048Arguments:
1049
1050- "node": device/node on which to remove dirty bitmap (json-string)
1051- "name": name of the dirty bitmap to remove (json-string)
1052
1053Example:
1054
1055-> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0",
1056 "name": "bitmap0" } }
1057<- { "return": {} }
1058
d967b2f1
JS
1059blockdev-snapshot-sync
1060----------------------
1061
1062Synchronous snapshot of a block device. snapshot-file specifies the
1063target of the new image. If the file exists, or if it is a device, the
1064snapshot will be created in the existing file/device. If does not
1065exist, a new file will be created. format specifies the format of the
1066snapshot image, default is qcow2.
1067
1068Arguments:
1069
1070- "device": device name to snapshot (json-string)
0901f67e 1071- "node-name": graph node name to snapshot (json-string)
d967b2f1 1072- "snapshot-file": name of new image file (json-string)
0901f67e 1073- "snapshot-node-name": graph node name of the new snapshot (json-string)
6cc2a415
PB
1074- "mode": whether and how QEMU should create the snapshot file
1075 (NewImageMode, optional, default "absolute-paths")
d967b2f1
JS
1076- "format": format of new image (json-string, optional)
1077
1078Example:
1079
7f3850c2
LC
1080-> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0",
1081 "snapshot-file":
1082 "/some/place/my-image",
1083 "format": "qcow2" } }
d967b2f1
JS
1084<- { "return": {} }
1085
43de7e2d
AG
1086blockdev-snapshot
1087-----------------
1088Since 2.5
1089
1090Create a snapshot, by installing 'node' as the backing image of
1091'overlay'. Additionally, if 'node' is associated with a block
1092device, the block device changes to using 'overlay' as its new active
1093image.
1094
1095Arguments:
1096
1097- "node": device that will have a snapshot created (json-string)
1098- "overlay": device that will have 'node' as its backing image (json-string)
1099
1100Example:
1101
1102-> { "execute": "blockdev-add",
0153d2f5
KW
1103 "arguments": { "driver": "qcow2",
1104 "node-name": "node1534",
1105 "file": { "driver": "file",
1106 "filename": "hd1.qcow2" },
1107 "backing": "" } }
43de7e2d
AG
1108
1109<- { "return": {} }
1110
1111-> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0",
1112 "overlay": "node1534" } }
1113<- { "return": {} }
1114
f323bc9e
WX
1115blockdev-snapshot-internal-sync
1116-------------------------------
1117
1118Synchronously take an internal snapshot of a block device when the format of
1119image used supports it. If the name is an empty string, or a snapshot with
1120name already exists, the operation will fail.
1121
1122Arguments:
1123
75dfd402
KW
1124- "device": the device name or node-name of a root node to snapshot
1125 (json-string)
f323bc9e
WX
1126- "name": name of the new snapshot (json-string)
1127
1128Example:
1129
1130-> { "execute": "blockdev-snapshot-internal-sync",
1131 "arguments": { "device": "ide-hd0",
1132 "name": "snapshot0" }
1133 }
1134<- { "return": {} }
1135
44e3e053
WX
1136blockdev-snapshot-delete-internal-sync
1137--------------------------------------
1138
1139Synchronously delete an internal snapshot of a block device when the format of
1140image used supports it. The snapshot is identified by name or id or both. One
1141of name or id is required. If the snapshot is not found, the operation will
1142fail.
1143
1144Arguments:
1145
2dfb4c03 1146- "device": the device name or node-name of a root node (json-string)
44e3e053
WX
1147- "id": ID of the snapshot (json-string, optional)
1148- "name": name of the snapshot (json-string, optional)
1149
1150Example:
1151
1152-> { "execute": "blockdev-snapshot-delete-internal-sync",
1153 "arguments": { "device": "ide-hd0",
1154 "name": "snapshot0" }
1155 }
1156<- { "return": {
1157 "id": "1",
1158 "name": "snapshot0",
1159 "vm-state-size": 0,
1160 "date-sec": 1000012,
1161 "date-nsec": 10,
1162 "vm-clock-sec": 100,
1163 "vm-clock-nsec": 20
1164 }
1165 }
1166
d9b902db
PB
1167drive-mirror
1168------------
1169
1170Start mirroring a block device's writes to a new destination. target
1171specifies the target of the new image. If the file exists, or if it is
1172a device, it will be used as the new destination for writes. If it does not
1173exist, a new file will be created. format specifies the format of the
1174mirror image, default is to probe if mode='existing', else the format
1175of the source.
1176
1177Arguments:
1178
71aa9867
AG
1179- "job-id": Identifier for the newly-created block job. If omitted,
1180 the device name will be used. (json-string, optional)
0524e93a
KW
1181- "device": the device name or node-name of a root node whose writes should be
1182 mirrored. (json-string)
d9b902db
PB
1183- "target": name of new image file (json-string)
1184- "format": format of new image (json-string, optional)
4c828dc6
BC
1185- "node-name": the name of the new block driver state in the node graph
1186 (json-string, optional)
09158f00
BC
1187- "replaces": the block driver node name to replace when finished
1188 (json-string, optional)
d9b902db
PB
1189- "mode": how an image file should be created into the target
1190 file/device (NewImageMode, optional, default 'absolute-paths')
1191- "speed": maximum speed of the streaming job, in bytes per second
1192 (json-int)
eee13dfe 1193- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
df92562e 1194- "buf-size": maximum amount of data in flight from source to target, in bytes
08e4ed6c 1195 (json-int, default 10M)
d9b902db
PB
1196- "sync": what parts of the disk image should be copied to the destination;
1197 possibilities include "full" for all the disk, "top" for only the sectors
1198 allocated in the topmost image, or "none" to only replicate new I/O
1199 (MirrorSyncMode).
b952b558
PB
1200- "on-source-error": the action to take on an error on the source
1201 (BlockdevOnError, default 'report')
1202- "on-target-error": the action to take on an error on the target
1203 (BlockdevOnError, default 'report')
0fc9f8ea
FZ
1204- "unmap": whether the target sectors should be discarded where source has only
1205 zeroes. (json-bool, optional, default true)
b952b558 1206
eee13dfe
PB
1207The default value of the granularity is the image cluster size clamped
1208between 4096 and 65536, if the image format defines one. If the format
1209does not define a cluster size, the default value of the granularity
1210is 65536.
d9b902db
PB
1211
1212
1213Example:
1214
1215-> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0",
1216 "target": "/some/place/my-image",
1217 "sync": "full",
1218 "format": "qcow2" } }
1219<- { "return": {} }
1220
df92562e
FZ
1221blockdev-mirror
1222------------
1223
1224Start mirroring a block device's writes to another block device. target
1225specifies the target of mirror operation.
1226
1227Arguments:
1228
71aa9867
AG
1229- "job-id": Identifier for the newly-created block job. If omitted,
1230 the device name will be used. (json-string, optional)
07eec652
KW
1231- "device": The device name or node-name of a root node whose writes should be
1232 mirrored (json-string)
df92562e
FZ
1233- "target": device name to mirror to (json-string)
1234- "replaces": the block driver node name to replace when finished
1235 (json-string, optional)
1236- "speed": maximum speed of the streaming job, in bytes per second
1237 (json-int)
1238- "granularity": granularity of the dirty bitmap, in bytes (json-int, optional)
1239- "buf_size": maximum amount of data in flight from source to target, in bytes
1240 (json-int, default 10M)
1241- "sync": what parts of the disk image should be copied to the destination;
1242 possibilities include "full" for all the disk, "top" for only the sectors
1243 allocated in the topmost image, or "none" to only replicate new I/O
1244 (MirrorSyncMode).
1245- "on-source-error": the action to take on an error on the source
1246 (BlockdevOnError, default 'report')
1247- "on-target-error": the action to take on an error on the target
1248 (BlockdevOnError, default 'report')
1249
1250The default value of the granularity is the image cluster size clamped
1251between 4096 and 65536, if the image format defines one. If the format
1252does not define a cluster size, the default value of the granularity
1253is 65536.
1254
1255Example:
1256
1257-> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0",
1258 "target": "target0",
1259 "sync": "full" } }
1260<- { "return": {} }
1261
fa40e656
JC
1262change-backing-file
1263-------------------
1264Since: 2.1
1265
1266Change the backing file in the image file metadata. This does not cause
1267QEMU to reopen the image file to reparse the backing filename (it may,
1268however, perform a reopen to change permissions from r/o -> r/w -> r/o,
1269if needed). The new backing file string is written into the image file
1270metadata, and the QEMU internal strings are updated.
1271
1272Arguments:
1273
1274- "image-node-name": The name of the block driver state node of the
1275 image to modify. The "device" is argument is used to
1276 verify "image-node-name" is in the chain described by
1277 "device".
1278 (json-string, optional)
1279
7b5dca3f
KW
1280- "device": The device name or node-name of the root node that owns
1281 image-node-name.
fa40e656
JC
1282 (json-string)
1283
1284- "backing-file": The string to write as the backing file. This string is
1285 not validated, so care should be taken when specifying
1286 the string or the image chain may not be able to be
1287 reopened again.
1288 (json-string)
1289
1290Returns: Nothing on success
1291 If "device" does not exist or cannot be determined, DeviceNotFound
1292
82a56f0d
LC
1293balloon
1294-------
1295
1296Request VM to change its memory allocation (in bytes).
1297
1298Arguments:
1299
1300- "value": New memory allocation (json-int)
1301
1302Example:
1303
1304-> { "execute": "balloon", "arguments": { "value": 536870912 } }
1305<- { "return": {} }
1306
82a56f0d
LC
1307set_link
1308--------
1309
1310Change the link status of a network adapter.
1311
1312Arguments:
1313
1314- "name": network device name (json-string)
1315- "up": status is up (json-bool)
1316
1317Example:
1318
1319-> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } }
1320<- { "return": {} }
1321
82a56f0d
LC
1322getfd
1323-----
1324
1325Receive a file descriptor via SCM rights and assign it a name.
1326
1327Arguments:
1328
1329- "fdname": file descriptor name (json-string)
1330
1331Example:
1332
1333-> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1334<- { "return": {} }
1335
208c9d1b
CB
1336Notes:
1337
1338(1) If the name specified by the "fdname" argument already exists,
1339 the file descriptor assigned to it will be closed and replaced
1340 by the received file descriptor.
1341(2) The 'closefd' command can be used to explicitly close the file
1342 descriptor when it is no longer needed.
1343
82a56f0d
LC
1344closefd
1345-------
1346
1347Close a file descriptor previously passed via SCM rights.
1348
1349Arguments:
1350
1351- "fdname": file descriptor name (json-string)
1352
1353Example:
1354
1355-> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1356<- { "return": {} }
1357
ba1c048a
CB
1358add-fd
1359-------
1360
1361Add a file descriptor, that was passed via SCM rights, to an fd set.
1362
1363Arguments:
1364
1365- "fdset-id": The ID of the fd set to add the file descriptor to.
1366 (json-int, optional)
1367- "opaque": A free-form string that can be used to describe the fd.
1368 (json-string, optional)
1369
1370Return a json-object with the following information:
1371
1372- "fdset-id": The ID of the fd set that the fd was added to. (json-int)
1373- "fd": The file descriptor that was received via SCM rights and added to the
1374 fd set. (json-int)
1375
1376Example:
1377
1378-> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
1379<- { "return": { "fdset-id": 1, "fd": 3 } }
1380
1381Notes:
1382
1383(1) The list of fd sets is shared by all monitor connections.
1384(2) If "fdset-id" is not specified, a new fd set will be created.
1385
ba1c048a
CB
1386remove-fd
1387---------
1388
1389Remove a file descriptor from an fd set.
1390
1391Arguments:
1392
1393- "fdset-id": The ID of the fd set that the file descriptor belongs to.
1394 (json-int)
1395- "fd": The file descriptor that is to be removed. (json-int, optional)
1396
1397Example:
1398
1399-> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
1400<- { "return": {} }
1401
1402Notes:
1403
1404(1) The list of fd sets is shared by all monitor connections.
1405(2) If "fd" is not specified, all file descriptors in "fdset-id" will be
1406 removed.
1407
ba1c048a
CB
1408query-fdsets
1409-------------
1410
1411Return information describing all fd sets.
1412
1413Arguments: None
1414
1415Example:
1416
1417-> { "execute": "query-fdsets" }
1418<- { "return": [
1419 {
1420 "fds": [
1421 {
1422 "fd": 30,
1423 "opaque": "rdonly:/path/to/file"
1424 },
1425 {
1426 "fd": 24,
1427 "opaque": "rdwr:/path/to/file"
1428 }
1429 ],
1430 "fdset-id": 1
1431 },
1432 {
1433 "fds": [
1434 {
1435 "fd": 28
1436 },
1437 {
1438 "fd": 29
1439 }
1440 ],
1441 "fdset-id": 0
1442 }
1443 ]
1444 }
1445
1446Note: The list of fd sets is shared by all monitor connections.
1447
82a56f0d
LC
1448block_passwd
1449------------
1450
1451Set the password of encrypted block devices.
1452
1453Arguments:
1454
1455- "device": device name (json-string)
12d3ba82 1456- "node-name": name in the block driver state graph (json-string)
82a56f0d
LC
1457- "password": password (json-string)
1458
1459Example:
1460
1461-> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0",
1462 "password": "12345" } }
1463<- { "return": {} }
1464
727f005e
ZYW
1465block_set_io_throttle
1466------------
1467
1468Change I/O throttle limits for a block drive.
1469
1470Arguments:
1471
7a9877a0
KW
1472- "device": block device name (deprecated, use @id instead)
1473 (json-string, optional)
1474- "id": the name or QOM path of the guest device (json-string, optional)
586b5466
EB
1475- "bps": total throughput limit in bytes per second (json-int)
1476- "bps_rd": read throughput limit in bytes per second (json-int)
1477- "bps_wr": write throughput limit in bytes per second (json-int)
1478- "iops": total I/O operations per second (json-int)
1479- "iops_rd": read I/O operations per second (json-int)
1480- "iops_wr": write I/O operations per second (json-int)
dce13204
AG
1481- "bps_max": total throughput limit during bursts, in bytes (json-int, optional)
1482- "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional)
1483- "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional)
1484- "iops_max": total I/O operations per second during bursts (json-int, optional)
1485- "iops_rd_max": read I/O operations per second during bursts (json-int, optional)
1486- "iops_wr_max": write I/O operations per second during bursts (json-int, optional)
1487- "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional)
1488- "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional)
1489- "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional)
1490- "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional)
1491- "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional)
1492- "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional)
1493- "iops_size": I/O size in bytes when limiting (json-int, optional)
1494- "group": throttle group name (json-string, optional)
727f005e
ZYW
1495
1496Example:
1497
7a9877a0 1498-> { "execute": "block_set_io_throttle", "arguments": { "id": "ide0-1-0",
586b5466
EB
1499 "bps": 1000000,
1500 "bps_rd": 0,
1501 "bps_wr": 0,
1502 "iops": 0,
1503 "iops_rd": 0,
3e9fab69
BC
1504 "iops_wr": 0,
1505 "bps_max": 8000000,
1506 "bps_rd_max": 0,
1507 "bps_wr_max": 0,
1508 "iops_max": 0,
1509 "iops_rd_max": 0,
2024c1df 1510 "iops_wr_max": 0,
dce13204 1511 "bps_max_length": 60,
2024c1df 1512 "iops_size": 0 } }
727f005e
ZYW
1513<- { "return": {} }
1514
7572150c
GH
1515set_password
1516------------
1517
1518Set the password for vnc/spice protocols.
1519
1520Arguments:
1521
1522- "protocol": protocol name (json-string)
1523- "password": password (json-string)
3599d46b 1524- "connected": [ keep | disconnect | fail ] (json-string, optional)
7572150c
GH
1525
1526Example:
1527
1528-> { "execute": "set_password", "arguments": { "protocol": "vnc",
1529 "password": "secret" } }
1530<- { "return": {} }
1531
7572150c
GH
1532expire_password
1533---------------
1534
1535Set the password expire time for vnc/spice protocols.
1536
1537Arguments:
1538
1539- "protocol": protocol name (json-string)
1540- "time": [ now | never | +secs | secs ] (json-string)
1541
1542Example:
1543
1544-> { "execute": "expire_password", "arguments": { "protocol": "vnc",
1545 "time": "+60" } }
1546<- { "return": {} }
1547
13661089
DB
1548add_client
1549----------
1550
1551Add a graphics client
1552
1553Arguments:
1554
1555- "protocol": protocol name (json-string)
1556- "fdname": file descriptor name (json-string)
f1f5f407
DB
1557- "skipauth": whether to skip authentication (json-bool, optional)
1558- "tls": whether to perform TLS (json-bool, optional)
13661089
DB
1559
1560Example:
1561
1562-> { "execute": "add_client", "arguments": { "protocol": "vnc",
1563 "fdname": "myclient" } }
1564<- { "return": {} }
1565
82a56f0d
LC
1566qmp_capabilities
1567----------------
1568
1569Enable QMP capabilities.
1570
1571Arguments: None.
1572
1573Example:
1574
1575-> { "execute": "qmp_capabilities" }
1576<- { "return": {} }
1577
1578Note: This command must be issued before issuing any other command.
1579
0268d97c
LC
1580human-monitor-command
1581---------------------
1582
1583Execute a Human Monitor command.
1584
bdf05133 1585Arguments:
0268d97c
LC
1586
1587- command-line: the command name and its arguments, just like the
1588 Human Monitor's shell (json-string)
1589- cpu-index: select the CPU number to be used by commands which access CPU
1590 data, like 'info registers'. The Monitor selects CPU 0 if this
1591 argument is not provided (json-int, optional)
1592
1593Example:
1594
1595-> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } }
1596<- { "return": "kvm support: enabled\r\n" }
1597
1598Notes:
1599
1600(1) The Human Monitor is NOT an stable interface, this means that command
1601 names, arguments and responses can change or be removed at ANY time.
1602 Applications that rely on long term stability guarantees should NOT
1603 use this command
1604
1605(2) Limitations:
1606
1607 o This command is stateless, this means that commands that depend
1608 on state information (such as getfd) might not work
1609
1610 o Commands that prompt the user for data (eg. 'cont' when the block
1611 device is encrypted) don't currently work
1612
82a56f0d
LC
16133. Query Commands
1614=================
1615
82a56f0d 1616
82a56f0d
LC
1617query-version
1618-------------
1619
1620Show QEMU version.
1621
1622Return a json-object with the following information:
1623
1624- "qemu": A json-object containing three integer values:
1625 - "major": QEMU's major version (json-int)
1626 - "minor": QEMU's minor version (json-int)
1627 - "micro": QEMU's micro version (json-int)
1628- "package": package's version (json-string)
1629
1630Example:
1631
1632-> { "execute": "query-version" }
1633<- {
1634 "return":{
1635 "qemu":{
1636 "major":0,
1637 "minor":11,
1638 "micro":5
1639 },
1640 "package":""
1641 }
1642 }
1643
82a56f0d
LC
1644query-commands
1645--------------
1646
1647List QMP available commands.
1648
1649Each command is represented by a json-object, the returned value is a json-array
1650of all commands.
1651
1652Each json-object contain:
1653
1654- "name": command's name (json-string)
1655
1656Example:
1657
1658-> { "execute": "query-commands" }
1659<- {
1660 "return":[
1661 {
1662 "name":"query-balloon"
1663 },
1664 {
1665 "name":"system_powerdown"
1666 }
1667 ]
1668 }
1669
1670Note: This example has been shortened as the real response is too long.
1671
4860853d
DB
1672query-events
1673--------------
1674
1675List QMP available events.
1676
1677Each event is represented by a json-object, the returned value is a json-array
1678of all events.
1679
1680Each json-object contains:
1681
1682- "name": event's name (json-string)
1683
1684Example:
1685
1686-> { "execute": "query-events" }
1687<- {
1688 "return":[
1689 {
1690 "name":"SHUTDOWN"
1691 },
1692 {
1693 "name":"RESET"
1694 }
1695 ]
1696 }
1697
1698Note: This example has been shortened as the real response is too long.
1699
39a18158
MA
1700query-qmp-schema
1701----------------
1702
1703Return the QMP wire schema. The returned value is a json-array of
1704named schema entities. Entities are commands, events and various
1705types. See docs/qapi-code-gen.txt for information on their structure
1706and intended use.
1707
82a56f0d
LC
1708query-chardev
1709-------------
1710
1711Each device is represented by a json-object. The returned value is a json-array
1712of all devices.
1713
1714Each json-object contain the following:
1715
1716- "label": device's label (json-string)
1717- "filename": device's file (json-string)
32a97ea1
LE
1718- "frontend-open": open/closed state of the frontend device attached to this
1719 backend (json-bool)
82a56f0d
LC
1720
1721Example:
1722
1723-> { "execute": "query-chardev" }
1724<- {
32a97ea1
LE
1725 "return": [
1726 {
1727 "label": "charchannel0",
1728 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
1729 "frontend-open": false
1730 },
82a56f0d 1731 {
32a97ea1
LE
1732 "label": "charmonitor",
1733 "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
1734 "frontend-open": true
82a56f0d
LC
1735 },
1736 {
32a97ea1
LE
1737 "label": "charserial0",
1738 "filename": "pty:/dev/pts/2",
1739 "frontend-open": true
82a56f0d
LC
1740 }
1741 ]
1742 }
1743
77d1c3c6
MK
1744query-chardev-backends
1745-------------
1746
1747List available character device backends.
1748
1749Each backend is represented by a json-object, the returned value is a json-array
1750of all backends.
1751
1752Each json-object contains:
1753
1754- "name": backend name (json-string)
1755
1756Example:
1757
1758-> { "execute": "query-chardev-backends" }
1759<- {
1760 "return":[
1761 {
1762 "name":"udp"
1763 },
1764 {
1765 "name":"tcp"
1766 },
1767 {
1768 "name":"unix"
1769 },
1770 {
1771 "name":"spiceport"
1772 }
1773 ]
1774 }
1775
82a56f0d
LC
1776query-block
1777-----------
1778
1779Show the block devices.
1780
1781Each block device information is stored in a json-object and the returned value
1782is a json-array of all devices.
1783
1784Each json-object contain the following:
1785
1786- "device": device name (json-string)
1787- "type": device type (json-string)
d8aeeb31
MA
1788 - deprecated, retained for backward compatibility
1789 - Possible values: "unknown"
82a56f0d
LC
1790- "removable": true if the device is removable, false otherwise (json-bool)
1791- "locked": true if the device is locked, false otherwise (json-bool)
99f42808 1792- "tray_open": only present if removable, true if the device has a tray,
e4def80b 1793 and it is open (json-bool)
82a56f0d
LC
1794- "inserted": only present if the device is inserted, it is a json-object
1795 containing the following:
1796 - "file": device file name (json-string)
1797 - "ro": true if read-only, false otherwise (json-bool)
1798 - "drv": driver format name (json-string)
550830f9 1799 - Possible values: "blkdebug", "bochs", "cloop", "dmg",
82a56f0d 1800 "file", "file", "ftp", "ftps", "host_cdrom",
92a539d2 1801 "host_device", "http", "https",
82a56f0d
LC
1802 "nbd", "parallels", "qcow", "qcow2", "raw",
1803 "tftp", "vdi", "vmdk", "vpc", "vvfat"
1804 - "backing_file": backing file name (json-string, optional)
2e3e3317 1805 - "backing_file_depth": number of files in the backing file chain (json-int)
82a56f0d 1806 - "encrypted": true if encrypted, false otherwise (json-bool)
727f005e
ZYW
1807 - "bps": limit total bytes per second (json-int)
1808 - "bps_rd": limit read bytes per second (json-int)
1809 - "bps_wr": limit write bytes per second (json-int)
1810 - "iops": limit total I/O operations per second (json-int)
1811 - "iops_rd": limit read operations per second (json-int)
1812 - "iops_wr": limit write operations per second (json-int)
3e9fab69
BC
1813 - "bps_max": total max in bytes (json-int)
1814 - "bps_rd_max": read max in bytes (json-int)
1815 - "bps_wr_max": write max in bytes (json-int)
1816 - "iops_max": total I/O operations max (json-int)
1817 - "iops_rd_max": read I/O operations max (json-int)
1818 - "iops_wr_max": write I/O operations max (json-int)
2024c1df 1819 - "iops_size": I/O size when limiting by iops (json-int)
465bee1d
PL
1820 - "detect_zeroes": detect and optimize zero writing (json-string)
1821 - Possible values: "off", "on", "unmap"
e2462113
FR
1822 - "write_threshold": write offset threshold in bytes, a event will be
1823 emitted if crossed. Zero if disabled (json-int)
553a7e87
WX
1824 - "image": the detail of the image, it is a json-object containing
1825 the following:
1826 - "filename": image file name (json-string)
1827 - "format": image format (json-string)
1828 - "virtual-size": image capacity in bytes (json-int)
1829 - "dirty-flag": true if image is not cleanly closed, not present
1830 means clean (json-bool, optional)
1831 - "actual-size": actual size on disk in bytes of the image, not
1832 present when image does not support thin
1833 provision (json-int, optional)
1834 - "cluster-size": size of a cluster in bytes, not present if image
1835 format does not support it (json-int, optional)
1836 - "encrypted": true if the image is encrypted, not present means
1837 false or the image format does not support
1838 encryption (json-bool, optional)
1839 - "backing_file": backing file name, not present means no backing
1840 file is used or the image format does not
1841 support backing file chain
1842 (json-string, optional)
1843 - "full-backing-filename": full path of the backing file, not
1844 present if it equals backing_file or no
1845 backing file is used
1846 (json-string, optional)
1847 - "backing-filename-format": the format of the backing file, not
1848 present means unknown or no backing
1849 file (json-string, optional)
1850 - "snapshots": the internal snapshot info, it is an optional list
1851 of json-object containing the following:
1852 - "id": unique snapshot id (json-string)
1853 - "name": snapshot name (json-string)
1854 - "vm-state-size": size of the VM state in bytes (json-int)
1855 - "date-sec": UTC date of the snapshot in seconds (json-int)
1856 - "date-nsec": fractional part in nanoseconds to be used with
586b5466 1857 date-sec (json-int)
553a7e87
WX
1858 - "vm-clock-sec": VM clock relative to boot in seconds
1859 (json-int)
1860 - "vm-clock-nsec": fractional part in nanoseconds to be used
1861 with vm-clock-sec (json-int)
1862 - "backing-image": the detail of the backing image, it is an
1863 optional json-object only present when a
1864 backing image present for this image
727f005e 1865
f04ef601
LC
1866- "io-status": I/O operation status, only present if the device supports it
1867 and the VM is configured to stop on errors. It's always reset
1868 to "ok" when the "cont" command is issued (json_string, optional)
1869 - Possible values: "ok", "failed", "nospace"
82a56f0d
LC
1870
1871Example:
1872
1873-> { "execute": "query-block" }
1874<- {
1875 "return":[
1876 {
f04ef601 1877 "io-status": "ok",
82a56f0d
LC
1878 "device":"ide0-hd0",
1879 "locked":false,
1880 "removable":false,
1881 "inserted":{
1882 "ro":false,
1883 "drv":"qcow2",
1884 "encrypted":false,
553a7e87
WX
1885 "file":"disks/test.qcow2",
1886 "backing_file_depth":1,
727f005e
ZYW
1887 "bps":1000000,
1888 "bps_rd":0,
1889 "bps_wr":0,
1890 "iops":1000000,
1891 "iops_rd":0,
1892 "iops_wr":0,
3e9fab69
BC
1893 "bps_max": 8000000,
1894 "bps_rd_max": 0,
1895 "bps_wr_max": 0,
1896 "iops_max": 0,
1897 "iops_rd_max": 0,
1898 "iops_wr_max": 0,
2024c1df 1899 "iops_size": 0,
465bee1d 1900 "detect_zeroes": "on",
e2462113 1901 "write_threshold": 0,
553a7e87
WX
1902 "image":{
1903 "filename":"disks/test.qcow2",
1904 "format":"qcow2",
1905 "virtual-size":2048000,
1906 "backing_file":"base.qcow2",
1907 "full-backing-filename":"disks/base.qcow2",
5403432f 1908 "backing-filename-format":"qcow2",
553a7e87
WX
1909 "snapshots":[
1910 {
1911 "id": "1",
1912 "name": "snapshot1",
1913 "vm-state-size": 0,
1914 "date-sec": 10000200,
1915 "date-nsec": 12,
1916 "vm-clock-sec": 206,
1917 "vm-clock-nsec": 30
1918 }
1919 ],
1920 "backing-image":{
1921 "filename":"disks/base.qcow2",
1922 "format":"qcow2",
1923 "virtual-size":2048000
1924 }
1925 }
82a56f0d 1926 },
d8aeeb31 1927 "type":"unknown"
82a56f0d
LC
1928 },
1929 {
f04ef601 1930 "io-status": "ok",
82a56f0d
LC
1931 "device":"ide1-cd0",
1932 "locked":false,
1933 "removable":true,
d8aeeb31 1934 "type":"unknown"
82a56f0d
LC
1935 },
1936 {
1937 "device":"floppy0",
1938 "locked":false,
1939 "removable":true,
d8aeeb31 1940 "type":"unknown"
82a56f0d
LC
1941 },
1942 {
1943 "device":"sd0",
1944 "locked":false,
1945 "removable":true,
d8aeeb31 1946 "type":"unknown"
82a56f0d
LC
1947 }
1948 ]
1949 }
1950
82a56f0d
LC
1951query-blockstats
1952----------------
1953
1954Show block device statistics.
1955
1956Each device statistic information is stored in a json-object and the returned
1957value is a json-array of all devices.
1958
1959Each json-object contain the following:
1960
1961- "device": device name (json-string)
1962- "stats": A json-object with the statistics information, it contains:
1963 - "rd_bytes": bytes read (json-int)
1964 - "wr_bytes": bytes written (json-int)
1965 - "rd_operations": read operations (json-int)
1966 - "wr_operations": write operations (json-int)
e8045d67 1967 - "flush_operations": cache flush operations (json-int)
c488c7f6
CH
1968 - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int)
1969 - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int)
1970 - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int)
53d8f9d8
HR
1971 - "wr_highest_offset": The offset after the greatest byte written to the
1972 BlockDriverState since it has been opened (json-int)
f4564d53
PL
1973 - "rd_merged": number of read requests that have been merged into
1974 another request (json-int)
1975 - "wr_merged": number of write requests that have been merged into
1976 another request (json-int)
cb38fffb
AG
1977 - "idle_time_ns": time since the last I/O operation, in
1978 nanoseconds. If the field is absent it means
1979 that there haven't been any operations yet
1980 (json-int, optional)
7ee12daf
AG
1981 - "failed_rd_operations": number of failed read operations
1982 (json-int)
1983 - "failed_wr_operations": number of failed write operations
1984 (json-int)
1985 - "failed_flush_operations": number of failed flush operations
1986 (json-int)
1987 - "invalid_rd_operations": number of invalid read operations
1988 (json-int)
1989 - "invalid_wr_operations": number of invalid write operations
1990 (json-int)
1991 - "invalid_flush_operations": number of invalid flush operations
1992 (json-int)
362e9299
AG
1993 - "account_invalid": whether invalid operations are included in
1994 the last access statistics (json-bool)
1995 - "account_failed": whether failed operations are included in the
1996 latency and last access statistics
1997 (json-bool)
979e9b03
AG
1998 - "timed_stats": A json-array containing statistics collected in
1999 specific intervals, with the following members:
2000 - "interval_length": interval used for calculating the
2001 statistics, in seconds (json-int)
2002 - "min_rd_latency_ns": minimum latency of read operations in
2003 the defined interval, in nanoseconds
2004 (json-int)
2005 - "min_wr_latency_ns": minimum latency of write operations in
2006 the defined interval, in nanoseconds
2007 (json-int)
2008 - "min_flush_latency_ns": minimum latency of flush operations
2009 in the defined interval, in
2010 nanoseconds (json-int)
2011 - "max_rd_latency_ns": maximum latency of read operations in
2012 the defined interval, in nanoseconds
2013 (json-int)
2014 - "max_wr_latency_ns": maximum latency of write operations in
2015 the defined interval, in nanoseconds
2016 (json-int)
2017 - "max_flush_latency_ns": maximum latency of flush operations
2018 in the defined interval, in
2019 nanoseconds (json-int)
2020 - "avg_rd_latency_ns": average latency of read operations in
2021 the defined interval, in nanoseconds
2022 (json-int)
2023 - "avg_wr_latency_ns": average latency of write operations in
2024 the defined interval, in nanoseconds
2025 (json-int)
2026 - "avg_flush_latency_ns": average latency of flush operations
2027 in the defined interval, in
2028 nanoseconds (json-int)
96e4deda
AG
2029 - "avg_rd_queue_depth": average number of pending read
2030 operations in the defined interval
2031 (json-number)
2032 - "avg_wr_queue_depth": average number of pending write
2033 operations in the defined interval
2034 (json-number).
82a56f0d
LC
2035- "parent": Contains recursively the statistics of the underlying
2036 protocol (e.g. the host file for a qcow2 image). If there is
2037 no underlying protocol, this field is omitted
2038 (json-object, optional)
2039
2040Example:
2041
2042-> { "execute": "query-blockstats" }
2043<- {
2044 "return":[
2045 {
2046 "device":"ide0-hd0",
2047 "parent":{
2048 "stats":{
2049 "wr_highest_offset":3686448128,
2050 "wr_bytes":9786368,
2051 "wr_operations":751,
2052 "rd_bytes":122567168,
2053 "rd_operations":36772
c488c7f6
CH
2054 "wr_total_times_ns":313253456
2055 "rd_total_times_ns":3465673657
2056 "flush_total_times_ns":49653
e8045d67 2057 "flush_operations":61,
f4564d53 2058 "rd_merged":0,
cb38fffb 2059 "wr_merged":0,
362e9299
AG
2060 "idle_time_ns":2953431879,
2061 "account_invalid":true,
2062 "account_failed":false
82a56f0d
LC
2063 }
2064 },
2065 "stats":{
2066 "wr_highest_offset":2821110784,
2067 "wr_bytes":9786368,
2068 "wr_operations":692,
2069 "rd_bytes":122739200,
2070 "rd_operations":36604
e8045d67 2071 "flush_operations":51,
c488c7f6
CH
2072 "wr_total_times_ns":313253456
2073 "rd_total_times_ns":3465673657
f4564d53
PL
2074 "flush_total_times_ns":49653,
2075 "rd_merged":0,
cb38fffb 2076 "wr_merged":0,
362e9299
AG
2077 "idle_time_ns":2953431879,
2078 "account_invalid":true,
2079 "account_failed":false
82a56f0d
LC
2080 }
2081 },
2082 {
2083 "device":"ide1-cd0",
2084 "stats":{
2085 "wr_highest_offset":0,
2086 "wr_bytes":0,
2087 "wr_operations":0,
2088 "rd_bytes":0,
2089 "rd_operations":0
e8045d67 2090 "flush_operations":0,
c488c7f6
CH
2091 "wr_total_times_ns":0
2092 "rd_total_times_ns":0
f4564d53
PL
2093 "flush_total_times_ns":0,
2094 "rd_merged":0,
362e9299
AG
2095 "wr_merged":0,
2096 "account_invalid":false,
2097 "account_failed":false
82a56f0d
LC
2098 }
2099 },
2100 {
2101 "device":"floppy0",
2102 "stats":{
2103 "wr_highest_offset":0,
2104 "wr_bytes":0,
2105 "wr_operations":0,
2106 "rd_bytes":0,
2107 "rd_operations":0
e8045d67 2108 "flush_operations":0,
c488c7f6
CH
2109 "wr_total_times_ns":0
2110 "rd_total_times_ns":0
f4564d53
PL
2111 "flush_total_times_ns":0,
2112 "rd_merged":0,
362e9299
AG
2113 "wr_merged":0,
2114 "account_invalid":false,
2115 "account_failed":false
82a56f0d
LC
2116 }
2117 },
2118 {
2119 "device":"sd0",
2120 "stats":{
2121 "wr_highest_offset":0,
2122 "wr_bytes":0,
2123 "wr_operations":0,
2124 "rd_bytes":0,
2125 "rd_operations":0
e8045d67 2126 "flush_operations":0,
c488c7f6
CH
2127 "wr_total_times_ns":0
2128 "rd_total_times_ns":0
f4564d53
PL
2129 "flush_total_times_ns":0,
2130 "rd_merged":0,
362e9299
AG
2131 "wr_merged":0,
2132 "account_invalid":false,
2133 "account_failed":false
82a56f0d
LC
2134 }
2135 }
2136 ]
2137 }
2138
82a56f0d
LC
2139query-cpus
2140----------
2141
2142Show CPU information.
2143
2144Return a json-array. Each CPU is represented by a json-object, which contains:
2145
2146- "CPU": CPU index (json-int)
2147- "current": true if this is the current CPU, false otherwise (json-bool)
2148- "halted": true if the cpu is halted, false otherwise (json-bool)
58f88d4b 2149- "qom_path": path to the CPU object in the QOM tree (json-str)
86f4b687
EB
2150- "arch": architecture of the cpu, which determines what additional
2151 keys will be present (json-str)
82a56f0d
LC
2152- Current program counter. The key's name depends on the architecture:
2153 "pc": i386/x86_64 (json-int)
2154 "nip": PPC (json-int)
2155 "pc" and "npc": sparc (json-int)
2156 "PC": mips (json-int)
dc7a09cf 2157- "thread_id": ID of the underlying host thread (json-int)
82a56f0d
LC
2158
2159Example:
2160
2161-> { "execute": "query-cpus" }
2162<- {
2163 "return":[
2164 {
2165 "CPU":0,
2166 "current":true,
2167 "halted":false,
58f88d4b 2168 "qom_path":"/machine/unattached/device[0]",
86f4b687 2169 "arch":"x86",
58f88d4b 2170 "pc":3227107138,
dc7a09cf 2171 "thread_id":3134
82a56f0d
LC
2172 },
2173 {
2174 "CPU":1,
2175 "current":false,
2176 "halted":true,
58f88d4b 2177 "qom_path":"/machine/unattached/device[2]",
86f4b687 2178 "arch":"x86",
58f88d4b 2179 "pc":7108165,
dc7a09cf 2180 "thread_id":3135
82a56f0d
LC
2181 }
2182 ]
2183 }
2184
dc3dd0d2
SH
2185query-iothreads
2186---------------
2187
2188Returns a list of information about each iothread.
2189
2190Note this list excludes the QEMU main loop thread, which is not declared
2191using the -object iothread command-line option. It is always the main thread
2192of the process.
2193
2194Return a json-array. Each iothread is represented by a json-object, which contains:
2195
2196- "id": name of iothread (json-str)
2197- "thread-id": ID of the underlying host thread (json-int)
2198
2199Example:
2200
2201-> { "execute": "query-iothreads" }
2202<- {
2203 "return":[
2204 {
2205 "id":"iothread0",
2206 "thread-id":3134
2207 },
2208 {
2209 "id":"iothread1",
2210 "thread-id":3135
2211 }
2212 ]
2213 }
2214
82a56f0d
LC
2215query-pci
2216---------
2217
2218PCI buses and devices information.
2219
2220The returned value is a json-array of all buses. Each bus is represented by
2221a json-object, which has a key with a json-array of all PCI devices attached
2222to it. Each device is represented by a json-object.
2223
2224The bus json-object contains the following:
2225
2226- "bus": bus number (json-int)
2227- "devices": a json-array of json-objects, each json-object represents a
2228 PCI device
2229
2230The PCI device json-object contains the following:
2231
2232- "bus": identical to the parent's bus number (json-int)
2233- "slot": slot number (json-int)
2234- "function": function number (json-int)
2235- "class_info": a json-object containing:
2236 - "desc": device class description (json-string, optional)
2237 - "class": device class number (json-int)
2238- "id": a json-object containing:
2239 - "device": device ID (json-int)
2240 - "vendor": vendor ID (json-int)
2241- "irq": device's IRQ if assigned (json-int, optional)
2242- "qdev_id": qdev id string (json-string)
2243- "pci_bridge": It's a json-object, only present if this device is a
2244 PCI bridge, contains:
2245 - "bus": bus number (json-int)
2246 - "secondary": secondary bus number (json-int)
2247 - "subordinate": subordinate bus number (json-int)
2248 - "io_range": I/O memory range information, a json-object with the
2249 following members:
2250 - "base": base address, in bytes (json-int)
2251 - "limit": limit address, in bytes (json-int)
2252 - "memory_range": memory range information, a json-object with the
2253 following members:
2254 - "base": base address, in bytes (json-int)
2255 - "limit": limit address, in bytes (json-int)
2256 - "prefetchable_range": Prefetchable memory range information, a
2257 json-object with the following members:
2258 - "base": base address, in bytes (json-int)
2259 - "limit": limit address, in bytes (json-int)
2260 - "devices": a json-array of PCI devices if there's any attached, each
2261 each element is represented by a json-object, which contains
2262 the same members of the 'PCI device json-object' described
2263 above (optional)
2264- "regions": a json-array of json-objects, each json-object represents a
2265 memory region of this device
2266
2267The memory range json-object contains the following:
2268
2269- "base": base memory address (json-int)
2270- "limit": limit value (json-int)
2271
2272The region json-object can be an I/O region or a memory region, an I/O region
2273json-object contains the following:
2274
2275- "type": "io" (json-string, fixed)
2276- "bar": BAR number (json-int)
2277- "address": memory address (json-int)
2278- "size": memory size (json-int)
2279
2280A memory region json-object contains the following:
2281
2282- "type": "memory" (json-string, fixed)
2283- "bar": BAR number (json-int)
2284- "address": memory address (json-int)
2285- "size": memory size (json-int)
2286- "mem_type_64": true or false (json-bool)
2287- "prefetch": true or false (json-bool)
2288
2289Example:
2290
2291-> { "execute": "query-pci" }
2292<- {
2293 "return":[
2294 {
2295 "bus":0,
2296 "devices":[
2297 {
2298 "bus":0,
2299 "qdev_id":"",
2300 "slot":0,
2301 "class_info":{
2302 "class":1536,
2303 "desc":"Host bridge"
2304 },
2305 "id":{
2306 "device":32902,
2307 "vendor":4663
2308 },
2309 "function":0,
2310 "regions":[
bdf05133 2311
82a56f0d
LC
2312 ]
2313 },
2314 {
2315 "bus":0,
2316 "qdev_id":"",
2317 "slot":1,
2318 "class_info":{
2319 "class":1537,
2320 "desc":"ISA bridge"
2321 },
2322 "id":{
2323 "device":32902,
2324 "vendor":28672
2325 },
2326 "function":0,
2327 "regions":[
bdf05133 2328
82a56f0d
LC
2329 ]
2330 },
2331 {
2332 "bus":0,
2333 "qdev_id":"",
2334 "slot":1,
2335 "class_info":{
2336 "class":257,
2337 "desc":"IDE controller"
2338 },
2339 "id":{
2340 "device":32902,
2341 "vendor":28688
2342 },
2343 "function":1,
2344 "regions":[
2345 {
2346 "bar":4,
2347 "size":16,
2348 "address":49152,
2349 "type":"io"
2350 }
2351 ]
2352 },
2353 {
2354 "bus":0,
2355 "qdev_id":"",
2356 "slot":2,
2357 "class_info":{
2358 "class":768,
2359 "desc":"VGA controller"
2360 },
2361 "id":{
2362 "device":4115,
2363 "vendor":184
2364 },
2365 "function":0,
2366 "regions":[
2367 {
2368 "prefetch":true,
2369 "mem_type_64":false,
2370 "bar":0,
2371 "size":33554432,
2372 "address":4026531840,
2373 "type":"memory"
2374 },
2375 {
2376 "prefetch":false,
2377 "mem_type_64":false,
2378 "bar":1,
2379 "size":4096,
2380 "address":4060086272,
2381 "type":"memory"
2382 },
2383 {
2384 "prefetch":false,
2385 "mem_type_64":false,
2386 "bar":6,
2387 "size":65536,
2388 "address":-1,
2389 "type":"memory"
2390 }
2391 ]
2392 },
2393 {
2394 "bus":0,
2395 "qdev_id":"",
2396 "irq":11,
2397 "slot":4,
2398 "class_info":{
2399 "class":1280,
2400 "desc":"RAM controller"
2401 },
2402 "id":{
2403 "device":6900,
2404 "vendor":4098
2405 },
2406 "function":0,
2407 "regions":[
2408 {
2409 "bar":0,
2410 "size":32,
2411 "address":49280,
2412 "type":"io"
2413 }
2414 ]
2415 }
2416 ]
2417 }
2418 ]
2419 }
2420
2421Note: This example has been shortened as the real response is too long.
2422
82a56f0d
LC
2423query-kvm
2424---------
2425
2426Show KVM information.
2427
2428Return a json-object with the following information:
2429
2430- "enabled": true if KVM support is enabled, false otherwise (json-bool)
2431- "present": true if QEMU has KVM support, false otherwise (json-bool)
2432
2433Example:
2434
2435-> { "execute": "query-kvm" }
2436<- { "return": { "enabled": true, "present": true } }
2437
82a56f0d
LC
2438query-status
2439------------
2440
2441Return a json-object with the following information:
2442
2443- "running": true if the VM is running, or false if it is paused (json-bool)
2444- "singlestep": true if the VM is in single step mode,
2445 false otherwise (json-bool)
9e37b9dc
LC
2446- "status": one of the following values (json-string)
2447 "debug" - QEMU is running on a debugger
2448 "inmigrate" - guest is paused waiting for an incoming migration
2449 "internal-error" - An internal error that prevents further guest
2450 execution has occurred
2451 "io-error" - the last IOP has failed and the device is configured
2452 to pause on I/O errors
2453 "paused" - guest has been paused via the 'stop' command
2454 "postmigrate" - guest is paused following a successful 'migrate'
2455 "prelaunch" - QEMU was started with -S and guest has not started
2456 "finish-migrate" - guest is paused to finish the migration process
2457 "restore-vm" - guest is paused to restore VM state
2458 "running" - guest is actively running
2459 "save-vm" - guest is paused to save the VM state
2460 "shutdown" - guest is shut down (and -no-shutdown is in use)
2461 "watchdog" - the watchdog action is configured to pause and
2462 has been triggered
82a56f0d
LC
2463
2464Example:
2465
2466-> { "execute": "query-status" }
9e37b9dc 2467<- { "return": { "running": true, "singlestep": false, "status": "running" } }
82a56f0d 2468
82a56f0d
LC
2469query-mice
2470----------
2471
2472Show VM mice information.
2473
2474Each mouse is represented by a json-object, the returned value is a json-array
2475of all mice.
2476
2477The mouse json-object contains the following:
2478
2479- "name": mouse's name (json-string)
2480- "index": mouse's index (json-int)
2481- "current": true if this mouse is receiving events, false otherwise (json-bool)
2482- "absolute": true if the mouse generates absolute input events (json-bool)
2483
2484Example:
2485
2486-> { "execute": "query-mice" }
2487<- {
2488 "return":[
2489 {
2490 "name":"QEMU Microsoft Mouse",
2491 "index":0,
2492 "current":false,
2493 "absolute":false
2494 },
2495 {
2496 "name":"QEMU PS/2 Mouse",
2497 "index":1,
2498 "current":true,
2499 "absolute":true
2500 }
2501 ]
2502 }
2503
82a56f0d
LC
2504query-vnc
2505---------
2506
2507Show VNC server information.
2508
2509Return a json-object with server information. Connected clients are returned
2510as a json-array of json-objects.
2511
2512The main json-object contains the following:
2513
2514- "enabled": true or false (json-bool)
2515- "host": server's IP address (json-string)
2516- "family": address family (json-string)
2517 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2518- "service": server's port number (json-string)
2519- "auth": authentication method (json-string)
2520 - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight",
2521 "tls", "ultra", "unknown", "vencrypt", "vencrypt",
2522 "vencrypt+plain", "vencrypt+tls+none",
2523 "vencrypt+tls+plain", "vencrypt+tls+sasl",
2524 "vencrypt+tls+vnc", "vencrypt+x509+none",
2525 "vencrypt+x509+plain", "vencrypt+x509+sasl",
2526 "vencrypt+x509+vnc", "vnc"
2527- "clients": a json-array of all connected clients
2528
2529Clients are described by a json-object, each one contain the following:
2530
2531- "host": client's IP address (json-string)
2532- "family": address family (json-string)
2533 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2534- "service": client's port number (json-string)
2535- "x509_dname": TLS dname (json-string, optional)
2536- "sasl_username": SASL username (json-string, optional)
2537
2538Example:
2539
2540-> { "execute": "query-vnc" }
2541<- {
2542 "return":{
2543 "enabled":true,
2544 "host":"0.0.0.0",
2545 "service":"50402",
2546 "auth":"vnc",
2547 "family":"ipv4",
2548 "clients":[
2549 {
2550 "host":"127.0.0.1",
2551 "service":"50401",
2552 "family":"ipv4"
2553 }
2554 ]
2555 }
2556 }
2557
cb42a870
GH
2558query-spice
2559-----------
2560
2561Show SPICE server information.
2562
2563Return a json-object with server information. Connected clients are returned
2564as a json-array of json-objects.
2565
2566The main json-object contains the following:
2567
2568- "enabled": true or false (json-bool)
2569- "host": server's IP address (json-string)
2570- "port": server's port number (json-int, optional)
2571- "tls-port": server's port number (json-int, optional)
2572- "auth": authentication method (json-string)
2573 - Possible values: "none", "spice"
2574- "channels": a json-array of all active channels clients
2575
2576Channels are described by a json-object, each one contain the following:
2577
2578- "host": client's IP address (json-string)
2579- "family": address family (json-string)
2580 - Possible values: "ipv4", "ipv6", "unix", "unknown"
2581- "port": client's port number (json-string)
2582- "connection-id": spice connection id. All channels with the same id
2583 belong to the same spice session (json-int)
2584- "channel-type": channel type. "1" is the main control channel, filter for
2585 this one if you want track spice sessions only (json-int)
2586- "channel-id": channel id. Usually "0", might be different needed when
2587 multiple channels of the same type exist, such as multiple
2588 display channels in a multihead setup (json-int)
3599d46b 2589- "tls": whether the channel is encrypted (json-bool)
cb42a870
GH
2590
2591Example:
2592
2593-> { "execute": "query-spice" }
2594<- {
2595 "return": {
2596 "enabled": true,
2597 "auth": "spice",
2598 "port": 5920,
2599 "tls-port": 5921,
2600 "host": "0.0.0.0",
2601 "channels": [
2602 {
2603 "port": "54924",
2604 "family": "ipv4",
2605 "channel-type": 1,
2606 "connection-id": 1804289383,
2607 "host": "127.0.0.1",
2608 "channel-id": 0,
2609 "tls": true
2610 },
2611 {
2612 "port": "36710",
2613 "family": "ipv4",
2614 "channel-type": 4,
2615 "connection-id": 1804289383,
2616 "host": "127.0.0.1",
2617 "channel-id": 0,
2618 "tls": false
2619 },
2620 [ ... more channels follow ... ]
2621 ]
2622 }
2623 }
2624
82a56f0d
LC
2625query-name
2626----------
2627
2628Show VM name.
2629
2630Return a json-object with the following information:
2631
2632- "name": VM's name (json-string, optional)
2633
2634Example:
2635
2636-> { "execute": "query-name" }
2637<- { "return": { "name": "qemu-name" } }
2638
82a56f0d
LC
2639query-uuid
2640----------
2641
2642Show VM UUID.
2643
2644Return a json-object with the following information:
2645
2646- "UUID": Universally Unique Identifier (json-string)
2647
2648Example:
2649
2650-> { "execute": "query-uuid" }
2651<- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
2652
1f8f987d
AK
2653query-command-line-options
2654--------------------------
2655
2656Show command line option schema.
2657
2658Return a json-array of command line option schema for all options (or for
2659the given option), returning an error if the given option doesn't exist.
2660
2661Each array entry contains the following:
2662
2663- "option": option name (json-string)
2664- "parameters": a json-array describes all parameters of the option:
2665 - "name": parameter name (json-string)
2666 - "type": parameter type (one of 'string', 'boolean', 'number',
2667 or 'size')
2668 - "help": human readable description of the parameter
2669 (json-string, optional)
e36af94f
CL
2670 - "default": default value string for the parameter
2671 (json-string, optional)
1f8f987d
AK
2672
2673Example:
2674
2675-> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } }
2676<- { "return": [
2677 {
2678 "parameters": [
2679 {
2680 "name": "romfile",
2681 "type": "string"
2682 },
2683 {
2684 "name": "bootindex",
2685 "type": "number"
2686 }
2687 ],
2688 "option": "option-rom"
2689 }
2690 ]
2691 }
2692
82a56f0d
LC
2693query-migrate
2694-------------
2695
2696Migration status.
2697
2698Return a json-object. If migration is active there will be another json-object
2699with RAM migration status and if block migration is active another one with
2700block migration status.
2701
2702The main json-object contains the following:
2703
2704- "status": migration status (json-string)
3b695950 2705 - Possible values: "setup", "active", "completed", "failed", "cancelled"
7aa939af
JQ
2706- "total-time": total amount of ms since migration started. If
2707 migration has ended, it returns the total migration
817c6045 2708 time (json-int)
8f3067bd
MH
2709- "setup-time" amount of setup time in milliseconds _before_ the
2710 iterations begin but _after_ the QMP command is issued.
2711 This is designed to provide an accounting of any activities
bdf05133
MAL
2712 (such as RDMA pinning) which may be expensive, but do not
2713 actually occur during the iterative migration rounds
8f3067bd 2714 themselves. (json-int)
9c5a9fcf
JQ
2715- "downtime": only present when migration has finished correctly
2716 total amount in ms for downtime that happened (json-int)
2c52ddf1
JQ
2717- "expected-downtime": only present while migration is active
2718 total amount in ms for downtime that was calculated on
817c6045 2719 the last bitmap round (json-int)
82a56f0d 2720- "ram": only present if "status" is "active", it is a json-object with the
817c6045
JQ
2721 following RAM information:
2722 - "transferred": amount transferred in bytes (json-int)
2723 - "remaining": amount remaining to transfer in bytes (json-int)
2724 - "total": total amount of memory in bytes (json-int)
2725 - "duplicate": number of pages filled entirely with the same
2726 byte (json-int)
2727 These are sent over the wire much more efficiently.
f1c72795 2728 - "skipped": number of skipped zero pages (json-int)
805a2505 2729 - "normal" : number of whole pages transferred. I.e. they
817c6045
JQ
2730 were not sent as duplicate or xbzrle pages (json-int)
2731 - "normal-bytes" : number of bytes transferred in whole
2732 pages. This is just normal pages times size of one page,
2733 but this way upper levels don't need to care about page
2734 size (json-int)
58570ed8 2735 - "dirty-sync-count": times that dirty ram was synchronized (json-int)
82a56f0d 2736- "disk": only present if "status" is "active" and it is a block migration,
817c6045
JQ
2737 it is a json-object with the following disk information:
2738 - "transferred": amount transferred in bytes (json-int)
2739 - "remaining": amount remaining to transfer in bytes json-int)
2740 - "total": total disk size in bytes (json-int)
f36d55af
OW
2741- "xbzrle-cache": only present if XBZRLE is active.
2742 It is a json-object with the following XBZRLE information:
817c6045
JQ
2743 - "cache-size": XBZRLE cache size in bytes
2744 - "bytes": number of bytes transferred for XBZRLE compressed pages
f36d55af 2745 - "pages": number of XBZRLE compressed pages
817c6045 2746 - "cache-miss": number of XBRZRLE page cache misses
8bc39233 2747 - "cache-miss-rate": rate of XBRZRLE page cache misses
817c6045
JQ
2748 - "overflow": number of times XBZRLE overflows. This means
2749 that the XBZRLE encoding was bigger than just sent the
2750 whole page, and then we sent the whole page instead (as as
2751 normal page).
2752
82a56f0d
LC
2753Examples:
2754
27551. Before the first migration
2756
2757-> { "execute": "query-migrate" }
2758<- { "return": {} }
2759
27602. Migration is done and has succeeded
2761
2762-> { "execute": "query-migrate" }
004d4c10
OW
2763<- { "return": {
2764 "status": "completed",
2765 "ram":{
2766 "transferred":123,
2767 "remaining":123,
2768 "total":246,
2769 "total-time":12345,
8f3067bd 2770 "setup-time":12345,
9c5a9fcf 2771 "downtime":12345,
004d4c10
OW
2772 "duplicate":123,
2773 "normal":123,
58570ed8
C
2774 "normal-bytes":123456,
2775 "dirty-sync-count":15
004d4c10
OW
2776 }
2777 }
2778 }
82a56f0d
LC
2779
27803. Migration is done and has failed
2781
2782-> { "execute": "query-migrate" }
2783<- { "return": { "status": "failed" } }
2784
27854. Migration is being performed and is not a block migration:
2786
2787-> { "execute": "query-migrate" }
2788<- {
2789 "return":{
2790 "status":"active",
2791 "ram":{
2792 "transferred":123,
2793 "remaining":123,
62d4e3fe 2794 "total":246,
004d4c10 2795 "total-time":12345,
8f3067bd 2796 "setup-time":12345,
2c52ddf1 2797 "expected-downtime":12345,
004d4c10
OW
2798 "duplicate":123,
2799 "normal":123,
58570ed8
C
2800 "normal-bytes":123456,
2801 "dirty-sync-count":15
82a56f0d
LC
2802 }
2803 }
2804 }
2805
28065. Migration is being performed and is a block migration:
2807
2808-> { "execute": "query-migrate" }
2809<- {
2810 "return":{
2811 "status":"active",
2812 "ram":{
2813 "total":1057024,
2814 "remaining":1053304,
62d4e3fe 2815 "transferred":3720,
004d4c10 2816 "total-time":12345,
8f3067bd 2817 "setup-time":12345,
2c52ddf1 2818 "expected-downtime":12345,
004d4c10
OW
2819 "duplicate":123,
2820 "normal":123,
58570ed8
C
2821 "normal-bytes":123456,
2822 "dirty-sync-count":15
82a56f0d
LC
2823 },
2824 "disk":{
2825 "total":20971520,
2826 "remaining":20880384,
2827 "transferred":91136
2828 }
2829 }
2830 }
2831
f36d55af
OW
28326. Migration is being performed and XBZRLE is active:
2833
2834-> { "execute": "query-migrate" }
2835<- {
2836 "return":{
2837 "status":"active",
2838 "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
2839 "ram":{
2840 "total":1057024,
2841 "remaining":1053304,
2842 "transferred":3720,
2843 "total-time":12345,
8f3067bd 2844 "setup-time":12345,
2c52ddf1 2845 "expected-downtime":12345,
f36d55af
OW
2846 "duplicate":10,
2847 "normal":3333,
58570ed8
C
2848 "normal-bytes":3412992,
2849 "dirty-sync-count":15
f36d55af
OW
2850 },
2851 "xbzrle-cache":{
2852 "cache-size":67108864,
2853 "bytes":20971520,
2854 "pages":2444343,
2855 "cache-miss":2244,
8bc39233 2856 "cache-miss-rate":0.123,
f36d55af
OW
2857 "overflow":34434
2858 }
2859 }
2860 }
2861
00458433 2862migrate-set-capabilities
817c6045 2863------------------------
00458433
OW
2864
2865Enable/Disable migration capabilities
2866
817c6045 2867- "xbzrle": XBZRLE support
d6d69731
HZ
2868- "rdma-pin-all": pin all pages when using RDMA during migration
2869- "auto-converge": throttle down guest to help convergence of migration
2870- "zero-blocks": compress zero blocks during block migration
164f59e8 2871- "compress": use multiple compression threads to accelerate live migration
72e72e1a 2872- "events": generate events for each migration state change
32c3db5b 2873- "postcopy-ram": postcopy mode for live migration
35a6ed4f 2874- "x-colo": COarse-Grain LOck Stepping (COLO) for Non-stop Service
00458433
OW
2875
2876Arguments:
2877
2878Example:
2879
2880-> { "execute": "migrate-set-capabilities" , "arguments":
2881 { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
2882
bbf6da32 2883query-migrate-capabilities
817c6045 2884--------------------------
bbf6da32
OW
2885
2886Query current migration capabilities
2887
2888- "capabilities": migration capabilities state
2889 - "xbzrle" : XBZRLE state (json-bool)
d6d69731
HZ
2890 - "rdma-pin-all" : RDMA Pin Page state (json-bool)
2891 - "auto-converge" : Auto Converge state (json-bool)
2892 - "zero-blocks" : Zero Blocks state (json-bool)
164f59e8
HZ
2893 - "compress": Multiple compression threads state (json-bool)
2894 - "events": Migration state change event state (json-bool)
32c3db5b 2895 - "postcopy-ram": postcopy ram state (json-bool)
35a6ed4f 2896 - "x-colo": COarse-Grain LOck Stepping for Non-stop Service (json-bool)
bbf6da32
OW
2897
2898Arguments:
2899
2900Example:
2901
2902-> { "execute": "query-migrate-capabilities" }
164f59e8
HZ
2903<- {"return": [
2904 {"state": false, "capability": "xbzrle"},
2905 {"state": false, "capability": "rdma-pin-all"},
2906 {"state": false, "capability": "auto-converge"},
2907 {"state": false, "capability": "zero-blocks"},
2908 {"state": false, "capability": "compress"},
2909 {"state": true, "capability": "events"},
35a6ed4f
HZ
2910 {"state": false, "capability": "postcopy-ram"},
2911 {"state": false, "capability": "x-colo"}
164f59e8 2912 ]}
dbca1b37 2913
85de8323
LL
2914migrate-set-parameters
2915----------------------
2916
2917Set migration parameters
2918
2919- "compress-level": set compression level during migration (json-int)
2920- "compress-threads": set compression thread count for migration (json-int)
2921- "decompress-threads": set decompression thread count for migration (json-int)
d85a31d1
JH
2922- "cpu-throttle-initial": set initial percentage of time guest cpus are
2923 throttled for auto-converge (json-int)
2924- "cpu-throttle-increment": set throttle increasing percentage for
2925 auto-converge (json-int)
2ff30257
AA
2926- "max-bandwidth": set maximum speed for migrations (in bytes/sec) (json-int)
2927- "downtime-limit": set maximum tolerated downtime (in milliseconds) for
2928 migrations (json-int)
68b53591
HZ
2929- "x-checkpoint-delay": set the delay time for periodic checkpoint (json-int)
2930
85de8323
LL
2931Arguments:
2932
2933Example:
2934
2935-> { "execute": "migrate-set-parameters" , "arguments":
2936 { "compress-level": 1 } }
2937
85de8323
LL
2938query-migrate-parameters
2939------------------------
2940
2941Query current migration parameters
2942
2943- "parameters": migration parameters value
2944 - "compress-level" : compression level value (json-int)
2945 - "compress-threads" : compression thread count value (json-int)
2946 - "decompress-threads" : decompression thread count value (json-int)
d85a31d1
JH
2947 - "cpu-throttle-initial" : initial percentage of time guest cpus are
2948 throttled (json-int)
2949 - "cpu-throttle-increment" : throttle increasing percentage for
2950 auto-converge (json-int)
2ff30257
AA
2951 - "max-bandwidth" : maximium migration speed in bytes per second
2952 (json-int)
2953 - "downtime-limit" : maximum tolerated downtime of migration in
2954 milliseconds (json-int)
85de8323
LL
2955Arguments:
2956
2957Example:
2958
2959-> { "execute": "query-migrate-parameters" }
2960<- {
2961 "return": {
9c994a97 2962 "decompress-threads": 2,
d85a31d1 2963 "cpu-throttle-increment": 10,
9c994a97
HZ
2964 "compress-threads": 8,
2965 "compress-level": 1,
2ff30257
AA
2966 "cpu-throttle-initial": 20,
2967 "max-bandwidth": 33554432,
2968 "downtime-limit": 300
85de8323
LL
2969 }
2970 }
2971
82a56f0d
LC
2972query-balloon
2973-------------
2974
2975Show balloon information.
2976
2977Make an asynchronous request for balloon info. When the request completes a
2978json-object will be returned containing the following data:
2979
2980- "actual": current balloon value in bytes (json-int)
82a56f0d
LC
2981
2982Example:
2983
2984-> { "execute": "query-balloon" }
2985<- {
2986 "return":{
2987 "actual":1073741824,
82a56f0d
LC
2988 }
2989 }
2990
28c4fa32
CB
2991query-tpm
2992---------
2993
2994Return information about the TPM device.
2995
2996Arguments: None
2997
2998Example:
2999
3000-> { "execute": "query-tpm" }
3001<- { "return":
3002 [
3003 { "model": "tpm-tis",
3004 "options":
3005 { "type": "passthrough",
3006 "data":
3007 { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
3008 "path": "/dev/tpm0"
3009 }
3010 },
3011 "id": "tpm0"
3012 }
3013 ]
3014 }
3015
28c4fa32
CB
3016query-tpm-models
3017----------------
3018
3019Return a list of supported TPM models.
3020
3021Arguments: None
3022
3023Example:
3024
3025-> { "execute": "query-tpm-models" }
3026<- { "return": [ "tpm-tis" ] }
3027
28c4fa32
CB
3028query-tpm-types
3029---------------
3030
3031Return a list of supported TPM types.
3032
3033Arguments: None
3034
3035Example:
3036
3037-> { "execute": "query-tpm-types" }
3038<- { "return": [ "passthrough" ] }
3039
f1a1a356
GH
3040chardev-add
3041----------------
3042
3043Add a chardev.
3044
3045Arguments:
3046
3047- "id": the chardev's ID, must be unique (json-string)
3048- "backend": chardev backend type + parameters
3049
ffbdbe59 3050Examples:
f1a1a356
GH
3051
3052-> { "execute" : "chardev-add",
3053 "arguments" : { "id" : "foo",
3054 "backend" : { "type" : "null", "data" : {} } } }
3055<- { "return": {} }
3056
ffbdbe59
GH
3057-> { "execute" : "chardev-add",
3058 "arguments" : { "id" : "bar",
3059 "backend" : { "type" : "file",
3060 "data" : { "out" : "/tmp/bar.log" } } } }
3061<- { "return": {} }
3062
0a1a7fab
GH
3063-> { "execute" : "chardev-add",
3064 "arguments" : { "id" : "baz",
3065 "backend" : { "type" : "pty", "data" : {} } } }
3066<- { "return": { "pty" : "/dev/pty/42" } }
3067
f1a1a356
GH
3068chardev-remove
3069--------------
3070
3071Remove a chardev.
3072
3073Arguments:
3074
3075- "id": the chardev's ID, must exist and not be in use (json-string)
3076
3077Example:
3078
3079-> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
3080<- { "return": {} }
3081
b1be4280
AK
3082query-rx-filter
3083---------------
3084
3085Show rx-filter information.
3086
3087Returns a json-array of rx-filter information for all NICs (or for the
3088given NIC), returning an error if the given NIC doesn't exist, or
3089given NIC doesn't support rx-filter querying, or given net client
3090isn't a NIC.
3091
3092The query will clear the event notification flag of each NIC, then qemu
3093will start to emit event to QMP monitor.
3094
3095Each array entry contains the following:
3096
3097- "name": net client name (json-string)
3098- "promiscuous": promiscuous mode is enabled (json-bool)
3099- "multicast": multicast receive state (one of 'normal', 'none', 'all')
3100- "unicast": unicast receive state (one of 'normal', 'none', 'all')
f7bc8ef8 3101- "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0)
b1be4280
AK
3102- "broadcast-allowed": allow to receive broadcast (json-bool)
3103- "multicast-overflow": multicast table is overflowed (json-bool)
3104- "unicast-overflow": unicast table is overflowed (json-bool)
3105- "main-mac": main macaddr string (json-string)
3106- "vlan-table": a json-array of active vlan id
3107- "unicast-table": a json-array of unicast macaddr string
3108- "multicast-table": a json-array of multicast macaddr string
3109
3110Example:
3111
3112-> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
3113<- { "return": [
3114 {
3115 "promiscuous": true,
3116 "name": "vnet0",
3117 "main-mac": "52:54:00:12:34:56",
3118 "unicast": "normal",
f7bc8ef8 3119 "vlan": "normal",
b1be4280
AK
3120 "vlan-table": [
3121 4,
3122 0
3123 ],
3124 "unicast-table": [
3125 ],
3126 "multicast": "normal",
3127 "multicast-overflow": false,
3128 "unicast-overflow": false,
3129 "multicast-table": [
3130 "01:00:5e:00:00:01",
3131 "33:33:00:00:00:01",
3132 "33:33:ff:12:34:56"
3133 ],
3134 "broadcast-allowed": false
3135 }
3136 ]
3137 }
3138
d26c9a15
KW
3139blockdev-add
3140------------
3141
3142Add a block device.
3143
da2cf4e8 3144This command is still a work in progress. It doesn't support all
81b936ae
AG
3145block drivers among other things. Stay away from it unless you want
3146to help with its development.
da2cf4e8 3147
0153d2f5 3148For the arguments, see the QAPI schema documentation of BlockdevOptions.
d26c9a15
KW
3149
3150Example (1):
3151
3152-> { "execute": "blockdev-add",
0153d2f5
KW
3153 "arguments": { "driver": "qcow2",
3154 "file": { "driver": "file",
3155 "filename": "test.qcow2" } } }
d26c9a15
KW
3156<- { "return": {} }
3157
3158Example (2):
3159
3160-> { "execute": "blockdev-add",
3161 "arguments": {
0153d2f5
KW
3162 "driver": "qcow2",
3163 "node-name": "my_disk",
3164 "discard": "unmap",
3165 "cache": {
3166 "direct": true,
3167 "writeback": true
3168 },
3169 "file": {
3170 "driver": "file",
3171 "filename": "/tmp/test.qcow2"
3172 },
3173 "backing": {
3174 "driver": "raw",
3175 "file": {
3176 "driver": "file",
3177 "filename": "/dev/fdset/4"
3178 }
d26c9a15
KW
3179 }
3180 }
3181 }
3182
3183<- { "return": {} }
3184
81b936ae
AG
3185x-blockdev-del
3186------------
3187Since 2.5
3188
9ec8873e
KW
3189Deletes a block device that has been added using blockdev-add.
3190The command will fail if the node is attached to a device or is
3191otherwise being used.
81b936ae
AG
3192
3193This command is still a work in progress and is considered
3194experimental. Stay away from it unless you want to help with its
3195development.
3196
3197Arguments:
3198
9ec8873e 3199- "node-name": Name of the graph node to delete (json-string)
81b936ae
AG
3200
3201Example:
3202
3203-> { "execute": "blockdev-add",
3204 "arguments": {
0153d2f5
KW
3205 "driver": "qcow2",
3206 "node-name": "node0",
3207 "file": {
3208 "driver": "file",
3209 "filename": "test.qcow2"
81b936ae
AG
3210 }
3211 }
3212 }
3213
3214<- { "return": {} }
3215
3216-> { "execute": "x-blockdev-del",
9ec8873e 3217 "arguments": { "node-name": "node0" }
81b936ae
AG
3218 }
3219<- { "return": {} }
3220
7d8a9f71
HR
3221blockdev-open-tray
3222------------------
3223
3224Opens a block device's tray. If there is a block driver state tree inserted as a
3225medium, it will become inaccessible to the guest (but it will remain associated
3226to the block device, so closing the tray will make it accessible again).
3227
3228If the tray was already open before, this will be a no-op.
3229
3230Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in
3231which no such event will be generated, these include:
3232- if the guest has locked the tray, @force is false and the guest does not
3233 respond to the eject request
3234- if the BlockBackend denoted by @device does not have a guest device attached
3235 to it
3236- if the guest device does not have an actual tray and is empty, for instance
3237 for floppy disk drives
3238
3239Arguments:
3240
b33945cf
KW
3241- "device": block device name (deprecated, use @id instead)
3242 (json-string, optional)
3243- "id": the name or QOM path of the guest device (json-string, optional)
7d8a9f71
HR
3244- "force": if false (the default), an eject request will be sent to the guest if
3245 it has locked the tray (and the tray will not be opened immediately);
3246 if true, the tray will be opened regardless of whether it is locked
3247 (json-bool, optional)
3248
3249Example:
3250
3251-> { "execute": "blockdev-open-tray",
b33945cf 3252 "arguments": { "id": "ide0-1-0" } }
7d8a9f71
HR
3253
3254<- { "timestamp": { "seconds": 1418751016,
3255 "microseconds": 716996 },
3256 "event": "DEVICE_TRAY_MOVED",
3257 "data": { "device": "ide1-cd0",
2d76e724 3258 "id": "ide0-1-0",
7d8a9f71
HR
3259 "tray-open": true } }
3260
3261<- { "return": {} }
3262
abaaf59d
HR
3263blockdev-close-tray
3264-------------------
3265
3266Closes a block device's tray. If there is a block driver state tree associated
3267with the block device (which is currently ejected), that tree will be loaded as
3268the medium.
3269
3270If the tray was already closed before, this will be a no-op.
3271
3272Arguments:
3273
b33945cf
KW
3274- "device": block device name (deprecated, use @id instead)
3275 (json-string, optional)
3276- "id": the name or QOM path of the guest device (json-string, optional)
abaaf59d
HR
3277
3278Example:
3279
3280-> { "execute": "blockdev-close-tray",
b33945cf 3281 "arguments": { "id": "ide0-1-0" } }
abaaf59d
HR
3282
3283<- { "timestamp": { "seconds": 1418751345,
3284 "microseconds": 272147 },
3285 "event": "DEVICE_TRAY_MOVED",
3286 "data": { "device": "ide1-cd0",
2d76e724 3287 "id": "ide0-1-0",
abaaf59d
HR
3288 "tray-open": false } }
3289
3290<- { "return": {} }
3291
6e0abc25
HR
3292x-blockdev-remove-medium
3293------------------------
2814f672
HR
3294
3295Removes a medium (a block driver state tree) from a block device. That block
3296device's tray must currently be open (unless there is no attached guest device).
3297
3298If the tray is open and there is no medium inserted, this will be a no-op.
3299
6e0abc25
HR
3300This command is still a work in progress and is considered experimental.
3301Stay away from it unless you want to help with its development.
3302
2814f672
HR
3303Arguments:
3304
00949bab
KW
3305- "device": block device name (deprecated, use @id instead)
3306 (json-string, optional)
3307- "id": the name or QOM path of the guest device (json-string, optional)
2814f672
HR
3308
3309Example:
3310
6e0abc25 3311-> { "execute": "x-blockdev-remove-medium",
00949bab 3312 "arguments": { "id": "ide0-1-0" } }
2814f672
HR
3313
3314<- { "error": { "class": "GenericError",
00949bab 3315 "desc": "Tray of device 'ide0-1-0' is not open" } }
2814f672
HR
3316
3317-> { "execute": "blockdev-open-tray",
00949bab 3318 "arguments": { "id": "ide0-1-0" } }
2814f672
HR
3319
3320<- { "timestamp": { "seconds": 1418751627,
3321 "microseconds": 549958 },
3322 "event": "DEVICE_TRAY_MOVED",
3323 "data": { "device": "ide1-cd0",
2d76e724 3324 "id": "ide0-1-0",
2814f672
HR
3325 "tray-open": true } }
3326
3327<- { "return": {} }
3328
6e0abc25 3329-> { "execute": "x-blockdev-remove-medium",
00949bab 3330 "arguments": { "device": "ide0-1-0" } }
2814f672
HR
3331
3332<- { "return": {} }
3333
6e0abc25
HR
3334x-blockdev-insert-medium
3335------------------------
d1299882
HR
3336
3337Inserts a medium (a block driver state tree) into a block device. That block
3338device's tray must currently be open (unless there is no attached guest device)
3339and there must be no medium inserted already.
3340
6e0abc25
HR
3341This command is still a work in progress and is considered experimental.
3342Stay away from it unless you want to help with its development.
3343
d1299882
HR
3344Arguments:
3345
716df217
KW
3346- "device": block device name (deprecated, use @id instead)
3347 (json-string, optional)
3348- "id": the name or QOM path of the guest device (json-string, optional)
d1299882
HR
3349- "node-name": root node of the BDS tree to insert into the block device
3350
3351Example:
3352
3353-> { "execute": "blockdev-add",
0153d2f5
KW
3354 "arguments": { { "node-name": "node0",
3355 "driver": "raw",
3356 "file": { "driver": "file",
3357 "filename": "fedora.iso" } } }
d1299882
HR
3358
3359<- { "return": {} }
3360
6e0abc25 3361-> { "execute": "x-blockdev-insert-medium",
716df217 3362 "arguments": { "id": "ide0-1-0",
d1299882
HR
3363 "node-name": "node0" } }
3364
3365<- { "return": {} }
3366
7f821597
WC
3367x-blockdev-change
3368-----------------
3369
3370Dynamically reconfigure the block driver state graph. It can be used
3371to add, remove, insert or replace a graph node. Currently only the
3372Quorum driver implements this feature to add or remove its child. This
3373is useful to fix a broken quorum child.
3374
3375If @node is specified, it will be inserted under @parent. @child
3376may not be specified in this case. If both @parent and @child are
3377specified but @node is not, @child will be detached from @parent.
3378
3379Arguments:
3380- "parent": the id or name of the parent node (json-string)
3381- "child": the name of a child under the given parent node (json-string, optional)
3382- "node": the name of the node that will be added (json-string, optional)
3383
3384Note: this command is experimental, and not a stable API. It doesn't
3385support all kinds of operations, all kinds of children, nor all block
3386drivers.
3387
3388Warning: The data in a new quorum child MUST be consistent with that of
3389the rest of the array.
3390
3391Example:
3392
3393Add a new node to a quorum
3394-> { "execute": "blockdev-add",
0153d2f5
KW
3395 "arguments": { "driver": "raw",
3396 "node-name": "new_node",
3397 "file": { "driver": "file",
3398 "filename": "test.raw" } } }
7f821597
WC
3399<- { "return": {} }
3400-> { "execute": "x-blockdev-change",
3401 "arguments": { "parent": "disk1",
3402 "node": "new_node" } }
3403<- { "return": {} }
3404
3405Delete a quorum's node
3406-> { "execute": "x-blockdev-change",
3407 "arguments": { "parent": "disk1",
3408 "child": "children.1" } }
3409<- { "return": {} }
3410
bdf05133
MAL
3411query-named-block-nodes
3412-----------------------
c13163fb
BC
3413
3414Return a list of BlockDeviceInfo for all the named block driver nodes
3415
3416Example:
3417
3418-> { "execute": "query-named-block-nodes" }
3419<- { "return": [ { "ro":false,
3420 "drv":"qcow2",
3421 "encrypted":false,
3422 "file":"disks/test.qcow2",
3423 "node-name": "my-node",
3424 "backing_file_depth":1,
3425 "bps":1000000,
3426 "bps_rd":0,
3427 "bps_wr":0,
3428 "iops":1000000,
3429 "iops_rd":0,
3430 "iops_wr":0,
3431 "bps_max": 8000000,
3432 "bps_rd_max": 0,
3433 "bps_wr_max": 0,
3434 "iops_max": 0,
3435 "iops_rd_max": 0,
3436 "iops_wr_max": 0,
3437 "iops_size": 0,
e2462113 3438 "write_threshold": 0,
c13163fb
BC
3439 "image":{
3440 "filename":"disks/test.qcow2",
3441 "format":"qcow2",
3442 "virtual-size":2048000,
3443 "backing_file":"base.qcow2",
3444 "full-backing-filename":"disks/base.qcow2",
5403432f 3445 "backing-filename-format":"qcow2",
c13163fb
BC
3446 "snapshots":[
3447 {
3448 "id": "1",
3449 "name": "snapshot1",
3450 "vm-state-size": 0,
3451 "date-sec": 10000200,
3452 "date-nsec": 12,
3453 "vm-clock-sec": 206,
3454 "vm-clock-nsec": 30
3455 }
3456 ],
3457 "backing-image":{
3458 "filename":"disks/base.qcow2",
3459 "format":"qcow2",
3460 "virtual-size":2048000
3461 }
c059451c 3462 } } ] }
c13163fb 3463
24fb4133
HR
3464blockdev-change-medium
3465----------------------
3466
3467Changes the medium inserted into a block device by ejecting the current medium
3468and loading a new image file which is inserted as the new medium.
3469
3470Arguments:
3471
70e2cb3b
KW
3472- "device": block device name (deprecated, use @id instead)
3473 (json-string, optional)
3474- "id": the name or QOM path of the guest device (json-string, optional)
24fb4133
HR
3475- "filename": filename of the new image (json-string)
3476- "format": format of the new image (json-string, optional)
39ff43d9
HR
3477- "read-only-mode": new read-only mode (json-string, optional)
3478 - Possible values: "retain" (default), "read-only", "read-write"
24fb4133
HR
3479
3480Examples:
3481
34821. Change a removable medium
3483
3484-> { "execute": "blockdev-change-medium",
70e2cb3b 3485 "arguments": { "id": "ide0-1-0",
24fb4133
HR
3486 "filename": "/srv/images/Fedora-12-x86_64-DVD.iso",
3487 "format": "raw" } }
3488<- { "return": {} }
3489
39ff43d9
HR
34902. Load a read-only medium into a writable drive
3491
3492-> { "execute": "blockdev-change-medium",
70e2cb3b 3493 "arguments": { "id": "floppyA",
39ff43d9
HR
3494 "filename": "/srv/images/ro.img",
3495 "format": "raw",
3496 "read-only-mode": "retain" } }
3497
3498<- { "error":
3499 { "class": "GenericError",
3500 "desc": "Could not open '/srv/images/ro.img': Permission denied" } }
3501
3502-> { "execute": "blockdev-change-medium",
70e2cb3b 3503 "arguments": { "id": "floppyA",
39ff43d9
HR
3504 "filename": "/srv/images/ro.img",
3505 "format": "raw",
3506 "read-only-mode": "read-only" } }
3507
3508<- { "return": {} }
3509
76b5d850
HT
3510query-memdev
3511------------
3512
3513Show memory devices information.
3514
3515
3516Example (1):
3517
3518-> { "execute": "query-memdev" }
3519<- { "return": [
3520 {
3521 "size": 536870912,
3522 "merge": false,
3523 "dump": true,
3524 "prealloc": false,
3525 "host-nodes": [0, 1],
3526 "policy": "bind"
3527 },
3528 {
3529 "size": 536870912,
3530 "merge": false,
3531 "dump": true,
3532 "prealloc": true,
3533 "host-nodes": [2, 3],
3534 "policy": "preferred"
3535 }
3536 ]
3537 }
3538
bdf05133 3539query-memory-devices
6f2e2730
IM
3540--------------------
3541
3542Return a list of memory devices.
3543
3544Example:
3545-> { "execute": "query-memory-devices" }
3546<- { "return": [ { "data":
3547 { "addr": 5368709120,
3548 "hotpluggable": true,
3549 "hotplugged": true,
3550 "id": "d1",
3551 "memdev": "/objects/memX",
3552 "node": 0,
3553 "size": 1073741824,
3554 "slot": 0},
3555 "type": "dimm"
3556 } ] }
bdf05133 3557
bdf05133
MAL
3558query-acpi-ospm-status
3559----------------------
02419bcb
IM
3560
3561Return list of ACPIOSTInfo for devices that support status reporting
3562via ACPI _OST method.
3563
3564Example:
3565-> { "execute": "query-acpi-ospm-status" }
3566<- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
3567 { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
3568 { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
3569 { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
3570 ]}
bdf05133 3571
f2ae8abf
MT
3572rtc-reset-reinjection
3573---------------------
3574
3575Reset the RTC interrupt reinjection backlog.
3576
3577Arguments: None.
3578
3579Example:
3580
3581-> { "execute": "rtc-reset-reinjection" }
3582<- { "return": {} }
bdf05133 3583
1dde0f48
LV
3584trace-event-get-state
3585---------------------
3586
3587Query the state of events.
3588
77e2b172
LV
3589Arguments:
3590
3591- "name": Event name pattern (json-string).
3592- "vcpu": The vCPU to query, any vCPU by default (json-int, optional).
3593
3594An event is returned if:
3595- its name matches the "name" pattern, and
3596- if "vcpu" is given, the event has the "vcpu" property.
3597
3598Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3599returning their state on the specified vCPU. Special case: if "name" is an exact
3600match, "vcpu" is given and the event does not have the "vcpu" property, an error
3601is returned.
3602
1dde0f48
LV
3603Example:
3604
3605-> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } }
3606<- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] }
bdf05133 3607
1dde0f48
LV
3608trace-event-set-state
3609---------------------
3610
3611Set the state of events.
3612
77e2b172
LV
3613Arguments:
3614
3615- "name": Event name pattern (json-string).
3616- "enable": Whether to enable or disable the event (json-bool).
3617- "ignore-unavailable": Whether to ignore errors for events that cannot be
3618 changed (json-bool, optional).
3619- "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional).
3620
3621An event's state is modified if:
3622- its name matches the "name" pattern, and
3623- if "vcpu" is given, the event has the "vcpu" property.
3624
3625Therefore, if "vcpu" is given, the operation will only match per-vCPU events,
3626setting their state on the specified vCPU. Special case: if "name" is an exact
3627match, "vcpu" is given and the event does not have the "vcpu" property, an error
3628is returned.
3629
1dde0f48
LV
3630Example:
3631
3632-> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } }
3633<- { "return": {} }
bdf05133 3634
bdf05133
MAL
3635input-send-event
3636----------------
50c6617f
MT
3637
3638Send input event to guest.
3639
3640Arguments:
3641
b98d26e3
GH
3642- "device": display device (json-string, optional)
3643- "head": display head (json-int, optional)
3644- "events": list of input events
50c6617f
MT
3645
3646The consoles are visible in the qom tree, under
3647/backend/console[$index]. They have a device link and head property, so
3648it is possible to map which console belongs to which device and display.
3649
3650Example (1):
3651
3652Press left mouse button.
3653
6575ccdd 3654-> { "execute": "input-send-event",
b98d26e3 3655 "arguments": { "device": "video0",
50c6617f 3656 "events": [ { "type": "btn",
f22d0af0 3657 "data" : { "down": true, "button": "left" } } ] } }
50c6617f
MT
3658<- { "return": {} }
3659
6575ccdd 3660-> { "execute": "input-send-event",
b98d26e3 3661 "arguments": { "device": "video0",
50c6617f 3662 "events": [ { "type": "btn",
f22d0af0 3663 "data" : { "down": false, "button": "left" } } ] } }
50c6617f
MT
3664<- { "return": {} }
3665
3666Example (2):
3667
3668Press ctrl-alt-del.
3669
6575ccdd 3670-> { "execute": "input-send-event",
b98d26e3 3671 "arguments": { "events": [
50c6617f
MT
3672 { "type": "key", "data" : { "down": true,
3673 "key": {"type": "qcode", "data": "ctrl" } } },
3674 { "type": "key", "data" : { "down": true,
3675 "key": {"type": "qcode", "data": "alt" } } },
3676 { "type": "key", "data" : { "down": true,
3677 "key": {"type": "qcode", "data": "delete" } } } ] } }
3678<- { "return": {} }
3679
3680Example (3):
3681
3682Move mouse pointer to absolute coordinates (20000, 400).
3683
6575ccdd 3684-> { "execute": "input-send-event" ,
b98d26e3 3685 "arguments": { "events": [
01df5143
GH
3686 { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
3687 { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
50c6617f
MT
3688<- { "return": {} }
3689
e2462113
FR
3690block-set-write-threshold
3691------------
3692
3693Change the write threshold for a block drive. The threshold is an offset,
3694thus must be non-negative. Default is no write threshold.
3695Setting the threshold to zero disables it.
3696
3697Arguments:
3698
3699- "node-name": the node name in the block driver state graph (json-string)
3700- "write-threshold": the write threshold in bytes (json-int)
3701
3702Example:
3703
3704-> { "execute": "block-set-write-threshold",
3705 "arguments": { "node-name": "mydev",
3706 "write-threshold": 17179869184 } }
3707<- { "return": {} }
3708
fafa4d50
SF
3709Show rocker switch
3710------------------
3711
3712Arguments:
3713
3714- "name": switch name
3715
3716Example:
3717
3718-> { "execute": "query-rocker", "arguments": { "name": "sw1" } }
3719<- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}}
3720
fafa4d50
SF
3721Show rocker switch ports
3722------------------------
3723
3724Arguments:
3725
3726- "name": switch name
3727
3728Example:
3729
3730-> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } }
3731<- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1",
3732 "autoneg": "off", "link-up": true, "speed": 10000},
3733 {"duplex": "full", "enabled": true, "name": "sw1.2",
3734 "autoneg": "off", "link-up": true, "speed": 10000}
3735 ]}
3736
fafa4d50
SF
3737Show rocker switch OF-DPA flow tables
3738-------------------------------------
3739
3740Arguments:
3741
3742- "name": switch name
3743- "tbl-id": (optional) flow table ID
3744
3745Example:
3746
3747-> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } }
3748<- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0},
3749 "hits": 138,
3750 "cookie": 0,
3751 "action": {"goto-tbl": 10},
3752 "mask": {"in-pport": 4294901760}
3753 },
3754 {...more...},
3755 ]}
3756
fafa4d50
SF
3757Show rocker OF-DPA group tables
3758-------------------------------
3759
3760Arguments:
3761
3762- "name": switch name
3763- "type": (optional) group type
3764
3765Example:
3766
3767-> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } }
3768<- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841,
3769 "pop-vlan": 1, "id": 251723778},
3770 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841,
3771 "pop-vlan": 1, "id": 251723776},
3772 {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840,
3773 "pop-vlan": 1, "id": 251658241},
3774 {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840,
3775 "pop-vlan": 1, "id": 251658240}
3776 ]}
ae50a770 3777
ae50a770
PX
3778query-gic-capabilities
3779---------------
3780
3781Return a list of GICCapability objects, describing supported GIC
3782(Generic Interrupt Controller) versions.
3783
3784Arguments: None
3785
3786Example:
3787
3788-> { "execute": "query-gic-capabilities" }
3789<- { "return": [{ "version": 2, "emulated": true, "kernel": false },
3790 { "version": 3, "emulated": false, "kernel": true } ] }
3791
d4633541
IM
3792Show existing/possible CPUs
3793---------------------------
3794
3795Arguments: None.
3796
3797Example for pseries machine type started with
3798-smp 2,cores=2,maxcpus=4 -cpu POWER8:
3799
3800-> { "execute": "query-hotpluggable-cpus" }
3801<- {"return": [
13f5e800 3802 { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core",
d4633541 3803 "vcpus-count": 1 },
13f5e800 3804 { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core",
d4633541
IM
3805 "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3806 ]}'
4d952914
IM
3807
3808Example for pc machine type started with
3809-smp 1,maxcpus=2:
3810 -> { "execute": "query-hotpluggable-cpus" }
3811 <- {"return": [
3812 {
3813 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3814 "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3815 },
3816 {
3817 "qom-path": "/machine/unattached/device[0]",
3818 "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3819 "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3820 }
3821 ]}
This page took 1.096784 seconds and 4 git commands to generate.