]> git.proxmox.com Git - mirror_qemu.git/blob - docs/qmp-commands.txt
qmp-commands: move 'xen-load-devices-state' doc to schema
[mirror_qemu.git] / docs / qmp-commands.txt
1 QMP Supported Commands
2 ----------------------
3
4 This document describes all commands currently supported by QMP.
5
6 Most of the time their usage is exactly the same as in the user Monitor, this
7 means that any other document which also describe commands (the manpage,
8 QEMU's manual, etc) can and should be consulted.
9
10 QMP has two types of commands: regular and query commands. Regular commands
11 usually change the Virtual Machine's state someway, while query commands just
12 return information. The sections below are divided accordingly.
13
14 It's important to observe that all communication examples are formatted in
15 a reader-friendly way, so that they're easier to understand. However, in real
16 protocol usage, they're emitted as a single line.
17
18 Also, the following notation is used to denote data flow:
19
20 -> data issued by the Client
21 <- Server data response
22
23 Please, refer to the QMP specification (docs/qmp-spec.txt) for detailed
24 information on the Server command and response formats.
25
26 NOTE: This document is temporary and will be replaced soon.
27
28 1. Stability Considerations
29 ===========================
30
31 The current QMP command set (described in this file) may be useful for a
32 number of use cases, however it's limited and several commands have bad
33 defined semantics, specially with regard to command completion.
34
35 These problems are going to be solved incrementally in the next QEMU releases
36 and we're going to establish a deprecation policy for badly defined commands.
37
38 If you're planning to adopt QMP, please observe the following:
39
40 1. The deprecation policy will take effect and be documented soon, please
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
50 2. Regular Commands
51 ===================
52
53 Server's responses in the examples below are always a success response, please
54 refer to the QMP specification for more details on error responses.
55
56 device_add
57 ----------
58
59 Add a device.
60
61 Arguments:
62
63 - "driver": the name of the new device's driver (json-string)
64 - "bus": the device's parent bus (device tree path, json-string, optional)
65 - "id": the device's ID, must be unique (json-string)
66 - device properties
67
68 Example:
69
70 -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } }
71 <- { "return": {} }
72
73 Notes:
74
75 (1) For detailed information about this command, please refer to the
76 'docs/qdev-device-use.txt' file.
77
78 (2) It's possible to list device properties by running QEMU with the
79 "-device DEVICE,\?" command-line argument, where DEVICE is the device's name
80
81 cpu
82 ---
83
84 Set the default CPU.
85
86 Arguments:
87
88 - "index": the CPU's index (json-int)
89
90 Example:
91
92 -> { "execute": "cpu", "arguments": { "index": 0 } }
93 <- { "return": {} }
94
95 Note: CPUs' indexes are obtained with the 'query-cpus' command.
96
97 x-colo-lost-heartbeat
98 --------------------
99
100 Tell COLO that heartbeat is lost, a failover or takeover is needed.
101
102 Example:
103
104 -> { "execute": "x-colo-lost-heartbeat" }
105 <- { "return": {} }
106
107 qmp_capabilities
108 ----------------
109
110 Enable QMP capabilities.
111
112 Arguments: None.
113
114 Example:
115
116 -> { "execute": "qmp_capabilities" }
117 <- { "return": {} }
118
119 Note: This command must be issued before issuing any other command.
120
121 3. Query Commands
122 =================
123
124
125 query-qmp-schema
126 ----------------
127
128 Return the QMP wire schema. The returned value is a json-array of
129 named schema entities. Entities are commands, events and various
130 types. See docs/qapi-code-gen.txt for information on their structure
131 and intended use.