]>
Commit | Line | Data |
---|---|---|
82a56f0d | 1 | HXCOMM QMP dispatch table and documentation |
3599d46b | 2 | HXCOMM Text between SQMP and EQMP is copied to the QMP documentation file and |
82a56f0d LC |
3 | HXCOMM does not show up in the other formats. |
4 | ||
5 | SQMP | |
6 | QMP Supported Commands | |
7 | ---------------------- | |
8 | ||
9 | This document describes all commands currently supported by QMP. | |
10 | ||
11 | Most of the time their usage is exactly the same as in the user Monitor, this | |
12 | means that any other document which also describe commands (the manpage, | |
13 | QEMU's manual, etc) can and should be consulted. | |
14 | ||
15 | QMP has two types of commands: regular and query commands. Regular commands | |
16 | usually change the Virtual Machine's state someway, while query commands just | |
17 | return information. The sections below are divided accordingly. | |
18 | ||
19 | It's important to observe that all communication examples are formatted in | |
20 | a reader-friendly way, so that they're easier to understand. However, in real | |
21 | protocol usage, they're emitted as a single line. | |
22 | ||
23 | Also, the following notation is used to denote data flow: | |
24 | ||
25 | -> data issued by the Client | |
26 | <- Server data response | |
27 | ||
28 | Please, refer to the QMP specification (QMP/qmp-spec.txt) for detailed | |
29 | information on the Server command and response formats. | |
30 | ||
31 | NOTE: This document is temporary and will be replaced soon. | |
32 | ||
33 | 1. Stability Considerations | |
34 | =========================== | |
35 | ||
36 | The current QMP command set (described in this file) may be useful for a | |
37 | number of use cases, however it's limited and several commands have bad | |
38 | defined semantics, specially with regard to command completion. | |
39 | ||
40 | These problems are going to be solved incrementally in the next QEMU releases | |
41 | and we're going to establish a deprecation policy for badly defined commands. | |
42 | ||
43 | If you're planning to adopt QMP, please observe the following: | |
44 | ||
c20cdf8b | 45 | 1. The deprecation policy will take effect and be documented soon, please |
82a56f0d LC |
46 | check the documentation of each used command as soon as a new release of |
47 | QEMU is available | |
48 | ||
49 | 2. DO NOT rely on anything which is not explicit documented | |
50 | ||
51 | 3. Errors, in special, are not documented. Applications should NOT check | |
52 | for specific errors classes or data (it's strongly recommended to only | |
53 | check for the "error" key) | |
54 | ||
55 | 2. Regular Commands | |
56 | =================== | |
57 | ||
58 | Server's responses in the examples below are always a success response, please | |
59 | refer to the QMP specification for more details on error responses. | |
60 | ||
61 | EQMP | |
62 | ||
63 | { | |
64 | .name = "quit", | |
65 | .args_type = "", | |
7fad30f0 | 66 | .mhandler.cmd_new = qmp_marshal_quit, |
82a56f0d LC |
67 | }, |
68 | ||
69 | SQMP | |
70 | quit | |
71 | ---- | |
72 | ||
73 | Quit the emulator. | |
74 | ||
75 | Arguments: None. | |
76 | ||
77 | Example: | |
78 | ||
79 | -> { "execute": "quit" } | |
80 | <- { "return": {} } | |
81 | ||
82 | EQMP | |
83 | ||
84 | { | |
85 | .name = "eject", | |
86 | .args_type = "force:-f,device:B", | |
7fad30f0 | 87 | .mhandler.cmd_new = qmp_marshal_eject, |
82a56f0d LC |
88 | }, |
89 | ||
90 | SQMP | |
91 | eject | |
92 | ----- | |
93 | ||
94 | Eject a removable medium. | |
95 | ||
96 | Arguments: | |
97 | ||
98 | - force: force ejection (json-bool, optional) | |
99 | - device: device name (json-string) | |
100 | ||
101 | Example: | |
102 | ||
103 | -> { "execute": "eject", "arguments": { "device": "ide1-cd0" } } | |
104 | <- { "return": {} } | |
105 | ||
106 | Note: The "force" argument defaults to false. | |
107 | ||
108 | EQMP | |
109 | ||
110 | { | |
111 | .name = "change", | |
112 | .args_type = "device:B,target:F,arg:s?", | |
7fad30f0 | 113 | .mhandler.cmd_new = qmp_marshal_change, |
82a56f0d LC |
114 | }, |
115 | ||
116 | SQMP | |
117 | change | |
118 | ------ | |
119 | ||
120 | Change a removable medium or VNC configuration. | |
121 | ||
122 | Arguments: | |
123 | ||
124 | - "device": device name (json-string) | |
125 | - "target": filename or item (json-string) | |
126 | - "arg": additional argument (json-string, optional) | |
127 | ||
128 | Examples: | |
129 | ||
130 | 1. Change a removable medium | |
131 | ||
132 | -> { "execute": "change", | |
133 | "arguments": { "device": "ide1-cd0", | |
134 | "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } } | |
135 | <- { "return": {} } | |
136 | ||
137 | 2. Change VNC password | |
138 | ||
139 | -> { "execute": "change", | |
140 | "arguments": { "device": "vnc", "target": "password", | |
141 | "arg": "foobar1" } } | |
142 | <- { "return": {} } | |
143 | ||
144 | EQMP | |
145 | ||
146 | { | |
147 | .name = "screendump", | |
148 | .args_type = "filename:F", | |
7fad30f0 | 149 | .mhandler.cmd_new = qmp_marshal_screendump, |
82a56f0d LC |
150 | }, |
151 | ||
152 | SQMP | |
153 | screendump | |
154 | ---------- | |
155 | ||
156 | Save screen into PPM image. | |
157 | ||
158 | Arguments: | |
159 | ||
160 | - "filename": file path (json-string) | |
161 | ||
162 | Example: | |
163 | ||
164 | -> { "execute": "screendump", "arguments": { "filename": "/tmp/image" } } | |
165 | <- { "return": {} } | |
166 | ||
167 | EQMP | |
168 | ||
169 | { | |
170 | .name = "stop", | |
171 | .args_type = "", | |
7fad30f0 | 172 | .mhandler.cmd_new = qmp_marshal_stop, |
82a56f0d LC |
173 | }, |
174 | ||
175 | SQMP | |
176 | stop | |
177 | ---- | |
178 | ||
179 | Stop the emulator. | |
180 | ||
181 | Arguments: None. | |
182 | ||
183 | Example: | |
184 | ||
185 | -> { "execute": "stop" } | |
186 | <- { "return": {} } | |
187 | ||
188 | EQMP | |
189 | ||
190 | { | |
191 | .name = "cont", | |
192 | .args_type = "", | |
7fad30f0 | 193 | .mhandler.cmd_new = qmp_marshal_cont, |
82a56f0d LC |
194 | }, |
195 | ||
196 | SQMP | |
197 | cont | |
198 | ---- | |
199 | ||
200 | Resume emulation. | |
201 | ||
202 | Arguments: None. | |
203 | ||
204 | Example: | |
205 | ||
206 | -> { "execute": "cont" } | |
207 | <- { "return": {} } | |
9b9df25a GH |
208 | |
209 | EQMP | |
210 | ||
211 | { | |
212 | .name = "system_wakeup", | |
213 | .args_type = "", | |
7fad30f0 | 214 | .mhandler.cmd_new = qmp_marshal_system_wakeup, |
9b9df25a GH |
215 | }, |
216 | ||
217 | SQMP | |
218 | system_wakeup | |
219 | ------------- | |
220 | ||
221 | Wakeup guest from suspend. | |
222 | ||
223 | Arguments: None. | |
224 | ||
225 | Example: | |
226 | ||
227 | -> { "execute": "system_wakeup" } | |
228 | <- { "return": {} } | |
82a56f0d LC |
229 | |
230 | EQMP | |
231 | ||
232 | { | |
233 | .name = "system_reset", | |
234 | .args_type = "", | |
7fad30f0 | 235 | .mhandler.cmd_new = qmp_marshal_system_reset, |
82a56f0d LC |
236 | }, |
237 | ||
238 | SQMP | |
239 | system_reset | |
240 | ------------ | |
241 | ||
242 | Reset the system. | |
243 | ||
244 | Arguments: None. | |
245 | ||
246 | Example: | |
247 | ||
248 | -> { "execute": "system_reset" } | |
249 | <- { "return": {} } | |
250 | ||
251 | EQMP | |
252 | ||
253 | { | |
254 | .name = "system_powerdown", | |
255 | .args_type = "", | |
7fad30f0 | 256 | .mhandler.cmd_new = qmp_marshal_system_powerdown, |
82a56f0d LC |
257 | }, |
258 | ||
259 | SQMP | |
260 | system_powerdown | |
261 | ---------------- | |
262 | ||
263 | Send system power down event. | |
264 | ||
265 | Arguments: None. | |
266 | ||
267 | Example: | |
268 | ||
269 | -> { "execute": "system_powerdown" } | |
270 | <- { "return": {} } | |
271 | ||
272 | EQMP | |
273 | ||
274 | { | |
275 | .name = "device_add", | |
276 | .args_type = "device:O", | |
277 | .params = "driver[,prop=value][,...]", | |
278 | .help = "add device, like -device on the command line", | |
485febc6 | 279 | .mhandler.cmd_new = qmp_device_add, |
82a56f0d LC |
280 | }, |
281 | ||
282 | SQMP | |
283 | device_add | |
284 | ---------- | |
285 | ||
286 | Add a device. | |
287 | ||
288 | Arguments: | |
289 | ||
290 | - "driver": the name of the new device's driver (json-string) | |
291 | - "bus": the device's parent bus (device tree path, json-string, optional) | |
292 | - "id": the device's ID, must be unique (json-string) | |
293 | - device properties | |
294 | ||
295 | Example: | |
296 | ||
297 | -> { "execute": "device_add", "arguments": { "driver": "e1000", "id": "net1" } } | |
298 | <- { "return": {} } | |
299 | ||
300 | Notes: | |
301 | ||
302 | (1) For detailed information about this command, please refer to the | |
303 | 'docs/qdev-device-use.txt' file. | |
304 | ||
305 | (2) It's possible to list device properties by running QEMU with the | |
306 | "-device DEVICE,\?" command-line argument, where DEVICE is the device's name | |
307 | ||
308 | EQMP | |
309 | ||
310 | { | |
311 | .name = "device_del", | |
312 | .args_type = "id:s", | |
7fad30f0 | 313 | .mhandler.cmd_new = qmp_marshal_device_del, |
82a56f0d LC |
314 | }, |
315 | ||
316 | SQMP | |
317 | device_del | |
318 | ---------- | |
319 | ||
320 | Remove a device. | |
321 | ||
322 | Arguments: | |
323 | ||
6287d827 | 324 | - "id": the device's ID or QOM path (json-string) |
82a56f0d LC |
325 | |
326 | Example: | |
327 | ||
328 | -> { "execute": "device_del", "arguments": { "id": "net1" } } | |
329 | <- { "return": {} } | |
330 | ||
6287d827 DB |
331 | Example: |
332 | ||
333 | -> { "execute": "device_del", "arguments": { "id": "/machine/peripheral-anon/device[0]" } } | |
334 | <- { "return": {} } | |
335 | ||
e4c8f004 AK |
336 | EQMP |
337 | ||
338 | { | |
339 | .name = "send-key", | |
43d0a2c1 | 340 | .args_type = "keys:q,hold-time:i?", |
7fad30f0 | 341 | .mhandler.cmd_new = qmp_marshal_send_key, |
e4c8f004 AK |
342 | }, |
343 | ||
344 | SQMP | |
345 | send-key | |
346 | ---------- | |
347 | ||
348 | Send keys to VM. | |
349 | ||
350 | Arguments: | |
351 | ||
352 | keys array: | |
f9b1d9b2 AK |
353 | - "key": key sequence (a json-array of key union values, |
354 | union can be number or qcode enum) | |
e4c8f004 AK |
355 | |
356 | - hold-time: time to delay key up events, milliseconds. Defaults to 100 | |
357 | (json-int, optional) | |
358 | ||
359 | Example: | |
360 | ||
361 | -> { "execute": "send-key", | |
f9b1d9b2 AK |
362 | "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" }, |
363 | { "type": "qcode", "data": "alt" }, | |
364 | { "type": "qcode", "data": "delete" } ] } } | |
e4c8f004 AK |
365 | <- { "return": {} } |
366 | ||
82a56f0d LC |
367 | EQMP |
368 | ||
369 | { | |
370 | .name = "cpu", | |
371 | .args_type = "index:i", | |
7fad30f0 | 372 | .mhandler.cmd_new = qmp_marshal_cpu, |
82a56f0d LC |
373 | }, |
374 | ||
375 | SQMP | |
376 | cpu | |
377 | --- | |
378 | ||
379 | Set the default CPU. | |
380 | ||
381 | Arguments: | |
382 | ||
383 | - "index": the CPU's index (json-int) | |
384 | ||
385 | Example: | |
386 | ||
387 | -> { "execute": "cpu", "arguments": { "index": 0 } } | |
388 | <- { "return": {} } | |
389 | ||
390 | Note: CPUs' indexes are obtained with the 'query-cpus' command. | |
391 | ||
69ca3ea5 IM |
392 | EQMP |
393 | ||
394 | { | |
395 | .name = "cpu-add", | |
396 | .args_type = "id:i", | |
7fad30f0 | 397 | .mhandler.cmd_new = qmp_marshal_cpu_add, |
69ca3ea5 IM |
398 | }, |
399 | ||
400 | SQMP | |
401 | cpu-add | |
402 | ------- | |
403 | ||
404 | Adds virtual cpu | |
405 | ||
406 | Arguments: | |
407 | ||
408 | - "id": cpu id (json-int) | |
409 | ||
410 | Example: | |
411 | ||
412 | -> { "execute": "cpu-add", "arguments": { "id": 2 } } | |
413 | <- { "return": {} } | |
414 | ||
82a56f0d LC |
415 | EQMP |
416 | ||
417 | { | |
418 | .name = "memsave", | |
0cfd6a9a | 419 | .args_type = "val:l,size:i,filename:s,cpu:i?", |
7fad30f0 | 420 | .mhandler.cmd_new = qmp_marshal_memsave, |
82a56f0d LC |
421 | }, |
422 | ||
423 | SQMP | |
424 | memsave | |
425 | ------- | |
426 | ||
427 | Save to disk virtual memory dump starting at 'val' of size 'size'. | |
428 | ||
429 | Arguments: | |
430 | ||
431 | - "val": the starting address (json-int) | |
432 | - "size": the memory size, in bytes (json-int) | |
433 | - "filename": file path (json-string) | |
0cfd6a9a | 434 | - "cpu": virtual CPU index (json-int, optional) |
82a56f0d LC |
435 | |
436 | Example: | |
437 | ||
438 | -> { "execute": "memsave", | |
439 | "arguments": { "val": 10, | |
440 | "size": 100, | |
441 | "filename": "/tmp/virtual-mem-dump" } } | |
442 | <- { "return": {} } | |
443 | ||
82a56f0d LC |
444 | EQMP |
445 | ||
446 | { | |
447 | .name = "pmemsave", | |
448 | .args_type = "val:l,size:i,filename:s", | |
7fad30f0 | 449 | .mhandler.cmd_new = qmp_marshal_pmemsave, |
82a56f0d LC |
450 | }, |
451 | ||
452 | SQMP | |
453 | pmemsave | |
454 | -------- | |
455 | ||
456 | Save to disk physical memory dump starting at 'val' of size 'size'. | |
457 | ||
458 | Arguments: | |
459 | ||
460 | - "val": the starting address (json-int) | |
461 | - "size": the memory size, in bytes (json-int) | |
462 | - "filename": file path (json-string) | |
463 | ||
464 | Example: | |
465 | ||
466 | -> { "execute": "pmemsave", | |
467 | "arguments": { "val": 10, | |
468 | "size": 100, | |
469 | "filename": "/tmp/physical-mem-dump" } } | |
470 | <- { "return": {} } | |
471 | ||
a4046664 LJ |
472 | EQMP |
473 | ||
474 | { | |
475 | .name = "inject-nmi", | |
476 | .args_type = "", | |
7fad30f0 | 477 | .mhandler.cmd_new = qmp_marshal_inject_nmi, |
a4046664 LJ |
478 | }, |
479 | ||
480 | SQMP | |
481 | inject-nmi | |
482 | ---------- | |
483 | ||
9cb805fd | 484 | Inject an NMI on the default CPU (x86/s390) or all CPUs (ppc64). |
a4046664 LJ |
485 | |
486 | Arguments: None. | |
487 | ||
488 | Example: | |
489 | ||
490 | -> { "execute": "inject-nmi" } | |
491 | <- { "return": {} } | |
492 | ||
de253f14 | 493 | Note: inject-nmi fails when the guest doesn't support injecting. |
a4046664 | 494 | |
1f590cf9 LL |
495 | EQMP |
496 | ||
497 | { | |
3949e594 | 498 | .name = "ringbuf-write", |
82e59a67 | 499 | .args_type = "device:s,data:s,format:s?", |
7fad30f0 | 500 | .mhandler.cmd_new = qmp_marshal_ringbuf_write, |
1f590cf9 LL |
501 | }, |
502 | ||
503 | SQMP | |
3949e594 | 504 | ringbuf-write |
1f590cf9 LL |
505 | ------------- |
506 | ||
3949e594 | 507 | Write to a ring buffer character device. |
1f590cf9 LL |
508 | |
509 | Arguments: | |
510 | ||
3949e594 MA |
511 | - "device": ring buffer character device name (json-string) |
512 | - "data": data to write (json-string) | |
513 | - "format": data format (json-string, optional) | |
514 | - Possible values: "utf8" (default), "base64" | |
1f590cf9 LL |
515 | |
516 | Example: | |
517 | ||
3949e594 MA |
518 | -> { "execute": "ringbuf-write", |
519 | "arguments": { "device": "foo", | |
1f590cf9 LL |
520 | "data": "abcdefgh", |
521 | "format": "utf8" } } | |
522 | <- { "return": {} } | |
523 | ||
49b6d722 LL |
524 | EQMP |
525 | ||
526 | { | |
3949e594 | 527 | .name = "ringbuf-read", |
49b6d722 | 528 | .args_type = "device:s,size:i,format:s?", |
7fad30f0 | 529 | .mhandler.cmd_new = qmp_marshal_ringbuf_read, |
49b6d722 LL |
530 | }, |
531 | ||
532 | SQMP | |
3949e594 | 533 | ringbuf-read |
49b6d722 LL |
534 | ------------- |
535 | ||
3949e594 | 536 | Read from a ring buffer character device. |
49b6d722 LL |
537 | |
538 | Arguments: | |
539 | ||
3949e594 MA |
540 | - "device": ring buffer character device name (json-string) |
541 | - "size": how many bytes to read at most (json-int) | |
542 | - Number of data bytes, not number of characters in encoded data | |
543 | - "format": data format (json-string, optional) | |
544 | - Possible values: "utf8" (default), "base64" | |
545 | - Naturally, format "utf8" works only when the ring buffer | |
546 | contains valid UTF-8 text. Invalid UTF-8 sequences get | |
547 | replaced. Bug: replacement doesn't work. Bug: can screw | |
548 | up on encountering NUL characters, after the ring buffer | |
549 | lost data, and when reading stops because the size limit | |
550 | is reached. | |
49b6d722 LL |
551 | |
552 | Example: | |
553 | ||
3949e594 MA |
554 | -> { "execute": "ringbuf-read", |
555 | "arguments": { "device": "foo", | |
49b6d722 LL |
556 | "size": 1000, |
557 | "format": "utf8" } } | |
3ab651fc | 558 | <- {"return": "abcdefgh"} |
49b6d722 | 559 | |
a7ae8355 SS |
560 | EQMP |
561 | ||
562 | { | |
563 | .name = "xen-save-devices-state", | |
564 | .args_type = "filename:F", | |
7fad30f0 | 565 | .mhandler.cmd_new = qmp_marshal_xen_save_devices_state, |
a7ae8355 SS |
566 | }, |
567 | ||
568 | SQMP | |
569 | xen-save-devices-state | |
570 | ------- | |
571 | ||
572 | Save the state of all devices to file. The RAM and the block devices | |
573 | of the VM are not saved by this command. | |
574 | ||
575 | Arguments: | |
576 | ||
577 | - "filename": the file to save the state of the devices to as binary | |
578 | data. See xen-save-devices-state.txt for a description of the binary | |
579 | format. | |
580 | ||
581 | Example: | |
582 | ||
583 | -> { "execute": "xen-save-devices-state", | |
584 | "arguments": { "filename": "/tmp/save" } } | |
585 | <- { "return": {} } | |
586 | ||
88c16567 WC |
587 | EQMP |
588 | ||
589 | { | |
590 | .name = "xen-load-devices-state", | |
591 | .args_type = "filename:F", | |
592 | .mhandler.cmd_new = qmp_marshal_xen_load_devices_state, | |
593 | }, | |
594 | ||
595 | SQMP | |
596 | xen-load-devices-state | |
597 | ---------------------- | |
598 | ||
599 | Load the state of all devices from file. The RAM and the block devices | |
600 | of the VM are not loaded by this command. | |
601 | ||
602 | Arguments: | |
603 | ||
604 | - "filename": the file to load the state of the devices from as binary | |
605 | data. See xen-save-devices-state.txt for a description of the binary | |
606 | format. | |
607 | ||
608 | Example: | |
609 | ||
610 | -> { "execute": "xen-load-devices-state", | |
611 | "arguments": { "filename": "/tmp/resume" } } | |
612 | <- { "return": {} } | |
613 | ||
39f42439 AP |
614 | EQMP |
615 | ||
616 | { | |
617 | .name = "xen-set-global-dirty-log", | |
618 | .args_type = "enable:b", | |
7fad30f0 | 619 | .mhandler.cmd_new = qmp_marshal_xen_set_global_dirty_log, |
39f42439 AP |
620 | }, |
621 | ||
622 | SQMP | |
623 | xen-set-global-dirty-log | |
624 | ------- | |
625 | ||
626 | Enable or disable the global dirty log mode. | |
627 | ||
628 | Arguments: | |
629 | ||
630 | - "enable": Enable it or disable it. | |
631 | ||
632 | Example: | |
633 | ||
634 | -> { "execute": "xen-set-global-dirty-log", | |
635 | "arguments": { "enable": true } } | |
636 | <- { "return": {} } | |
637 | ||
82a56f0d LC |
638 | EQMP |
639 | ||
640 | { | |
641 | .name = "migrate", | |
642 | .args_type = "detach:-d,blk:-b,inc:-i,uri:s", | |
7fad30f0 | 643 | .mhandler.cmd_new = qmp_marshal_migrate, |
82a56f0d LC |
644 | }, |
645 | ||
646 | SQMP | |
647 | migrate | |
648 | ------- | |
649 | ||
650 | Migrate to URI. | |
651 | ||
652 | Arguments: | |
653 | ||
654 | - "blk": block migration, full disk copy (json-bool, optional) | |
655 | - "inc": incremental disk copy (json-bool, optional) | |
656 | - "uri": Destination URI (json-string) | |
657 | ||
658 | Example: | |
659 | ||
660 | -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } | |
661 | <- { "return": {} } | |
662 | ||
663 | Notes: | |
664 | ||
665 | (1) The 'query-migrate' command should be used to check migration's progress | |
666 | and final result (this information is provided by the 'status' member) | |
667 | (2) All boolean arguments default to false | |
668 | (3) The user Monitor's "detach" argument is invalid in QMP and should not | |
669 | be used | |
670 | ||
671 | EQMP | |
672 | ||
673 | { | |
674 | .name = "migrate_cancel", | |
675 | .args_type = "", | |
7fad30f0 | 676 | .mhandler.cmd_new = qmp_marshal_migrate_cancel, |
82a56f0d LC |
677 | }, |
678 | ||
679 | SQMP | |
680 | migrate_cancel | |
681 | -------------- | |
682 | ||
683 | Cancel the current migration. | |
684 | ||
685 | Arguments: None. | |
686 | ||
687 | Example: | |
688 | ||
689 | -> { "execute": "migrate_cancel" } | |
690 | <- { "return": {} } | |
691 | ||
9e1ba4cc | 692 | EQMP |
bf1ae1f4 DDAG |
693 | |
694 | { | |
695 | .name = "migrate-incoming", | |
696 | .args_type = "uri:s", | |
7fad30f0 | 697 | .mhandler.cmd_new = qmp_marshal_migrate_incoming, |
bf1ae1f4 DDAG |
698 | }, |
699 | ||
700 | SQMP | |
701 | migrate-incoming | |
702 | ---------------- | |
703 | ||
704 | Continue an incoming migration | |
705 | ||
706 | Arguments: | |
707 | ||
708 | - "uri": Source/listening URI (json-string) | |
709 | ||
710 | Example: | |
711 | ||
712 | -> { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } } | |
713 | <- { "return": {} } | |
714 | ||
715 | Notes: | |
716 | ||
717 | (1) QEMU must be started with -incoming defer to allow migrate-incoming to | |
718 | be used | |
4aab6282 | 719 | (2) The uri format is the same as for -incoming |
bf1ae1f4 DDAG |
720 | |
721 | EQMP | |
722 | { | |
9e1ba4cc OW |
723 | .name = "migrate-set-cache-size", |
724 | .args_type = "value:o", | |
7fad30f0 | 725 | .mhandler.cmd_new = qmp_marshal_migrate_set_cache_size, |
9e1ba4cc OW |
726 | }, |
727 | ||
728 | SQMP | |
729 | migrate-set-cache-size | |
817c6045 | 730 | ---------------------- |
9e1ba4cc OW |
731 | |
732 | Set cache size to be used by XBZRLE migration, the cache size will be rounded | |
733 | down to the nearest power of 2 | |
734 | ||
735 | Arguments: | |
736 | ||
737 | - "value": cache size in bytes (json-int) | |
738 | ||
739 | Example: | |
740 | ||
741 | -> { "execute": "migrate-set-cache-size", "arguments": { "value": 536870912 } } | |
742 | <- { "return": {} } | |
743 | ||
744 | EQMP | |
4886a1bc DDAG |
745 | { |
746 | .name = "migrate-start-postcopy", | |
747 | .args_type = "", | |
748 | .mhandler.cmd_new = qmp_marshal_migrate_start_postcopy, | |
749 | }, | |
750 | ||
751 | SQMP | |
752 | migrate-start-postcopy | |
753 | ---------------------- | |
754 | ||
755 | Switch an in-progress migration to postcopy mode. Ignored after the end of | |
756 | migration (or once already in postcopy). | |
757 | ||
758 | Example: | |
759 | -> { "execute": "migrate-start-postcopy" } | |
760 | <- { "return": {} } | |
761 | ||
762 | EQMP | |
763 | ||
9e1ba4cc OW |
764 | { |
765 | .name = "query-migrate-cache-size", | |
766 | .args_type = "", | |
7fad30f0 | 767 | .mhandler.cmd_new = qmp_marshal_query_migrate_cache_size, |
9e1ba4cc OW |
768 | }, |
769 | ||
770 | SQMP | |
771 | query-migrate-cache-size | |
817c6045 | 772 | ------------------------ |
9e1ba4cc OW |
773 | |
774 | Show cache size to be used by XBZRLE migration | |
775 | ||
776 | returns a json-object with the following information: | |
777 | - "size" : json-int | |
778 | ||
779 | Example: | |
780 | ||
781 | -> { "execute": "query-migrate-cache-size" } | |
782 | <- { "return": 67108864 } | |
783 | ||
82a56f0d LC |
784 | EQMP |
785 | ||
786 | { | |
787 | .name = "migrate_set_speed", | |
3a019b6e | 788 | .args_type = "value:o", |
7fad30f0 | 789 | .mhandler.cmd_new = qmp_marshal_migrate_set_speed, |
82a56f0d LC |
790 | }, |
791 | ||
e866e239 | 792 | SQMP |
ff73edf5 JS |
793 | migrate_set_speed |
794 | ----------------- | |
e866e239 | 795 | |
ff73edf5 | 796 | Set maximum speed for migrations. |
e866e239 GH |
797 | |
798 | Arguments: | |
799 | ||
ff73edf5 | 800 | - "value": maximum speed, in bytes per second (json-int) |
e866e239 GH |
801 | |
802 | Example: | |
803 | ||
ff73edf5 | 804 | -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } } |
e866e239 GH |
805 | <- { "return": {} } |
806 | ||
807 | EQMP | |
808 | ||
809 | { | |
ff73edf5 JS |
810 | .name = "migrate_set_downtime", |
811 | .args_type = "value:T", | |
7fad30f0 | 812 | .mhandler.cmd_new = qmp_marshal_migrate_set_downtime, |
e866e239 GH |
813 | }, |
814 | ||
82a56f0d | 815 | SQMP |
ff73edf5 JS |
816 | migrate_set_downtime |
817 | -------------------- | |
82a56f0d | 818 | |
ff73edf5 | 819 | Set maximum tolerated downtime (in seconds) for migrations. |
82a56f0d LC |
820 | |
821 | Arguments: | |
822 | ||
ff73edf5 | 823 | - "value": maximum downtime (json-number) |
82a56f0d LC |
824 | |
825 | Example: | |
826 | ||
ff73edf5 | 827 | -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } } |
82a56f0d LC |
828 | <- { "return": {} } |
829 | ||
830 | EQMP | |
831 | ||
832 | { | |
ff73edf5 JS |
833 | .name = "client_migrate_info", |
834 | .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?", | |
835 | .params = "protocol hostname port tls-port cert-subject", | |
13cadefb | 836 | .help = "set migration information for remote display", |
7fad30f0 | 837 | .mhandler.cmd_new = qmp_marshal_client_migrate_info, |
82a56f0d LC |
838 | }, |
839 | ||
840 | SQMP | |
ff73edf5 | 841 | client_migrate_info |
13cadefb | 842 | ------------------- |
82a56f0d | 843 | |
13cadefb MA |
844 | Set migration information for remote display. This makes the server |
845 | ask the client to automatically reconnect using the new parameters | |
846 | once migration finished successfully. Only implemented for SPICE. | |
82a56f0d LC |
847 | |
848 | Arguments: | |
849 | ||
13cadefb | 850 | - "protocol": must be "spice" (json-string) |
ff73edf5 | 851 | - "hostname": migration target hostname (json-string) |
13cadefb | 852 | - "port": spice tcp port for plaintext channels (json-int, optional) |
ff73edf5 JS |
853 | - "tls-port": spice tcp port for tls-secured channels (json-int, optional) |
854 | - "cert-subject": server certificate subject (json-string, optional) | |
82a56f0d LC |
855 | |
856 | Example: | |
857 | ||
ff73edf5 JS |
858 | -> { "execute": "client_migrate_info", |
859 | "arguments": { "protocol": "spice", | |
860 | "hostname": "virt42.lab.kraxel.org", | |
861 | "port": 1234 } } | |
82a56f0d LC |
862 | <- { "return": {} } |
863 | ||
783e9b48 WC |
864 | EQMP |
865 | ||
866 | { | |
867 | .name = "dump-guest-memory", | |
228de9cf PX |
868 | .args_type = "paging:b,protocol:s,detach:b?,begin:i?,end:i?,format:s?", |
869 | .params = "-p protocol [-d] [begin] [length] [format]", | |
783e9b48 | 870 | .help = "dump guest memory to file", |
7fad30f0 | 871 | .mhandler.cmd_new = qmp_marshal_dump_guest_memory, |
783e9b48 WC |
872 | }, |
873 | ||
874 | SQMP | |
875 | dump | |
876 | ||
877 | ||
878 | Dump guest memory to file. The file can be processed with crash or gdb. | |
879 | ||
880 | Arguments: | |
881 | ||
882 | - "paging": do paging to get guest's memory mapping (json-bool) | |
883 | - "protocol": destination file(started with "file:") or destination file | |
884 | descriptor (started with "fd:") (json-string) | |
228de9cf | 885 | - "detach": if specified, command will return immediately, without waiting |
39ba2ea6 PX |
886 | for the dump to finish. The user can track progress using |
887 | "query-dump". (json-bool) | |
783e9b48 WC |
888 | - "begin": the starting physical address. It's optional, and should be specified |
889 | with length together (json-int) | |
890 | - "length": the memory size, in bytes. It's optional, and should be specified | |
891 | with begin together (json-int) | |
b53ccc30 QN |
892 | - "format": the format of guest memory dump. It's optional, and can be |
893 | elf|kdump-zlib|kdump-lzo|kdump-snappy, but non-elf formats will | |
894 | conflict with paging and filter, ie. begin and length (json-string) | |
783e9b48 WC |
895 | |
896 | Example: | |
897 | ||
898 | -> { "execute": "dump-guest-memory", "arguments": { "protocol": "fd:dump" } } | |
899 | <- { "return": {} } | |
900 | ||
901 | Notes: | |
902 | ||
903 | (1) All boolean arguments default to false | |
904 | ||
7d6dc7f3 QN |
905 | EQMP |
906 | ||
907 | { | |
908 | .name = "query-dump-guest-memory-capability", | |
909 | .args_type = "", | |
7fad30f0 | 910 | .mhandler.cmd_new = qmp_marshal_query_dump_guest_memory_capability, |
7d6dc7f3 QN |
911 | }, |
912 | ||
913 | SQMP | |
914 | query-dump-guest-memory-capability | |
915 | ---------- | |
916 | ||
917 | Show available formats for 'dump-guest-memory' | |
918 | ||
919 | Example: | |
920 | ||
921 | -> { "execute": "query-dump-guest-memory-capability" } | |
922 | <- { "return": { "formats": | |
923 | ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] } | |
924 | ||
39ba2ea6 PX |
925 | EQMP |
926 | ||
927 | { | |
928 | .name = "query-dump", | |
929 | .args_type = "", | |
930 | .params = "", | |
931 | .help = "query background dump status", | |
932 | .mhandler.cmd_new = qmp_marshal_query_dump, | |
933 | }, | |
934 | ||
935 | SQMP | |
936 | query-dump | |
937 | ---------- | |
938 | ||
939 | Query background dump status. | |
940 | ||
941 | Arguments: None. | |
942 | ||
943 | Example: | |
944 | ||
945 | -> { "execute": "query-dump" } | |
946 | <- { "return": { "status": "active", "completed": 1024000, | |
947 | "total": 2048000 } } | |
948 | ||
7ee0c3e3 JH |
949 | EQMP |
950 | ||
951 | #if defined TARGET_S390X | |
952 | { | |
953 | .name = "dump-skeys", | |
954 | .args_type = "filename:F", | |
7fad30f0 | 955 | .mhandler.cmd_new = qmp_marshal_dump_skeys, |
7ee0c3e3 JH |
956 | }, |
957 | #endif | |
958 | ||
959 | SQMP | |
960 | dump-skeys | |
961 | ---------- | |
962 | ||
963 | Save guest storage keys to file. | |
964 | ||
965 | Arguments: | |
966 | ||
967 | - "filename": file path (json-string) | |
968 | ||
969 | Example: | |
970 | ||
971 | -> { "execute": "dump-skeys", "arguments": { "filename": "/tmp/skeys" } } | |
972 | <- { "return": {} } | |
973 | ||
82a56f0d LC |
974 | EQMP |
975 | ||
976 | { | |
977 | .name = "netdev_add", | |
978 | .args_type = "netdev:O", | |
928059a3 | 979 | .mhandler.cmd_new = qmp_netdev_add, |
82a56f0d LC |
980 | }, |
981 | ||
982 | SQMP | |
983 | netdev_add | |
984 | ---------- | |
985 | ||
986 | Add host network device. | |
987 | ||
988 | Arguments: | |
989 | ||
990 | - "type": the device type, "tap", "user", ... (json-string) | |
991 | - "id": the device's ID, must be unique (json-string) | |
992 | - device options | |
993 | ||
994 | Example: | |
995 | ||
b8a98326 MA |
996 | -> { "execute": "netdev_add", |
997 | "arguments": { "type": "user", "id": "netdev1", | |
998 | "dnssearch": "example.org" } } | |
82a56f0d LC |
999 | <- { "return": {} } |
1000 | ||
af347aa5 | 1001 | Note: The supported device options are the same ones supported by the '-netdev' |
82a56f0d LC |
1002 | command-line argument, which are listed in the '-help' output or QEMU's |
1003 | manual | |
1004 | ||
1005 | EQMP | |
1006 | ||
1007 | { | |
1008 | .name = "netdev_del", | |
1009 | .args_type = "id:s", | |
7fad30f0 | 1010 | .mhandler.cmd_new = qmp_marshal_netdev_del, |
82a56f0d LC |
1011 | }, |
1012 | ||
1013 | SQMP | |
1014 | netdev_del | |
1015 | ---------- | |
1016 | ||
1017 | Remove host network device. | |
1018 | ||
1019 | Arguments: | |
1020 | ||
1021 | - "id": the device's ID, must be unique (json-string) | |
1022 | ||
1023 | Example: | |
1024 | ||
1025 | -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } } | |
1026 | <- { "return": {} } | |
1027 | ||
6d4a2b3a | 1028 | |
cff8b2c6 PB |
1029 | EQMP |
1030 | ||
1031 | { | |
1032 | .name = "object-add", | |
1033 | .args_type = "qom-type:s,id:s,props:q?", | |
6eb3937e | 1034 | .mhandler.cmd_new = qmp_marshal_object_add, |
cff8b2c6 PB |
1035 | }, |
1036 | ||
1037 | SQMP | |
1038 | object-add | |
1039 | ---------- | |
1040 | ||
1041 | Create QOM object. | |
1042 | ||
1043 | Arguments: | |
1044 | ||
1045 | - "qom-type": the object's QOM type, i.e. the class name (json-string) | |
1046 | - "id": the object's ID, must be unique (json-string) | |
1047 | - "props": a dictionary of object property values (optional, json-dict) | |
1048 | ||
1049 | Example: | |
1050 | ||
1051 | -> { "execute": "object-add", "arguments": { "qom-type": "rng-random", "id": "rng1", | |
1052 | "props": { "filename": "/dev/hwrng" } } } | |
1053 | <- { "return": {} } | |
1054 | ||
6d4a2b3a CH |
1055 | EQMP |
1056 | ||
ab2d0531 PB |
1057 | { |
1058 | .name = "object-del", | |
1059 | .args_type = "id:s", | |
7fad30f0 | 1060 | .mhandler.cmd_new = qmp_marshal_object_del, |
ab2d0531 PB |
1061 | }, |
1062 | ||
1063 | SQMP | |
1064 | object-del | |
1065 | ---------- | |
1066 | ||
1067 | Remove QOM object. | |
1068 | ||
1069 | Arguments: | |
1070 | ||
1071 | - "id": the object's ID (json-string) | |
1072 | ||
1073 | Example: | |
1074 | ||
1075 | -> { "execute": "object-del", "arguments": { "id": "rng1" } } | |
1076 | <- { "return": {} } | |
1077 | ||
1078 | ||
1079 | EQMP | |
1080 | ||
1081 | ||
6d4a2b3a CH |
1082 | { |
1083 | .name = "block_resize", | |
3b1dbd11 | 1084 | .args_type = "device:s?,node-name:s?,size:o", |
7fad30f0 | 1085 | .mhandler.cmd_new = qmp_marshal_block_resize, |
6d4a2b3a CH |
1086 | }, |
1087 | ||
1088 | SQMP | |
1089 | block_resize | |
1090 | ------------ | |
1091 | ||
1092 | Resize a block image while a guest is running. | |
1093 | ||
1094 | Arguments: | |
1095 | ||
1096 | - "device": the device's ID, must be unique (json-string) | |
3b1dbd11 | 1097 | - "node-name": the node name in the block driver state graph (json-string) |
6d4a2b3a CH |
1098 | - "size": new size |
1099 | ||
1100 | Example: | |
1101 | ||
1102 | -> { "execute": "block_resize", "arguments": { "device": "scratch", "size": 1073741824 } } | |
1103 | <- { "return": {} } | |
1104 | ||
d967b2f1 JS |
1105 | EQMP |
1106 | ||
12bd451f | 1107 | { |
db58f9c0 | 1108 | .name = "block-stream", |
2323322e | 1109 | .args_type = "job-id:s?,device:B,base:s?,speed:o?,backing-file:s?,on-error:s?", |
7fad30f0 | 1110 | .mhandler.cmd_new = qmp_marshal_block_stream, |
12bd451f SH |
1111 | }, |
1112 | ||
ec683d60 SH |
1113 | SQMP |
1114 | block-stream | |
1115 | ------------ | |
1116 | ||
1117 | Copy data from a backing file into a block device. | |
1118 | ||
1119 | Arguments: | |
1120 | ||
2323322e AG |
1121 | - "job-id": Identifier for the newly-created block job. If omitted, |
1122 | the device name will be used. (json-string, optional) | |
ec683d60 SH |
1123 | - "device": The device's ID, must be unique (json-string) |
1124 | - "base": The file name of the backing image above which copying starts | |
1125 | (json-string, optional) | |
1126 | - "backing-file": The backing file string to write into the active layer. This | |
1127 | filename is not validated. | |
1128 | ||
1129 | If a pathname string is such that it cannot be resolved by | |
1130 | QEMU, that means that subsequent QMP or HMP commands must use | |
1131 | node-names for the image in question, as filename lookup | |
1132 | methods will fail. | |
1133 | ||
1134 | If not specified, QEMU will automatically determine the | |
1135 | backing file string to use, or error out if there is no | |
1136 | obvious choice. Care should be taken when specifying the | |
1137 | string, to specify a valid filename or protocol. | |
1138 | (json-string, optional) (Since 2.1) | |
1139 | - "speed": the maximum speed, in bytes per second (json-int, optional) | |
1140 | - "on-error": the action to take on an error (default 'report'). 'stop' and | |
1141 | 'enospc' can only be used if the block device supports io-status. | |
1142 | (json-string, optional) (Since 2.1) | |
1143 | ||
1144 | Example: | |
1145 | ||
1146 | -> { "execute": "block-stream", "arguments": { "device": "virtio0", | |
1147 | "base": "/tmp/master.qcow2" } } | |
1148 | <- { "return": {} } | |
1149 | ||
1150 | EQMP | |
1151 | ||
ed61fc10 JC |
1152 | { |
1153 | .name = "block-commit", | |
fd62c609 | 1154 | .args_type = "job-id:s?,device:B,base:s?,top:s?,backing-file:s?,speed:o?", |
7fad30f0 | 1155 | .mhandler.cmd_new = qmp_marshal_block_commit, |
ed61fc10 JC |
1156 | }, |
1157 | ||
37222900 JC |
1158 | SQMP |
1159 | block-commit | |
1160 | ------------ | |
1161 | ||
1162 | Live commit of data from overlay image nodes into backing nodes - i.e., writes | |
1163 | data between 'top' and 'base' into 'base'. | |
1164 | ||
1165 | Arguments: | |
1166 | ||
fd62c609 AG |
1167 | - "job-id": Identifier for the newly-created block job. If omitted, |
1168 | the device name will be used. (json-string, optional) | |
37222900 JC |
1169 | - "device": The device's ID, must be unique (json-string) |
1170 | - "base": The file name of the backing image to write data into. | |
1171 | If not specified, this is the deepest backing image | |
1172 | (json-string, optional) | |
1173 | - "top": The file name of the backing image within the image chain, | |
7676e2c5 JC |
1174 | which contains the topmost data to be committed down. If |
1175 | not specified, this is the active layer. (json-string, optional) | |
37222900 | 1176 | |
54e26900 JC |
1177 | - backing-file: The backing file string to write into the overlay |
1178 | image of 'top'. If 'top' is the active layer, | |
1179 | specifying a backing file string is an error. This | |
1180 | filename is not validated. | |
1181 | ||
1182 | If a pathname string is such that it cannot be | |
1183 | resolved by QEMU, that means that subsequent QMP or | |
1184 | HMP commands must use node-names for the image in | |
1185 | question, as filename lookup methods will fail. | |
1186 | ||
1187 | If not specified, QEMU will automatically determine | |
1188 | the backing file string to use, or error out if | |
1189 | there is no obvious choice. Care should be taken | |
1190 | when specifying the string, to specify a valid | |
1191 | filename or protocol. | |
1192 | (json-string, optional) (Since 2.1) | |
1193 | ||
37222900 JC |
1194 | If top == base, that is an error. |
1195 | If top == active, the job will not be completed by itself, | |
1196 | user needs to complete the job with the block-job-complete | |
1197 | command after getting the ready event. (Since 2.0) | |
1198 | ||
1199 | If the base image is smaller than top, then the base image | |
1200 | will be resized to be the same size as top. If top is | |
1201 | smaller than the base image, the base will not be | |
1202 | truncated. If you want the base image size to match the | |
1203 | size of the smaller top, you can safely truncate it | |
1204 | yourself once the commit operation successfully completes. | |
1205 | (json-string) | |
1206 | - "speed": the maximum speed, in bytes per second (json-int, optional) | |
1207 | ||
1208 | ||
1209 | Example: | |
1210 | ||
1211 | -> { "execute": "block-commit", "arguments": { "device": "virtio0", | |
1212 | "top": "/tmp/snap1.qcow2" } } | |
1213 | <- { "return": {} } | |
1214 | ||
1215 | EQMP | |
1216 | ||
99a9addf SH |
1217 | { |
1218 | .name = "drive-backup", | |
70559d49 AG |
1219 | .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?," |
1220 | "format:s?,bitmap:s?,on-source-error:s?,on-target-error:s?", | |
7fad30f0 | 1221 | .mhandler.cmd_new = qmp_marshal_drive_backup, |
99a9addf SH |
1222 | }, |
1223 | ||
1224 | SQMP | |
1225 | drive-backup | |
1226 | ------------ | |
1227 | ||
1228 | Start a point-in-time copy of a block device to a new destination. The | |
1229 | status of ongoing drive-backup operations can be checked with | |
1230 | query-block-jobs where the BlockJobInfo.type field has the value 'backup'. | |
1231 | The operation can be stopped before it has completed using the | |
1232 | block-job-cancel command. | |
1233 | ||
1234 | Arguments: | |
1235 | ||
70559d49 AG |
1236 | - "job-id": Identifier for the newly-created block job. If omitted, |
1237 | the device name will be used. (json-string, optional) | |
99a9addf SH |
1238 | - "device": the name of the device which should be copied. |
1239 | (json-string) | |
1240 | - "target": the target of the new image. If the file exists, or if it is a | |
1241 | device, the existing file/device will be used as the new | |
1242 | destination. If it does not exist, a new file will be created. | |
1243 | (json-string) | |
1244 | - "format": the format of the new destination, default is to probe if 'mode' is | |
1245 | 'existing', else the format of the source | |
1246 | (json-string, optional) | |
b53169ea SH |
1247 | - "sync": what parts of the disk image should be copied to the destination; |
1248 | possibilities include "full" for all the disk, "top" for only the sectors | |
4b80ab2b | 1249 | allocated in the topmost image, "incremental" for only the dirty sectors in |
d58d8453 | 1250 | the bitmap, or "none" to only replicate new I/O (MirrorSyncMode). |
4b80ab2b JS |
1251 | - "bitmap": dirty bitmap name for sync==incremental. Must be present if sync |
1252 | is "incremental", must NOT be present otherwise. | |
99a9addf SH |
1253 | - "mode": whether and how QEMU should create a new image |
1254 | (NewImageMode, optional, default 'absolute-paths') | |
1255 | - "speed": the maximum speed, in bytes per second (json-int, optional) | |
1256 | - "on-source-error": the action to take on an error on the source, default | |
1257 | 'report'. 'stop' and 'enospc' can only be used | |
1258 | if the block device supports io-status. | |
1259 | (BlockdevOnError, optional) | |
1260 | - "on-target-error": the action to take on an error on the target, default | |
1261 | 'report' (no limitations, since this applies to | |
1262 | a different block device than device). | |
1263 | (BlockdevOnError, optional) | |
1264 | ||
1265 | Example: | |
1266 | -> { "execute": "drive-backup", "arguments": { "device": "drive0", | |
fc5d3f84 | 1267 | "sync": "full", |
99a9addf SH |
1268 | "target": "backup.img" } } |
1269 | <- { "return": {} } | |
c29c1dd3 FZ |
1270 | |
1271 | EQMP | |
1272 | ||
1273 | { | |
1274 | .name = "blockdev-backup", | |
70559d49 | 1275 | .args_type = "job-id:s?,sync:s,device:B,target:B,speed:i?," |
c29c1dd3 | 1276 | "on-source-error:s?,on-target-error:s?", |
7fad30f0 | 1277 | .mhandler.cmd_new = qmp_marshal_blockdev_backup, |
c29c1dd3 FZ |
1278 | }, |
1279 | ||
1280 | SQMP | |
1281 | blockdev-backup | |
1282 | --------------- | |
1283 | ||
1284 | The device version of drive-backup: this command takes an existing named device | |
1285 | as backup target. | |
1286 | ||
1287 | Arguments: | |
1288 | ||
70559d49 AG |
1289 | - "job-id": Identifier for the newly-created block job. If omitted, |
1290 | the device name will be used. (json-string, optional) | |
c29c1dd3 FZ |
1291 | - "device": the name of the device which should be copied. |
1292 | (json-string) | |
1293 | - "target": the name of the backup target device. (json-string) | |
1294 | - "sync": what parts of the disk image should be copied to the destination; | |
1295 | possibilities include "full" for all the disk, "top" for only the | |
1296 | sectors allocated in the topmost image, or "none" to only replicate | |
1297 | new I/O (MirrorSyncMode). | |
1298 | - "speed": the maximum speed, in bytes per second (json-int, optional) | |
1299 | - "on-source-error": the action to take on an error on the source, default | |
1300 | 'report'. 'stop' and 'enospc' can only be used | |
1301 | if the block device supports io-status. | |
1302 | (BlockdevOnError, optional) | |
1303 | - "on-target-error": the action to take on an error on the target, default | |
1304 | 'report' (no limitations, since this applies to | |
1305 | a different block device than device). | |
1306 | (BlockdevOnError, optional) | |
1307 | ||
1308 | Example: | |
1309 | -> { "execute": "blockdev-backup", "arguments": { "device": "src-id", | |
1310 | "sync": "full", | |
1311 | "target": "tgt-id" } } | |
1312 | <- { "return": {} } | |
1313 | ||
99a9addf SH |
1314 | EQMP |
1315 | ||
2d47c6e9 | 1316 | { |
db58f9c0 | 1317 | .name = "block-job-set-speed", |
882ec7ce | 1318 | .args_type = "device:B,speed:o", |
7fad30f0 | 1319 | .mhandler.cmd_new = qmp_marshal_block_job_set_speed, |
2d47c6e9 SH |
1320 | }, |
1321 | ||
370521a1 | 1322 | { |
db58f9c0 | 1323 | .name = "block-job-cancel", |
6e37fb81 | 1324 | .args_type = "device:B,force:b?", |
7fad30f0 | 1325 | .mhandler.cmd_new = qmp_marshal_block_job_cancel, |
370521a1 | 1326 | }, |
6e37fb81 PB |
1327 | { |
1328 | .name = "block-job-pause", | |
1329 | .args_type = "device:B", | |
7fad30f0 | 1330 | .mhandler.cmd_new = qmp_marshal_block_job_pause, |
6e37fb81 PB |
1331 | }, |
1332 | { | |
1333 | .name = "block-job-resume", | |
1334 | .args_type = "device:B", | |
7fad30f0 | 1335 | .mhandler.cmd_new = qmp_marshal_block_job_resume, |
6e37fb81 | 1336 | }, |
aeae883b PB |
1337 | { |
1338 | .name = "block-job-complete", | |
1339 | .args_type = "device:B", | |
7fad30f0 | 1340 | .mhandler.cmd_new = qmp_marshal_block_job_complete, |
aeae883b | 1341 | }, |
c186402c | 1342 | { |
52e7c241 | 1343 | .name = "transaction", |
94d16a64 | 1344 | .args_type = "actions:q,properties:q?", |
7fad30f0 | 1345 | .mhandler.cmd_new = qmp_marshal_transaction, |
c186402c JC |
1346 | }, |
1347 | ||
1348 | SQMP | |
52e7c241 PB |
1349 | transaction |
1350 | ----------- | |
c186402c | 1351 | |
a910523a KC |
1352 | Atomically operate on one or more block devices. Operations that are |
1353 | currently supported: | |
1354 | ||
1355 | - drive-backup | |
1356 | - blockdev-backup | |
1357 | - blockdev-snapshot-sync | |
1358 | - blockdev-snapshot-internal-sync | |
1359 | - abort | |
1360 | - block-dirty-bitmap-add | |
1361 | - block-dirty-bitmap-clear | |
1362 | ||
1363 | Refer to the qemu/qapi-schema.json file for minimum required QEMU | |
1364 | versions for these operations. A list of dictionaries is accepted, | |
1365 | that contains the actions to be performed. If there is any failure | |
1366 | performing any of the operations, all operations for the group are | |
1367 | abandoned. | |
c186402c | 1368 | |
bbe86010 WX |
1369 | For external snapshots, the dictionary contains the device, the file to use for |
1370 | the new snapshot, and the format. The default format, if not specified, is | |
1371 | qcow2. | |
c186402c | 1372 | |
bc8b094f PB |
1373 | Each new snapshot defaults to being created by QEMU (wiping any |
1374 | contents if the file already exists), but it is also possible to reuse | |
1375 | an externally-created file. In the latter case, you should ensure that | |
1376 | the new image file has the same contents as the current one; QEMU cannot | |
1377 | perform any meaningful check. Typically this is achieved by using the | |
1378 | current image file as the backing file for the new image. | |
1379 | ||
bbe86010 WX |
1380 | On failure, the original disks pre-snapshot attempt will be used. |
1381 | ||
1382 | For internal snapshots, the dictionary contains the device and the snapshot's | |
1383 | name. If an internal snapshot matching name already exists, the request will | |
1384 | be rejected. Only some image formats support it, for example, qcow2, rbd, | |
1385 | and sheepdog. | |
1386 | ||
1387 | On failure, qemu will try delete the newly created internal snapshot in the | |
1388 | transaction. When an I/O error occurs during deletion, the user needs to fix | |
1389 | it later with qemu-img or other command. | |
1390 | ||
c186402c JC |
1391 | Arguments: |
1392 | ||
52e7c241 | 1393 | actions array: |
a910523a KC |
1394 | - "type": the operation to perform (json-string). Possible |
1395 | values: "drive-backup", "blockdev-backup", | |
1396 | "blockdev-snapshot-sync", | |
1397 | "blockdev-snapshot-internal-sync", | |
1398 | "abort", "block-dirty-bitmap-add", | |
1399 | "block-dirty-bitmap-clear" | |
52e7c241 PB |
1400 | - "data": a dictionary. The contents depend on the value |
1401 | of "type". When "type" is "blockdev-snapshot-sync": | |
1402 | - "device": device name to snapshot (json-string) | |
0901f67e | 1403 | - "node-name": graph node name to snapshot (json-string) |
52e7c241 | 1404 | - "snapshot-file": name of new image file (json-string) |
0901f67e | 1405 | - "snapshot-node-name": graph node name of the new snapshot (json-string) |
52e7c241 | 1406 | - "format": format of new image (json-string, optional) |
bc8b094f PB |
1407 | - "mode": whether and how QEMU should create the snapshot file |
1408 | (NewImageMode, optional, default "absolute-paths") | |
bbe86010 WX |
1409 | When "type" is "blockdev-snapshot-internal-sync": |
1410 | - "device": device name to snapshot (json-string) | |
1411 | - "name": name of the new snapshot (json-string) | |
c186402c JC |
1412 | |
1413 | Example: | |
1414 | ||
52e7c241 PB |
1415 | -> { "execute": "transaction", |
1416 | "arguments": { "actions": [ | |
cd0c5389 | 1417 | { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0", |
52e7c241 PB |
1418 | "snapshot-file": "/some/place/my-image", |
1419 | "format": "qcow2" } }, | |
cd0c5389 | 1420 | { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile", |
0901f67e BC |
1421 | "snapshot-file": "/some/place/my-image2", |
1422 | "snapshot-node-name": "node3432", | |
1423 | "mode": "existing", | |
1424 | "format": "qcow2" } }, | |
cd0c5389 | 1425 | { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1", |
52e7c241 | 1426 | "snapshot-file": "/some/place/my-image2", |
bc8b094f | 1427 | "mode": "existing", |
bbe86010 | 1428 | "format": "qcow2" } }, |
cd0c5389 | 1429 | { "type": "blockdev-snapshot-internal-sync", "data" : { |
bbe86010 WX |
1430 | "device": "ide-hd2", |
1431 | "name": "snapshot0" } } ] } } | |
c186402c JC |
1432 | <- { "return": {} } |
1433 | ||
341ebc2f JS |
1434 | EQMP |
1435 | ||
1436 | { | |
1437 | .name = "block-dirty-bitmap-add", | |
1438 | .args_type = "node:B,name:s,granularity:i?", | |
7fad30f0 | 1439 | .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_add, |
341ebc2f JS |
1440 | }, |
1441 | ||
1442 | SQMP | |
1443 | ||
1444 | block-dirty-bitmap-add | |
1445 | ---------------------- | |
1446 | Since 2.4 | |
1447 | ||
1448 | Create a dirty bitmap with a name on the device, and start tracking the writes. | |
1449 | ||
1450 | Arguments: | |
1451 | ||
1452 | - "node": device/node on which to create dirty bitmap (json-string) | |
1453 | - "name": name of the new dirty bitmap (json-string) | |
1454 | - "granularity": granularity to track writes with (int, optional) | |
1455 | ||
1456 | Example: | |
1457 | ||
1458 | -> { "execute": "block-dirty-bitmap-add", "arguments": { "node": "drive0", | |
1459 | "name": "bitmap0" } } | |
1460 | <- { "return": {} } | |
1461 | ||
1462 | EQMP | |
1463 | ||
1464 | { | |
1465 | .name = "block-dirty-bitmap-remove", | |
1466 | .args_type = "node:B,name:s", | |
7fad30f0 | 1467 | .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_remove, |
341ebc2f JS |
1468 | }, |
1469 | ||
1470 | SQMP | |
1471 | ||
1472 | block-dirty-bitmap-remove | |
1473 | ------------------------- | |
1474 | Since 2.4 | |
1475 | ||
1476 | Stop write tracking and remove the dirty bitmap that was created with | |
1477 | block-dirty-bitmap-add. | |
1478 | ||
1479 | Arguments: | |
1480 | ||
1481 | - "node": device/node on which to remove dirty bitmap (json-string) | |
1482 | - "name": name of the dirty bitmap to remove (json-string) | |
1483 | ||
1484 | Example: | |
1485 | ||
1486 | -> { "execute": "block-dirty-bitmap-remove", "arguments": { "node": "drive0", | |
1487 | "name": "bitmap0" } } | |
1488 | <- { "return": {} } | |
1489 | ||
e74e6b78 JS |
1490 | EQMP |
1491 | ||
1492 | { | |
1493 | .name = "block-dirty-bitmap-clear", | |
1494 | .args_type = "node:B,name:s", | |
7fad30f0 | 1495 | .mhandler.cmd_new = qmp_marshal_block_dirty_bitmap_clear, |
e74e6b78 JS |
1496 | }, |
1497 | ||
1498 | SQMP | |
1499 | ||
1500 | block-dirty-bitmap-clear | |
1501 | ------------------------ | |
1502 | Since 2.4 | |
1503 | ||
1504 | Reset the dirty bitmap associated with a node so that an incremental backup | |
1505 | from this point in time forward will only backup clusters modified after this | |
1506 | clear operation. | |
1507 | ||
1508 | Arguments: | |
1509 | ||
1510 | - "node": device/node on which to remove dirty bitmap (json-string) | |
1511 | - "name": name of the dirty bitmap to remove (json-string) | |
1512 | ||
1513 | Example: | |
1514 | ||
1515 | -> { "execute": "block-dirty-bitmap-clear", "arguments": { "node": "drive0", | |
1516 | "name": "bitmap0" } } | |
1517 | <- { "return": {} } | |
1518 | ||
c186402c | 1519 | EQMP |
370521a1 | 1520 | |
d967b2f1 JS |
1521 | { |
1522 | .name = "blockdev-snapshot-sync", | |
0901f67e | 1523 | .args_type = "device:s?,node-name:s?,snapshot-file:s,snapshot-node-name:s?,format:s?,mode:s?", |
7fad30f0 | 1524 | .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_sync, |
d967b2f1 JS |
1525 | }, |
1526 | ||
1527 | SQMP | |
1528 | blockdev-snapshot-sync | |
1529 | ---------------------- | |
1530 | ||
1531 | Synchronous snapshot of a block device. snapshot-file specifies the | |
1532 | target of the new image. If the file exists, or if it is a device, the | |
1533 | snapshot will be created in the existing file/device. If does not | |
1534 | exist, a new file will be created. format specifies the format of the | |
1535 | snapshot image, default is qcow2. | |
1536 | ||
1537 | Arguments: | |
1538 | ||
1539 | - "device": device name to snapshot (json-string) | |
0901f67e | 1540 | - "node-name": graph node name to snapshot (json-string) |
d967b2f1 | 1541 | - "snapshot-file": name of new image file (json-string) |
0901f67e | 1542 | - "snapshot-node-name": graph node name of the new snapshot (json-string) |
6cc2a415 PB |
1543 | - "mode": whether and how QEMU should create the snapshot file |
1544 | (NewImageMode, optional, default "absolute-paths") | |
d967b2f1 JS |
1545 | - "format": format of new image (json-string, optional) |
1546 | ||
1547 | Example: | |
1548 | ||
7f3850c2 LC |
1549 | -> { "execute": "blockdev-snapshot-sync", "arguments": { "device": "ide-hd0", |
1550 | "snapshot-file": | |
1551 | "/some/place/my-image", | |
1552 | "format": "qcow2" } } | |
d967b2f1 JS |
1553 | <- { "return": {} } |
1554 | ||
43de7e2d AG |
1555 | EQMP |
1556 | ||
1557 | { | |
1558 | .name = "blockdev-snapshot", | |
1559 | .args_type = "node:s,overlay:s", | |
1560 | .mhandler.cmd_new = qmp_marshal_blockdev_snapshot, | |
1561 | }, | |
1562 | ||
1563 | SQMP | |
1564 | blockdev-snapshot | |
1565 | ----------------- | |
1566 | Since 2.5 | |
1567 | ||
1568 | Create a snapshot, by installing 'node' as the backing image of | |
1569 | 'overlay'. Additionally, if 'node' is associated with a block | |
1570 | device, the block device changes to using 'overlay' as its new active | |
1571 | image. | |
1572 | ||
1573 | Arguments: | |
1574 | ||
1575 | - "node": device that will have a snapshot created (json-string) | |
1576 | - "overlay": device that will have 'node' as its backing image (json-string) | |
1577 | ||
1578 | Example: | |
1579 | ||
1580 | -> { "execute": "blockdev-add", | |
1581 | "arguments": { "options": { "driver": "qcow2", | |
1582 | "node-name": "node1534", | |
1583 | "file": { "driver": "file", | |
1584 | "filename": "hd1.qcow2" }, | |
1585 | "backing": "" } } } | |
1586 | ||
1587 | <- { "return": {} } | |
1588 | ||
1589 | -> { "execute": "blockdev-snapshot", "arguments": { "node": "ide-hd0", | |
1590 | "overlay": "node1534" } } | |
1591 | <- { "return": {} } | |
1592 | ||
f323bc9e WX |
1593 | EQMP |
1594 | ||
1595 | { | |
1596 | .name = "blockdev-snapshot-internal-sync", | |
1597 | .args_type = "device:B,name:s", | |
7fad30f0 | 1598 | .mhandler.cmd_new = qmp_marshal_blockdev_snapshot_internal_sync, |
f323bc9e WX |
1599 | }, |
1600 | ||
1601 | SQMP | |
1602 | blockdev-snapshot-internal-sync | |
1603 | ------------------------------- | |
1604 | ||
1605 | Synchronously take an internal snapshot of a block device when the format of | |
1606 | image used supports it. If the name is an empty string, or a snapshot with | |
1607 | name already exists, the operation will fail. | |
1608 | ||
1609 | Arguments: | |
1610 | ||
1611 | - "device": device name to snapshot (json-string) | |
1612 | - "name": name of the new snapshot (json-string) | |
1613 | ||
1614 | Example: | |
1615 | ||
1616 | -> { "execute": "blockdev-snapshot-internal-sync", | |
1617 | "arguments": { "device": "ide-hd0", | |
1618 | "name": "snapshot0" } | |
1619 | } | |
1620 | <- { "return": {} } | |
1621 | ||
44e3e053 WX |
1622 | EQMP |
1623 | ||
1624 | { | |
1625 | .name = "blockdev-snapshot-delete-internal-sync", | |
1626 | .args_type = "device:B,id:s?,name:s?", | |
1627 | .mhandler.cmd_new = | |
7fad30f0 | 1628 | qmp_marshal_blockdev_snapshot_delete_internal_sync, |
44e3e053 WX |
1629 | }, |
1630 | ||
1631 | SQMP | |
1632 | blockdev-snapshot-delete-internal-sync | |
1633 | -------------------------------------- | |
1634 | ||
1635 | Synchronously delete an internal snapshot of a block device when the format of | |
1636 | image used supports it. The snapshot is identified by name or id or both. One | |
1637 | of name or id is required. If the snapshot is not found, the operation will | |
1638 | fail. | |
1639 | ||
1640 | Arguments: | |
1641 | ||
1642 | - "device": device name (json-string) | |
1643 | - "id": ID of the snapshot (json-string, optional) | |
1644 | - "name": name of the snapshot (json-string, optional) | |
1645 | ||
1646 | Example: | |
1647 | ||
1648 | -> { "execute": "blockdev-snapshot-delete-internal-sync", | |
1649 | "arguments": { "device": "ide-hd0", | |
1650 | "name": "snapshot0" } | |
1651 | } | |
1652 | <- { "return": { | |
1653 | "id": "1", | |
1654 | "name": "snapshot0", | |
1655 | "vm-state-size": 0, | |
1656 | "date-sec": 1000012, | |
1657 | "date-nsec": 10, | |
1658 | "vm-clock-sec": 100, | |
1659 | "vm-clock-nsec": 20 | |
1660 | } | |
1661 | } | |
1662 | ||
d9b902db PB |
1663 | EQMP |
1664 | ||
1665 | { | |
1666 | .name = "drive-mirror", | |
71aa9867 AG |
1667 | .args_type = "job-id:s?,sync:s,device:B,target:s,speed:i?,mode:s?," |
1668 | "format:s?,node-name:s?,replaces:s?," | |
eee13dfe | 1669 | "on-source-error:s?,on-target-error:s?," |
0fc9f8ea | 1670 | "unmap:b?," |
08e4ed6c | 1671 | "granularity:i?,buf-size:i?", |
7fad30f0 | 1672 | .mhandler.cmd_new = qmp_marshal_drive_mirror, |
d9b902db PB |
1673 | }, |
1674 | ||
1675 | SQMP | |
1676 | drive-mirror | |
1677 | ------------ | |
1678 | ||
1679 | Start mirroring a block device's writes to a new destination. target | |
1680 | specifies the target of the new image. If the file exists, or if it is | |
1681 | a device, it will be used as the new destination for writes. If it does not | |
1682 | exist, a new file will be created. format specifies the format of the | |
1683 | mirror image, default is to probe if mode='existing', else the format | |
1684 | of the source. | |
1685 | ||
1686 | Arguments: | |
1687 | ||
71aa9867 AG |
1688 | - "job-id": Identifier for the newly-created block job. If omitted, |
1689 | the device name will be used. (json-string, optional) | |
d9b902db PB |
1690 | - "device": device name to operate on (json-string) |
1691 | - "target": name of new image file (json-string) | |
1692 | - "format": format of new image (json-string, optional) | |
4c828dc6 BC |
1693 | - "node-name": the name of the new block driver state in the node graph |
1694 | (json-string, optional) | |
09158f00 BC |
1695 | - "replaces": the block driver node name to replace when finished |
1696 | (json-string, optional) | |
d9b902db PB |
1697 | - "mode": how an image file should be created into the target |
1698 | file/device (NewImageMode, optional, default 'absolute-paths') | |
1699 | - "speed": maximum speed of the streaming job, in bytes per second | |
1700 | (json-int) | |
eee13dfe | 1701 | - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional) |
df92562e | 1702 | - "buf-size": maximum amount of data in flight from source to target, in bytes |
08e4ed6c | 1703 | (json-int, default 10M) |
d9b902db PB |
1704 | - "sync": what parts of the disk image should be copied to the destination; |
1705 | possibilities include "full" for all the disk, "top" for only the sectors | |
1706 | allocated in the topmost image, or "none" to only replicate new I/O | |
1707 | (MirrorSyncMode). | |
b952b558 PB |
1708 | - "on-source-error": the action to take on an error on the source |
1709 | (BlockdevOnError, default 'report') | |
1710 | - "on-target-error": the action to take on an error on the target | |
1711 | (BlockdevOnError, default 'report') | |
0fc9f8ea FZ |
1712 | - "unmap": whether the target sectors should be discarded where source has only |
1713 | zeroes. (json-bool, optional, default true) | |
b952b558 | 1714 | |
eee13dfe PB |
1715 | The default value of the granularity is the image cluster size clamped |
1716 | between 4096 and 65536, if the image format defines one. If the format | |
1717 | does not define a cluster size, the default value of the granularity | |
1718 | is 65536. | |
d9b902db PB |
1719 | |
1720 | ||
1721 | Example: | |
1722 | ||
1723 | -> { "execute": "drive-mirror", "arguments": { "device": "ide-hd0", | |
1724 | "target": "/some/place/my-image", | |
1725 | "sync": "full", | |
1726 | "format": "qcow2" } } | |
1727 | <- { "return": {} } | |
1728 | ||
fa40e656 JC |
1729 | EQMP |
1730 | ||
df92562e FZ |
1731 | { |
1732 | .name = "blockdev-mirror", | |
71aa9867 | 1733 | .args_type = "job-id:s?,sync:s,device:B,target:B,replaces:s?,speed:i?," |
df92562e FZ |
1734 | "on-source-error:s?,on-target-error:s?," |
1735 | "granularity:i?,buf-size:i?", | |
1736 | .mhandler.cmd_new = qmp_marshal_blockdev_mirror, | |
1737 | }, | |
1738 | ||
1739 | SQMP | |
1740 | blockdev-mirror | |
1741 | ------------ | |
1742 | ||
1743 | Start mirroring a block device's writes to another block device. target | |
1744 | specifies the target of mirror operation. | |
1745 | ||
1746 | Arguments: | |
1747 | ||
71aa9867 AG |
1748 | - "job-id": Identifier for the newly-created block job. If omitted, |
1749 | the device name will be used. (json-string, optional) | |
df92562e FZ |
1750 | - "device": device name to operate on (json-string) |
1751 | - "target": device name to mirror to (json-string) | |
1752 | - "replaces": the block driver node name to replace when finished | |
1753 | (json-string, optional) | |
1754 | - "speed": maximum speed of the streaming job, in bytes per second | |
1755 | (json-int) | |
1756 | - "granularity": granularity of the dirty bitmap, in bytes (json-int, optional) | |
1757 | - "buf_size": maximum amount of data in flight from source to target, in bytes | |
1758 | (json-int, default 10M) | |
1759 | - "sync": what parts of the disk image should be copied to the destination; | |
1760 | possibilities include "full" for all the disk, "top" for only the sectors | |
1761 | allocated in the topmost image, or "none" to only replicate new I/O | |
1762 | (MirrorSyncMode). | |
1763 | - "on-source-error": the action to take on an error on the source | |
1764 | (BlockdevOnError, default 'report') | |
1765 | - "on-target-error": the action to take on an error on the target | |
1766 | (BlockdevOnError, default 'report') | |
1767 | ||
1768 | The default value of the granularity is the image cluster size clamped | |
1769 | between 4096 and 65536, if the image format defines one. If the format | |
1770 | does not define a cluster size, the default value of the granularity | |
1771 | is 65536. | |
1772 | ||
1773 | Example: | |
1774 | ||
1775 | -> { "execute": "blockdev-mirror", "arguments": { "device": "ide-hd0", | |
1776 | "target": "target0", | |
1777 | "sync": "full" } } | |
1778 | <- { "return": {} } | |
1779 | ||
1780 | EQMP | |
fa40e656 JC |
1781 | { |
1782 | .name = "change-backing-file", | |
1783 | .args_type = "device:s,image-node-name:s,backing-file:s", | |
7fad30f0 | 1784 | .mhandler.cmd_new = qmp_marshal_change_backing_file, |
fa40e656 JC |
1785 | }, |
1786 | ||
1787 | SQMP | |
1788 | change-backing-file | |
1789 | ------------------- | |
1790 | Since: 2.1 | |
1791 | ||
1792 | Change the backing file in the image file metadata. This does not cause | |
1793 | QEMU to reopen the image file to reparse the backing filename (it may, | |
1794 | however, perform a reopen to change permissions from r/o -> r/w -> r/o, | |
1795 | if needed). The new backing file string is written into the image file | |
1796 | metadata, and the QEMU internal strings are updated. | |
1797 | ||
1798 | Arguments: | |
1799 | ||
1800 | - "image-node-name": The name of the block driver state node of the | |
1801 | image to modify. The "device" is argument is used to | |
1802 | verify "image-node-name" is in the chain described by | |
1803 | "device". | |
1804 | (json-string, optional) | |
1805 | ||
1806 | - "device": The name of the device. | |
1807 | (json-string) | |
1808 | ||
1809 | - "backing-file": The string to write as the backing file. This string is | |
1810 | not validated, so care should be taken when specifying | |
1811 | the string or the image chain may not be able to be | |
1812 | reopened again. | |
1813 | (json-string) | |
1814 | ||
1815 | Returns: Nothing on success | |
1816 | If "device" does not exist or cannot be determined, DeviceNotFound | |
1817 | ||
82a56f0d LC |
1818 | EQMP |
1819 | ||
1820 | { | |
1821 | .name = "balloon", | |
1822 | .args_type = "value:M", | |
7fad30f0 | 1823 | .mhandler.cmd_new = qmp_marshal_balloon, |
82a56f0d LC |
1824 | }, |
1825 | ||
1826 | SQMP | |
1827 | balloon | |
1828 | ------- | |
1829 | ||
1830 | Request VM to change its memory allocation (in bytes). | |
1831 | ||
1832 | Arguments: | |
1833 | ||
1834 | - "value": New memory allocation (json-int) | |
1835 | ||
1836 | Example: | |
1837 | ||
1838 | -> { "execute": "balloon", "arguments": { "value": 536870912 } } | |
1839 | <- { "return": {} } | |
1840 | ||
1841 | EQMP | |
1842 | ||
1843 | { | |
1844 | .name = "set_link", | |
1845 | .args_type = "name:s,up:b", | |
7fad30f0 | 1846 | .mhandler.cmd_new = qmp_marshal_set_link, |
82a56f0d LC |
1847 | }, |
1848 | ||
1849 | SQMP | |
1850 | set_link | |
1851 | -------- | |
1852 | ||
1853 | Change the link status of a network adapter. | |
1854 | ||
1855 | Arguments: | |
1856 | ||
1857 | - "name": network device name (json-string) | |
1858 | - "up": status is up (json-bool) | |
1859 | ||
1860 | Example: | |
1861 | ||
1862 | -> { "execute": "set_link", "arguments": { "name": "e1000.0", "up": false } } | |
1863 | <- { "return": {} } | |
1864 | ||
1865 | EQMP | |
1866 | ||
1867 | { | |
1868 | .name = "getfd", | |
1869 | .args_type = "fdname:s", | |
1870 | .params = "getfd name", | |
1871 | .help = "receive a file descriptor via SCM rights and assign it a name", | |
7fad30f0 | 1872 | .mhandler.cmd_new = qmp_marshal_getfd, |
82a56f0d LC |
1873 | }, |
1874 | ||
1875 | SQMP | |
1876 | getfd | |
1877 | ----- | |
1878 | ||
1879 | Receive a file descriptor via SCM rights and assign it a name. | |
1880 | ||
1881 | Arguments: | |
1882 | ||
1883 | - "fdname": file descriptor name (json-string) | |
1884 | ||
1885 | Example: | |
1886 | ||
1887 | -> { "execute": "getfd", "arguments": { "fdname": "fd1" } } | |
1888 | <- { "return": {} } | |
1889 | ||
208c9d1b CB |
1890 | Notes: |
1891 | ||
1892 | (1) If the name specified by the "fdname" argument already exists, | |
1893 | the file descriptor assigned to it will be closed and replaced | |
1894 | by the received file descriptor. | |
1895 | (2) The 'closefd' command can be used to explicitly close the file | |
1896 | descriptor when it is no longer needed. | |
1897 | ||
82a56f0d LC |
1898 | EQMP |
1899 | ||
1900 | { | |
1901 | .name = "closefd", | |
1902 | .args_type = "fdname:s", | |
1903 | .params = "closefd name", | |
1904 | .help = "close a file descriptor previously passed via SCM rights", | |
7fad30f0 | 1905 | .mhandler.cmd_new = qmp_marshal_closefd, |
82a56f0d LC |
1906 | }, |
1907 | ||
1908 | SQMP | |
1909 | closefd | |
1910 | ------- | |
1911 | ||
1912 | Close a file descriptor previously passed via SCM rights. | |
1913 | ||
1914 | Arguments: | |
1915 | ||
1916 | - "fdname": file descriptor name (json-string) | |
1917 | ||
1918 | Example: | |
1919 | ||
1920 | -> { "execute": "closefd", "arguments": { "fdname": "fd1" } } | |
1921 | <- { "return": {} } | |
1922 | ||
ba1c048a CB |
1923 | EQMP |
1924 | ||
1925 | { | |
1926 | .name = "add-fd", | |
1927 | .args_type = "fdset-id:i?,opaque:s?", | |
1928 | .params = "add-fd fdset-id opaque", | |
1929 | .help = "Add a file descriptor, that was passed via SCM rights, to an fd set", | |
7fad30f0 | 1930 | .mhandler.cmd_new = qmp_marshal_add_fd, |
ba1c048a CB |
1931 | }, |
1932 | ||
1933 | SQMP | |
1934 | add-fd | |
1935 | ------- | |
1936 | ||
1937 | Add a file descriptor, that was passed via SCM rights, to an fd set. | |
1938 | ||
1939 | Arguments: | |
1940 | ||
1941 | - "fdset-id": The ID of the fd set to add the file descriptor to. | |
1942 | (json-int, optional) | |
1943 | - "opaque": A free-form string that can be used to describe the fd. | |
1944 | (json-string, optional) | |
1945 | ||
1946 | Return a json-object with the following information: | |
1947 | ||
1948 | - "fdset-id": The ID of the fd set that the fd was added to. (json-int) | |
1949 | - "fd": The file descriptor that was received via SCM rights and added to the | |
1950 | fd set. (json-int) | |
1951 | ||
1952 | Example: | |
1953 | ||
1954 | -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } } | |
1955 | <- { "return": { "fdset-id": 1, "fd": 3 } } | |
1956 | ||
1957 | Notes: | |
1958 | ||
1959 | (1) The list of fd sets is shared by all monitor connections. | |
1960 | (2) If "fdset-id" is not specified, a new fd set will be created. | |
1961 | ||
1962 | EQMP | |
1963 | ||
1964 | { | |
1965 | .name = "remove-fd", | |
1966 | .args_type = "fdset-id:i,fd:i?", | |
1967 | .params = "remove-fd fdset-id fd", | |
1968 | .help = "Remove a file descriptor from an fd set", | |
7fad30f0 | 1969 | .mhandler.cmd_new = qmp_marshal_remove_fd, |
ba1c048a CB |
1970 | }, |
1971 | ||
1972 | SQMP | |
1973 | remove-fd | |
1974 | --------- | |
1975 | ||
1976 | Remove a file descriptor from an fd set. | |
1977 | ||
1978 | Arguments: | |
1979 | ||
1980 | - "fdset-id": The ID of the fd set that the file descriptor belongs to. | |
1981 | (json-int) | |
1982 | - "fd": The file descriptor that is to be removed. (json-int, optional) | |
1983 | ||
1984 | Example: | |
1985 | ||
1986 | -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } } | |
1987 | <- { "return": {} } | |
1988 | ||
1989 | Notes: | |
1990 | ||
1991 | (1) The list of fd sets is shared by all monitor connections. | |
1992 | (2) If "fd" is not specified, all file descriptors in "fdset-id" will be | |
1993 | removed. | |
1994 | ||
1995 | EQMP | |
1996 | ||
1997 | { | |
1998 | .name = "query-fdsets", | |
1999 | .args_type = "", | |
2000 | .help = "Return information describing all fd sets", | |
7fad30f0 | 2001 | .mhandler.cmd_new = qmp_marshal_query_fdsets, |
ba1c048a CB |
2002 | }, |
2003 | ||
2004 | SQMP | |
2005 | query-fdsets | |
2006 | ------------- | |
2007 | ||
2008 | Return information describing all fd sets. | |
2009 | ||
2010 | Arguments: None | |
2011 | ||
2012 | Example: | |
2013 | ||
2014 | -> { "execute": "query-fdsets" } | |
2015 | <- { "return": [ | |
2016 | { | |
2017 | "fds": [ | |
2018 | { | |
2019 | "fd": 30, | |
2020 | "opaque": "rdonly:/path/to/file" | |
2021 | }, | |
2022 | { | |
2023 | "fd": 24, | |
2024 | "opaque": "rdwr:/path/to/file" | |
2025 | } | |
2026 | ], | |
2027 | "fdset-id": 1 | |
2028 | }, | |
2029 | { | |
2030 | "fds": [ | |
2031 | { | |
2032 | "fd": 28 | |
2033 | }, | |
2034 | { | |
2035 | "fd": 29 | |
2036 | } | |
2037 | ], | |
2038 | "fdset-id": 0 | |
2039 | } | |
2040 | ] | |
2041 | } | |
2042 | ||
2043 | Note: The list of fd sets is shared by all monitor connections. | |
2044 | ||
82a56f0d LC |
2045 | EQMP |
2046 | ||
2047 | { | |
2048 | .name = "block_passwd", | |
12d3ba82 | 2049 | .args_type = "device:s?,node-name:s?,password:s", |
7fad30f0 | 2050 | .mhandler.cmd_new = qmp_marshal_block_passwd, |
82a56f0d LC |
2051 | }, |
2052 | ||
2053 | SQMP | |
2054 | block_passwd | |
2055 | ------------ | |
2056 | ||
2057 | Set the password of encrypted block devices. | |
2058 | ||
2059 | Arguments: | |
2060 | ||
2061 | - "device": device name (json-string) | |
12d3ba82 | 2062 | - "node-name": name in the block driver state graph (json-string) |
82a56f0d LC |
2063 | - "password": password (json-string) |
2064 | ||
2065 | Example: | |
2066 | ||
2067 | -> { "execute": "block_passwd", "arguments": { "device": "ide0-hd0", | |
2068 | "password": "12345" } } | |
2069 | <- { "return": {} } | |
2070 | ||
727f005e ZYW |
2071 | EQMP |
2072 | ||
2073 | { | |
2074 | .name = "block_set_io_throttle", | |
dce13204 | 2075 | .args_type = "device:B,bps:l,bps_rd:l,bps_wr:l,iops:l,iops_rd:l,iops_wr:l,bps_max:l?,bps_rd_max:l?,bps_wr_max:l?,iops_max:l?,iops_rd_max:l?,iops_wr_max:l?,bps_max_length:l?,bps_rd_max_length:l?,bps_wr_max_length:l?,iops_max_length:l?,iops_rd_max_length:l?,iops_wr_max_length:l?,iops_size:l?,group:s?", |
7fad30f0 | 2076 | .mhandler.cmd_new = qmp_marshal_block_set_io_throttle, |
727f005e ZYW |
2077 | }, |
2078 | ||
2079 | SQMP | |
2080 | block_set_io_throttle | |
2081 | ------------ | |
2082 | ||
2083 | Change I/O throttle limits for a block drive. | |
2084 | ||
2085 | Arguments: | |
2086 | ||
2087 | - "device": device name (json-string) | |
586b5466 EB |
2088 | - "bps": total throughput limit in bytes per second (json-int) |
2089 | - "bps_rd": read throughput limit in bytes per second (json-int) | |
2090 | - "bps_wr": write throughput limit in bytes per second (json-int) | |
2091 | - "iops": total I/O operations per second (json-int) | |
2092 | - "iops_rd": read I/O operations per second (json-int) | |
2093 | - "iops_wr": write I/O operations per second (json-int) | |
dce13204 AG |
2094 | - "bps_max": total throughput limit during bursts, in bytes (json-int, optional) |
2095 | - "bps_rd_max": read throughput limit during bursts, in bytes (json-int, optional) | |
2096 | - "bps_wr_max": write throughput limit during bursts, in bytes (json-int, optional) | |
2097 | - "iops_max": total I/O operations per second during bursts (json-int, optional) | |
2098 | - "iops_rd_max": read I/O operations per second during bursts (json-int, optional) | |
2099 | - "iops_wr_max": write I/O operations per second during bursts (json-int, optional) | |
2100 | - "bps_max_length": maximum length of the @bps_max burst period, in seconds (json-int, optional) | |
2101 | - "bps_rd_max_length": maximum length of the @bps_rd_max burst period, in seconds (json-int, optional) | |
2102 | - "bps_wr_max_length": maximum length of the @bps_wr_max burst period, in seconds (json-int, optional) | |
2103 | - "iops_max_length": maximum length of the @iops_max burst period, in seconds (json-int, optional) | |
2104 | - "iops_rd_max_length": maximum length of the @iops_rd_max burst period, in seconds (json-int, optional) | |
2105 | - "iops_wr_max_length": maximum length of the @iops_wr_max burst period, in seconds (json-int, optional) | |
2106 | - "iops_size": I/O size in bytes when limiting (json-int, optional) | |
2107 | - "group": throttle group name (json-string, optional) | |
727f005e ZYW |
2108 | |
2109 | Example: | |
2110 | ||
2111 | -> { "execute": "block_set_io_throttle", "arguments": { "device": "virtio0", | |
586b5466 EB |
2112 | "bps": 1000000, |
2113 | "bps_rd": 0, | |
2114 | "bps_wr": 0, | |
2115 | "iops": 0, | |
2116 | "iops_rd": 0, | |
3e9fab69 BC |
2117 | "iops_wr": 0, |
2118 | "bps_max": 8000000, | |
2119 | "bps_rd_max": 0, | |
2120 | "bps_wr_max": 0, | |
2121 | "iops_max": 0, | |
2122 | "iops_rd_max": 0, | |
2024c1df | 2123 | "iops_wr_max": 0, |
dce13204 | 2124 | "bps_max_length": 60, |
2024c1df | 2125 | "iops_size": 0 } } |
727f005e ZYW |
2126 | <- { "return": {} } |
2127 | ||
7572150c GH |
2128 | EQMP |
2129 | ||
2130 | { | |
2131 | .name = "set_password", | |
2132 | .args_type = "protocol:s,password:s,connected:s?", | |
7fad30f0 | 2133 | .mhandler.cmd_new = qmp_marshal_set_password, |
7572150c GH |
2134 | }, |
2135 | ||
2136 | SQMP | |
2137 | set_password | |
2138 | ------------ | |
2139 | ||
2140 | Set the password for vnc/spice protocols. | |
2141 | ||
2142 | Arguments: | |
2143 | ||
2144 | - "protocol": protocol name (json-string) | |
2145 | - "password": password (json-string) | |
3599d46b | 2146 | - "connected": [ keep | disconnect | fail ] (json-string, optional) |
7572150c GH |
2147 | |
2148 | Example: | |
2149 | ||
2150 | -> { "execute": "set_password", "arguments": { "protocol": "vnc", | |
2151 | "password": "secret" } } | |
2152 | <- { "return": {} } | |
2153 | ||
2154 | EQMP | |
2155 | ||
2156 | { | |
2157 | .name = "expire_password", | |
2158 | .args_type = "protocol:s,time:s", | |
7fad30f0 | 2159 | .mhandler.cmd_new = qmp_marshal_expire_password, |
7572150c GH |
2160 | }, |
2161 | ||
2162 | SQMP | |
2163 | expire_password | |
2164 | --------------- | |
2165 | ||
2166 | Set the password expire time for vnc/spice protocols. | |
2167 | ||
2168 | Arguments: | |
2169 | ||
2170 | - "protocol": protocol name (json-string) | |
2171 | - "time": [ now | never | +secs | secs ] (json-string) | |
2172 | ||
2173 | Example: | |
2174 | ||
2175 | -> { "execute": "expire_password", "arguments": { "protocol": "vnc", | |
2176 | "time": "+60" } } | |
2177 | <- { "return": {} } | |
2178 | ||
82a56f0d LC |
2179 | EQMP |
2180 | ||
13661089 DB |
2181 | { |
2182 | .name = "add_client", | |
f1f5f407 | 2183 | .args_type = "protocol:s,fdname:s,skipauth:b?,tls:b?", |
7fad30f0 | 2184 | .mhandler.cmd_new = qmp_marshal_add_client, |
13661089 DB |
2185 | }, |
2186 | ||
2187 | SQMP | |
2188 | add_client | |
2189 | ---------- | |
2190 | ||
2191 | Add a graphics client | |
2192 | ||
2193 | Arguments: | |
2194 | ||
2195 | - "protocol": protocol name (json-string) | |
2196 | - "fdname": file descriptor name (json-string) | |
f1f5f407 DB |
2197 | - "skipauth": whether to skip authentication (json-bool, optional) |
2198 | - "tls": whether to perform TLS (json-bool, optional) | |
13661089 DB |
2199 | |
2200 | Example: | |
2201 | ||
2202 | -> { "execute": "add_client", "arguments": { "protocol": "vnc", | |
2203 | "fdname": "myclient" } } | |
2204 | <- { "return": {} } | |
2205 | ||
2206 | EQMP | |
82a56f0d LC |
2207 | { |
2208 | .name = "qmp_capabilities", | |
2209 | .args_type = "", | |
2210 | .params = "", | |
2211 | .help = "enable QMP capabilities", | |
485febc6 | 2212 | .mhandler.cmd_new = qmp_capabilities, |
82a56f0d LC |
2213 | }, |
2214 | ||
2215 | SQMP | |
2216 | qmp_capabilities | |
2217 | ---------------- | |
2218 | ||
2219 | Enable QMP capabilities. | |
2220 | ||
2221 | Arguments: None. | |
2222 | ||
2223 | Example: | |
2224 | ||
2225 | -> { "execute": "qmp_capabilities" } | |
2226 | <- { "return": {} } | |
2227 | ||
2228 | Note: This command must be issued before issuing any other command. | |
2229 | ||
0268d97c LC |
2230 | EQMP |
2231 | ||
2232 | { | |
2233 | .name = "human-monitor-command", | |
2234 | .args_type = "command-line:s,cpu-index:i?", | |
7fad30f0 | 2235 | .mhandler.cmd_new = qmp_marshal_human_monitor_command, |
0268d97c LC |
2236 | }, |
2237 | ||
2238 | SQMP | |
2239 | human-monitor-command | |
2240 | --------------------- | |
2241 | ||
2242 | Execute a Human Monitor command. | |
2243 | ||
2244 | Arguments: | |
2245 | ||
2246 | - command-line: the command name and its arguments, just like the | |
2247 | Human Monitor's shell (json-string) | |
2248 | - cpu-index: select the CPU number to be used by commands which access CPU | |
2249 | data, like 'info registers'. The Monitor selects CPU 0 if this | |
2250 | argument is not provided (json-int, optional) | |
2251 | ||
2252 | Example: | |
2253 | ||
2254 | -> { "execute": "human-monitor-command", "arguments": { "command-line": "info kvm" } } | |
2255 | <- { "return": "kvm support: enabled\r\n" } | |
2256 | ||
2257 | Notes: | |
2258 | ||
2259 | (1) The Human Monitor is NOT an stable interface, this means that command | |
2260 | names, arguments and responses can change or be removed at ANY time. | |
2261 | Applications that rely on long term stability guarantees should NOT | |
2262 | use this command | |
2263 | ||
2264 | (2) Limitations: | |
2265 | ||
2266 | o This command is stateless, this means that commands that depend | |
2267 | on state information (such as getfd) might not work | |
2268 | ||
2269 | o Commands that prompt the user for data (eg. 'cont' when the block | |
2270 | device is encrypted) don't currently work | |
2271 | ||
82a56f0d LC |
2272 | 3. Query Commands |
2273 | ================= | |
2274 | ||
2275 | HXCOMM Each query command below is inside a SQMP/EQMP section, do NOT change | |
2276 | HXCOMM this! We will possibly move query commands definitions inside those | |
2277 | HXCOMM sections, just like regular commands. | |
2278 | ||
2279 | EQMP | |
2280 | ||
2281 | SQMP | |
2282 | query-version | |
2283 | ------------- | |
2284 | ||
2285 | Show QEMU version. | |
2286 | ||
2287 | Return a json-object with the following information: | |
2288 | ||
2289 | - "qemu": A json-object containing three integer values: | |
2290 | - "major": QEMU's major version (json-int) | |
2291 | - "minor": QEMU's minor version (json-int) | |
2292 | - "micro": QEMU's micro version (json-int) | |
2293 | - "package": package's version (json-string) | |
2294 | ||
2295 | Example: | |
2296 | ||
2297 | -> { "execute": "query-version" } | |
2298 | <- { | |
2299 | "return":{ | |
2300 | "qemu":{ | |
2301 | "major":0, | |
2302 | "minor":11, | |
2303 | "micro":5 | |
2304 | }, | |
2305 | "package":"" | |
2306 | } | |
2307 | } | |
2308 | ||
2309 | EQMP | |
2310 | ||
b9c15f16 LC |
2311 | { |
2312 | .name = "query-version", | |
2313 | .args_type = "", | |
7fad30f0 | 2314 | .mhandler.cmd_new = qmp_marshal_query_version, |
b9c15f16 LC |
2315 | }, |
2316 | ||
82a56f0d LC |
2317 | SQMP |
2318 | query-commands | |
2319 | -------------- | |
2320 | ||
2321 | List QMP available commands. | |
2322 | ||
2323 | Each command is represented by a json-object, the returned value is a json-array | |
2324 | of all commands. | |
2325 | ||
2326 | Each json-object contain: | |
2327 | ||
2328 | - "name": command's name (json-string) | |
2329 | ||
2330 | Example: | |
2331 | ||
2332 | -> { "execute": "query-commands" } | |
2333 | <- { | |
2334 | "return":[ | |
2335 | { | |
2336 | "name":"query-balloon" | |
2337 | }, | |
2338 | { | |
2339 | "name":"system_powerdown" | |
2340 | } | |
2341 | ] | |
2342 | } | |
2343 | ||
2344 | Note: This example has been shortened as the real response is too long. | |
2345 | ||
2346 | EQMP | |
2347 | ||
aa9b79bc LC |
2348 | { |
2349 | .name = "query-commands", | |
2350 | .args_type = "", | |
7fad30f0 | 2351 | .mhandler.cmd_new = qmp_marshal_query_commands, |
aa9b79bc LC |
2352 | }, |
2353 | ||
4860853d DB |
2354 | SQMP |
2355 | query-events | |
2356 | -------------- | |
2357 | ||
2358 | List QMP available events. | |
2359 | ||
2360 | Each event is represented by a json-object, the returned value is a json-array | |
2361 | of all events. | |
2362 | ||
2363 | Each json-object contains: | |
2364 | ||
2365 | - "name": event's name (json-string) | |
2366 | ||
2367 | Example: | |
2368 | ||
2369 | -> { "execute": "query-events" } | |
2370 | <- { | |
2371 | "return":[ | |
2372 | { | |
2373 | "name":"SHUTDOWN" | |
2374 | }, | |
2375 | { | |
2376 | "name":"RESET" | |
2377 | } | |
2378 | ] | |
2379 | } | |
2380 | ||
2381 | Note: This example has been shortened as the real response is too long. | |
2382 | ||
2383 | EQMP | |
2384 | ||
2385 | { | |
2386 | .name = "query-events", | |
2387 | .args_type = "", | |
7fad30f0 | 2388 | .mhandler.cmd_new = qmp_marshal_query_events, |
4860853d DB |
2389 | }, |
2390 | ||
39a18158 MA |
2391 | SQMP |
2392 | query-qmp-schema | |
2393 | ---------------- | |
2394 | ||
2395 | Return the QMP wire schema. The returned value is a json-array of | |
2396 | named schema entities. Entities are commands, events and various | |
2397 | types. See docs/qapi-code-gen.txt for information on their structure | |
2398 | and intended use. | |
2399 | ||
2400 | EQMP | |
2401 | ||
2402 | { | |
2403 | .name = "query-qmp-schema", | |
2404 | .args_type = "", | |
2405 | .mhandler.cmd_new = qmp_query_qmp_schema, | |
2406 | }, | |
2407 | ||
82a56f0d LC |
2408 | SQMP |
2409 | query-chardev | |
2410 | ------------- | |
2411 | ||
2412 | Each device is represented by a json-object. The returned value is a json-array | |
2413 | of all devices. | |
2414 | ||
2415 | Each json-object contain the following: | |
2416 | ||
2417 | - "label": device's label (json-string) | |
2418 | - "filename": device's file (json-string) | |
32a97ea1 LE |
2419 | - "frontend-open": open/closed state of the frontend device attached to this |
2420 | backend (json-bool) | |
82a56f0d LC |
2421 | |
2422 | Example: | |
2423 | ||
2424 | -> { "execute": "query-chardev" } | |
2425 | <- { | |
32a97ea1 LE |
2426 | "return": [ |
2427 | { | |
2428 | "label": "charchannel0", | |
2429 | "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server", | |
2430 | "frontend-open": false | |
2431 | }, | |
82a56f0d | 2432 | { |
32a97ea1 LE |
2433 | "label": "charmonitor", |
2434 | "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server", | |
2435 | "frontend-open": true | |
82a56f0d LC |
2436 | }, |
2437 | { | |
32a97ea1 LE |
2438 | "label": "charserial0", |
2439 | "filename": "pty:/dev/pts/2", | |
2440 | "frontend-open": true | |
82a56f0d LC |
2441 | } |
2442 | ] | |
2443 | } | |
2444 | ||
2445 | EQMP | |
2446 | ||
c5a415a0 LC |
2447 | { |
2448 | .name = "query-chardev", | |
2449 | .args_type = "", | |
7fad30f0 | 2450 | .mhandler.cmd_new = qmp_marshal_query_chardev, |
c5a415a0 LC |
2451 | }, |
2452 | ||
77d1c3c6 MK |
2453 | SQMP |
2454 | query-chardev-backends | |
2455 | ------------- | |
2456 | ||
2457 | List available character device backends. | |
2458 | ||
2459 | Each backend is represented by a json-object, the returned value is a json-array | |
2460 | of all backends. | |
2461 | ||
2462 | Each json-object contains: | |
2463 | ||
2464 | - "name": backend name (json-string) | |
2465 | ||
2466 | Example: | |
2467 | ||
2468 | -> { "execute": "query-chardev-backends" } | |
2469 | <- { | |
2470 | "return":[ | |
2471 | { | |
2472 | "name":"udp" | |
2473 | }, | |
2474 | { | |
2475 | "name":"tcp" | |
2476 | }, | |
2477 | { | |
2478 | "name":"unix" | |
2479 | }, | |
2480 | { | |
2481 | "name":"spiceport" | |
2482 | } | |
2483 | ] | |
2484 | } | |
2485 | ||
2486 | EQMP | |
2487 | ||
2488 | { | |
2489 | .name = "query-chardev-backends", | |
2490 | .args_type = "", | |
7fad30f0 | 2491 | .mhandler.cmd_new = qmp_marshal_query_chardev_backends, |
77d1c3c6 MK |
2492 | }, |
2493 | ||
82a56f0d LC |
2494 | SQMP |
2495 | query-block | |
2496 | ----------- | |
2497 | ||
2498 | Show the block devices. | |
2499 | ||
2500 | Each block device information is stored in a json-object and the returned value | |
2501 | is a json-array of all devices. | |
2502 | ||
2503 | Each json-object contain the following: | |
2504 | ||
2505 | - "device": device name (json-string) | |
2506 | - "type": device type (json-string) | |
d8aeeb31 MA |
2507 | - deprecated, retained for backward compatibility |
2508 | - Possible values: "unknown" | |
82a56f0d LC |
2509 | - "removable": true if the device is removable, false otherwise (json-bool) |
2510 | - "locked": true if the device is locked, false otherwise (json-bool) | |
99f42808 | 2511 | - "tray_open": only present if removable, true if the device has a tray, |
e4def80b | 2512 | and it is open (json-bool) |
82a56f0d LC |
2513 | - "inserted": only present if the device is inserted, it is a json-object |
2514 | containing the following: | |
2515 | - "file": device file name (json-string) | |
2516 | - "ro": true if read-only, false otherwise (json-bool) | |
2517 | - "drv": driver format name (json-string) | |
550830f9 | 2518 | - Possible values: "blkdebug", "bochs", "cloop", "dmg", |
82a56f0d | 2519 | "file", "file", "ftp", "ftps", "host_cdrom", |
92a539d2 | 2520 | "host_device", "http", "https", |
82a56f0d LC |
2521 | "nbd", "parallels", "qcow", "qcow2", "raw", |
2522 | "tftp", "vdi", "vmdk", "vpc", "vvfat" | |
2523 | - "backing_file": backing file name (json-string, optional) | |
2e3e3317 | 2524 | - "backing_file_depth": number of files in the backing file chain (json-int) |
82a56f0d | 2525 | - "encrypted": true if encrypted, false otherwise (json-bool) |
727f005e ZYW |
2526 | - "bps": limit total bytes per second (json-int) |
2527 | - "bps_rd": limit read bytes per second (json-int) | |
2528 | - "bps_wr": limit write bytes per second (json-int) | |
2529 | - "iops": limit total I/O operations per second (json-int) | |
2530 | - "iops_rd": limit read operations per second (json-int) | |
2531 | - "iops_wr": limit write operations per second (json-int) | |
3e9fab69 BC |
2532 | - "bps_max": total max in bytes (json-int) |
2533 | - "bps_rd_max": read max in bytes (json-int) | |
2534 | - "bps_wr_max": write max in bytes (json-int) | |
2535 | - "iops_max": total I/O operations max (json-int) | |
2536 | - "iops_rd_max": read I/O operations max (json-int) | |
2537 | - "iops_wr_max": write I/O operations max (json-int) | |
2024c1df | 2538 | - "iops_size": I/O size when limiting by iops (json-int) |
465bee1d PL |
2539 | - "detect_zeroes": detect and optimize zero writing (json-string) |
2540 | - Possible values: "off", "on", "unmap" | |
e2462113 FR |
2541 | - "write_threshold": write offset threshold in bytes, a event will be |
2542 | emitted if crossed. Zero if disabled (json-int) | |
553a7e87 WX |
2543 | - "image": the detail of the image, it is a json-object containing |
2544 | the following: | |
2545 | - "filename": image file name (json-string) | |
2546 | - "format": image format (json-string) | |
2547 | - "virtual-size": image capacity in bytes (json-int) | |
2548 | - "dirty-flag": true if image is not cleanly closed, not present | |
2549 | means clean (json-bool, optional) | |
2550 | - "actual-size": actual size on disk in bytes of the image, not | |
2551 | present when image does not support thin | |
2552 | provision (json-int, optional) | |
2553 | - "cluster-size": size of a cluster in bytes, not present if image | |
2554 | format does not support it (json-int, optional) | |
2555 | - "encrypted": true if the image is encrypted, not present means | |
2556 | false or the image format does not support | |
2557 | encryption (json-bool, optional) | |
2558 | - "backing_file": backing file name, not present means no backing | |
2559 | file is used or the image format does not | |
2560 | support backing file chain | |
2561 | (json-string, optional) | |
2562 | - "full-backing-filename": full path of the backing file, not | |
2563 | present if it equals backing_file or no | |
2564 | backing file is used | |
2565 | (json-string, optional) | |
2566 | - "backing-filename-format": the format of the backing file, not | |
2567 | present means unknown or no backing | |
2568 | file (json-string, optional) | |
2569 | - "snapshots": the internal snapshot info, it is an optional list | |
2570 | of json-object containing the following: | |
2571 | - "id": unique snapshot id (json-string) | |
2572 | - "name": snapshot name (json-string) | |
2573 | - "vm-state-size": size of the VM state in bytes (json-int) | |
2574 | - "date-sec": UTC date of the snapshot in seconds (json-int) | |
2575 | - "date-nsec": fractional part in nanoseconds to be used with | |
586b5466 | 2576 | date-sec (json-int) |
553a7e87 WX |
2577 | - "vm-clock-sec": VM clock relative to boot in seconds |
2578 | (json-int) | |
2579 | - "vm-clock-nsec": fractional part in nanoseconds to be used | |
2580 | with vm-clock-sec (json-int) | |
2581 | - "backing-image": the detail of the backing image, it is an | |
2582 | optional json-object only present when a | |
2583 | backing image present for this image | |
727f005e | 2584 | |
f04ef601 LC |
2585 | - "io-status": I/O operation status, only present if the device supports it |
2586 | and the VM is configured to stop on errors. It's always reset | |
2587 | to "ok" when the "cont" command is issued (json_string, optional) | |
2588 | - Possible values: "ok", "failed", "nospace" | |
82a56f0d LC |
2589 | |
2590 | Example: | |
2591 | ||
2592 | -> { "execute": "query-block" } | |
2593 | <- { | |
2594 | "return":[ | |
2595 | { | |
f04ef601 | 2596 | "io-status": "ok", |
82a56f0d LC |
2597 | "device":"ide0-hd0", |
2598 | "locked":false, | |
2599 | "removable":false, | |
2600 | "inserted":{ | |
2601 | "ro":false, | |
2602 | "drv":"qcow2", | |
2603 | "encrypted":false, | |
553a7e87 WX |
2604 | "file":"disks/test.qcow2", |
2605 | "backing_file_depth":1, | |
727f005e ZYW |
2606 | "bps":1000000, |
2607 | "bps_rd":0, | |
2608 | "bps_wr":0, | |
2609 | "iops":1000000, | |
2610 | "iops_rd":0, | |
2611 | "iops_wr":0, | |
3e9fab69 BC |
2612 | "bps_max": 8000000, |
2613 | "bps_rd_max": 0, | |
2614 | "bps_wr_max": 0, | |
2615 | "iops_max": 0, | |
2616 | "iops_rd_max": 0, | |
2617 | "iops_wr_max": 0, | |
2024c1df | 2618 | "iops_size": 0, |
465bee1d | 2619 | "detect_zeroes": "on", |
e2462113 | 2620 | "write_threshold": 0, |
553a7e87 WX |
2621 | "image":{ |
2622 | "filename":"disks/test.qcow2", | |
2623 | "format":"qcow2", | |
2624 | "virtual-size":2048000, | |
2625 | "backing_file":"base.qcow2", | |
2626 | "full-backing-filename":"disks/base.qcow2", | |
5403432f | 2627 | "backing-filename-format":"qcow2", |
553a7e87 WX |
2628 | "snapshots":[ |
2629 | { | |
2630 | "id": "1", | |
2631 | "name": "snapshot1", | |
2632 | "vm-state-size": 0, | |
2633 | "date-sec": 10000200, | |
2634 | "date-nsec": 12, | |
2635 | "vm-clock-sec": 206, | |
2636 | "vm-clock-nsec": 30 | |
2637 | } | |
2638 | ], | |
2639 | "backing-image":{ | |
2640 | "filename":"disks/base.qcow2", | |
2641 | "format":"qcow2", | |
2642 | "virtual-size":2048000 | |
2643 | } | |
2644 | } | |
82a56f0d | 2645 | }, |
d8aeeb31 | 2646 | "type":"unknown" |
82a56f0d LC |
2647 | }, |
2648 | { | |
f04ef601 | 2649 | "io-status": "ok", |
82a56f0d LC |
2650 | "device":"ide1-cd0", |
2651 | "locked":false, | |
2652 | "removable":true, | |
d8aeeb31 | 2653 | "type":"unknown" |
82a56f0d LC |
2654 | }, |
2655 | { | |
2656 | "device":"floppy0", | |
2657 | "locked":false, | |
2658 | "removable":true, | |
d8aeeb31 | 2659 | "type":"unknown" |
82a56f0d LC |
2660 | }, |
2661 | { | |
2662 | "device":"sd0", | |
2663 | "locked":false, | |
2664 | "removable":true, | |
d8aeeb31 | 2665 | "type":"unknown" |
82a56f0d LC |
2666 | } |
2667 | ] | |
2668 | } | |
2669 | ||
2670 | EQMP | |
2671 | ||
b2023818 LC |
2672 | { |
2673 | .name = "query-block", | |
2674 | .args_type = "", | |
7fad30f0 | 2675 | .mhandler.cmd_new = qmp_marshal_query_block, |
b2023818 LC |
2676 | }, |
2677 | ||
82a56f0d LC |
2678 | SQMP |
2679 | query-blockstats | |
2680 | ---------------- | |
2681 | ||
2682 | Show block device statistics. | |
2683 | ||
2684 | Each device statistic information is stored in a json-object and the returned | |
2685 | value is a json-array of all devices. | |
2686 | ||
2687 | Each json-object contain the following: | |
2688 | ||
2689 | - "device": device name (json-string) | |
2690 | - "stats": A json-object with the statistics information, it contains: | |
2691 | - "rd_bytes": bytes read (json-int) | |
2692 | - "wr_bytes": bytes written (json-int) | |
2693 | - "rd_operations": read operations (json-int) | |
2694 | - "wr_operations": write operations (json-int) | |
e8045d67 | 2695 | - "flush_operations": cache flush operations (json-int) |
c488c7f6 CH |
2696 | - "wr_total_time_ns": total time spend on writes in nano-seconds (json-int) |
2697 | - "rd_total_time_ns": total time spend on reads in nano-seconds (json-int) | |
2698 | - "flush_total_time_ns": total time spend on cache flushes in nano-seconds (json-int) | |
53d8f9d8 HR |
2699 | - "wr_highest_offset": The offset after the greatest byte written to the |
2700 | BlockDriverState since it has been opened (json-int) | |
f4564d53 PL |
2701 | - "rd_merged": number of read requests that have been merged into |
2702 | another request (json-int) | |
2703 | - "wr_merged": number of write requests that have been merged into | |
2704 | another request (json-int) | |
cb38fffb AG |
2705 | - "idle_time_ns": time since the last I/O operation, in |
2706 | nanoseconds. If the field is absent it means | |
2707 | that there haven't been any operations yet | |
2708 | (json-int, optional) | |
7ee12daf AG |
2709 | - "failed_rd_operations": number of failed read operations |
2710 | (json-int) | |
2711 | - "failed_wr_operations": number of failed write operations | |
2712 | (json-int) | |
2713 | - "failed_flush_operations": number of failed flush operations | |
2714 | (json-int) | |
2715 | - "invalid_rd_operations": number of invalid read operations | |
2716 | (json-int) | |
2717 | - "invalid_wr_operations": number of invalid write operations | |
2718 | (json-int) | |
2719 | - "invalid_flush_operations": number of invalid flush operations | |
2720 | (json-int) | |
362e9299 AG |
2721 | - "account_invalid": whether invalid operations are included in |
2722 | the last access statistics (json-bool) | |
2723 | - "account_failed": whether failed operations are included in the | |
2724 | latency and last access statistics | |
2725 | (json-bool) | |
979e9b03 AG |
2726 | - "timed_stats": A json-array containing statistics collected in |
2727 | specific intervals, with the following members: | |
2728 | - "interval_length": interval used for calculating the | |
2729 | statistics, in seconds (json-int) | |
2730 | - "min_rd_latency_ns": minimum latency of read operations in | |
2731 | the defined interval, in nanoseconds | |
2732 | (json-int) | |
2733 | - "min_wr_latency_ns": minimum latency of write operations in | |
2734 | the defined interval, in nanoseconds | |
2735 | (json-int) | |
2736 | - "min_flush_latency_ns": minimum latency of flush operations | |
2737 | in the defined interval, in | |
2738 | nanoseconds (json-int) | |
2739 | - "max_rd_latency_ns": maximum latency of read operations in | |
2740 | the defined interval, in nanoseconds | |
2741 | (json-int) | |
2742 | - "max_wr_latency_ns": maximum latency of write operations in | |
2743 | the defined interval, in nanoseconds | |
2744 | (json-int) | |
2745 | - "max_flush_latency_ns": maximum latency of flush operations | |
2746 | in the defined interval, in | |
2747 | nanoseconds (json-int) | |
2748 | - "avg_rd_latency_ns": average latency of read operations in | |
2749 | the defined interval, in nanoseconds | |
2750 | (json-int) | |
2751 | - "avg_wr_latency_ns": average latency of write operations in | |
2752 | the defined interval, in nanoseconds | |
2753 | (json-int) | |
2754 | - "avg_flush_latency_ns": average latency of flush operations | |
2755 | in the defined interval, in | |
2756 | nanoseconds (json-int) | |
96e4deda AG |
2757 | - "avg_rd_queue_depth": average number of pending read |
2758 | operations in the defined interval | |
2759 | (json-number) | |
2760 | - "avg_wr_queue_depth": average number of pending write | |
2761 | operations in the defined interval | |
2762 | (json-number). | |
82a56f0d LC |
2763 | - "parent": Contains recursively the statistics of the underlying |
2764 | protocol (e.g. the host file for a qcow2 image). If there is | |
2765 | no underlying protocol, this field is omitted | |
2766 | (json-object, optional) | |
2767 | ||
2768 | Example: | |
2769 | ||
2770 | -> { "execute": "query-blockstats" } | |
2771 | <- { | |
2772 | "return":[ | |
2773 | { | |
2774 | "device":"ide0-hd0", | |
2775 | "parent":{ | |
2776 | "stats":{ | |
2777 | "wr_highest_offset":3686448128, | |
2778 | "wr_bytes":9786368, | |
2779 | "wr_operations":751, | |
2780 | "rd_bytes":122567168, | |
2781 | "rd_operations":36772 | |
c488c7f6 CH |
2782 | "wr_total_times_ns":313253456 |
2783 | "rd_total_times_ns":3465673657 | |
2784 | "flush_total_times_ns":49653 | |
e8045d67 | 2785 | "flush_operations":61, |
f4564d53 | 2786 | "rd_merged":0, |
cb38fffb | 2787 | "wr_merged":0, |
362e9299 AG |
2788 | "idle_time_ns":2953431879, |
2789 | "account_invalid":true, | |
2790 | "account_failed":false | |
82a56f0d LC |
2791 | } |
2792 | }, | |
2793 | "stats":{ | |
2794 | "wr_highest_offset":2821110784, | |
2795 | "wr_bytes":9786368, | |
2796 | "wr_operations":692, | |
2797 | "rd_bytes":122739200, | |
2798 | "rd_operations":36604 | |
e8045d67 | 2799 | "flush_operations":51, |
c488c7f6 CH |
2800 | "wr_total_times_ns":313253456 |
2801 | "rd_total_times_ns":3465673657 | |
f4564d53 PL |
2802 | "flush_total_times_ns":49653, |
2803 | "rd_merged":0, | |
cb38fffb | 2804 | "wr_merged":0, |
362e9299 AG |
2805 | "idle_time_ns":2953431879, |
2806 | "account_invalid":true, | |
2807 | "account_failed":false | |
82a56f0d LC |
2808 | } |
2809 | }, | |
2810 | { | |
2811 | "device":"ide1-cd0", | |
2812 | "stats":{ | |
2813 | "wr_highest_offset":0, | |
2814 | "wr_bytes":0, | |
2815 | "wr_operations":0, | |
2816 | "rd_bytes":0, | |
2817 | "rd_operations":0 | |
e8045d67 | 2818 | "flush_operations":0, |
c488c7f6 CH |
2819 | "wr_total_times_ns":0 |
2820 | "rd_total_times_ns":0 | |
f4564d53 PL |
2821 | "flush_total_times_ns":0, |
2822 | "rd_merged":0, | |
362e9299 AG |
2823 | "wr_merged":0, |
2824 | "account_invalid":false, | |
2825 | "account_failed":false | |
82a56f0d LC |
2826 | } |
2827 | }, | |
2828 | { | |
2829 | "device":"floppy0", | |
2830 | "stats":{ | |
2831 | "wr_highest_offset":0, | |
2832 | "wr_bytes":0, | |
2833 | "wr_operations":0, | |
2834 | "rd_bytes":0, | |
2835 | "rd_operations":0 | |
e8045d67 | 2836 | "flush_operations":0, |
c488c7f6 CH |
2837 | "wr_total_times_ns":0 |
2838 | "rd_total_times_ns":0 | |
f4564d53 PL |
2839 | "flush_total_times_ns":0, |
2840 | "rd_merged":0, | |
362e9299 AG |
2841 | "wr_merged":0, |
2842 | "account_invalid":false, | |
2843 | "account_failed":false | |
82a56f0d LC |
2844 | } |
2845 | }, | |
2846 | { | |
2847 | "device":"sd0", | |
2848 | "stats":{ | |
2849 | "wr_highest_offset":0, | |
2850 | "wr_bytes":0, | |
2851 | "wr_operations":0, | |
2852 | "rd_bytes":0, | |
2853 | "rd_operations":0 | |
e8045d67 | 2854 | "flush_operations":0, |
c488c7f6 CH |
2855 | "wr_total_times_ns":0 |
2856 | "rd_total_times_ns":0 | |
f4564d53 PL |
2857 | "flush_total_times_ns":0, |
2858 | "rd_merged":0, | |
362e9299 AG |
2859 | "wr_merged":0, |
2860 | "account_invalid":false, | |
2861 | "account_failed":false | |
82a56f0d LC |
2862 | } |
2863 | } | |
2864 | ] | |
2865 | } | |
2866 | ||
2867 | EQMP | |
2868 | ||
f11f57e4 LC |
2869 | { |
2870 | .name = "query-blockstats", | |
f71eaa74 | 2871 | .args_type = "query-nodes:b?", |
7fad30f0 | 2872 | .mhandler.cmd_new = qmp_marshal_query_blockstats, |
f11f57e4 LC |
2873 | }, |
2874 | ||
82a56f0d LC |
2875 | SQMP |
2876 | query-cpus | |
2877 | ---------- | |
2878 | ||
2879 | Show CPU information. | |
2880 | ||
2881 | Return a json-array. Each CPU is represented by a json-object, which contains: | |
2882 | ||
2883 | - "CPU": CPU index (json-int) | |
2884 | - "current": true if this is the current CPU, false otherwise (json-bool) | |
2885 | - "halted": true if the cpu is halted, false otherwise (json-bool) | |
58f88d4b | 2886 | - "qom_path": path to the CPU object in the QOM tree (json-str) |
86f4b687 EB |
2887 | - "arch": architecture of the cpu, which determines what additional |
2888 | keys will be present (json-str) | |
82a56f0d LC |
2889 | - Current program counter. The key's name depends on the architecture: |
2890 | "pc": i386/x86_64 (json-int) | |
2891 | "nip": PPC (json-int) | |
2892 | "pc" and "npc": sparc (json-int) | |
2893 | "PC": mips (json-int) | |
dc7a09cf | 2894 | - "thread_id": ID of the underlying host thread (json-int) |
82a56f0d LC |
2895 | |
2896 | Example: | |
2897 | ||
2898 | -> { "execute": "query-cpus" } | |
2899 | <- { | |
2900 | "return":[ | |
2901 | { | |
2902 | "CPU":0, | |
2903 | "current":true, | |
2904 | "halted":false, | |
58f88d4b | 2905 | "qom_path":"/machine/unattached/device[0]", |
86f4b687 | 2906 | "arch":"x86", |
58f88d4b | 2907 | "pc":3227107138, |
dc7a09cf | 2908 | "thread_id":3134 |
82a56f0d LC |
2909 | }, |
2910 | { | |
2911 | "CPU":1, | |
2912 | "current":false, | |
2913 | "halted":true, | |
58f88d4b | 2914 | "qom_path":"/machine/unattached/device[2]", |
86f4b687 | 2915 | "arch":"x86", |
58f88d4b | 2916 | "pc":7108165, |
dc7a09cf | 2917 | "thread_id":3135 |
82a56f0d LC |
2918 | } |
2919 | ] | |
2920 | } | |
2921 | ||
2922 | EQMP | |
2923 | ||
de0b36b6 LC |
2924 | { |
2925 | .name = "query-cpus", | |
2926 | .args_type = "", | |
7fad30f0 | 2927 | .mhandler.cmd_new = qmp_marshal_query_cpus, |
de0b36b6 LC |
2928 | }, |
2929 | ||
dc3dd0d2 SH |
2930 | SQMP |
2931 | query-iothreads | |
2932 | --------------- | |
2933 | ||
2934 | Returns a list of information about each iothread. | |
2935 | ||
2936 | Note this list excludes the QEMU main loop thread, which is not declared | |
2937 | using the -object iothread command-line option. It is always the main thread | |
2938 | of the process. | |
2939 | ||
2940 | Return a json-array. Each iothread is represented by a json-object, which contains: | |
2941 | ||
2942 | - "id": name of iothread (json-str) | |
2943 | - "thread-id": ID of the underlying host thread (json-int) | |
2944 | ||
2945 | Example: | |
2946 | ||
2947 | -> { "execute": "query-iothreads" } | |
2948 | <- { | |
2949 | "return":[ | |
2950 | { | |
2951 | "id":"iothread0", | |
2952 | "thread-id":3134 | |
2953 | }, | |
2954 | { | |
2955 | "id":"iothread1", | |
2956 | "thread-id":3135 | |
2957 | } | |
2958 | ] | |
2959 | } | |
2960 | ||
2961 | EQMP | |
2962 | ||
2963 | { | |
2964 | .name = "query-iothreads", | |
2965 | .args_type = "", | |
7fad30f0 | 2966 | .mhandler.cmd_new = qmp_marshal_query_iothreads, |
dc3dd0d2 SH |
2967 | }, |
2968 | ||
82a56f0d LC |
2969 | SQMP |
2970 | query-pci | |
2971 | --------- | |
2972 | ||
2973 | PCI buses and devices information. | |
2974 | ||
2975 | The returned value is a json-array of all buses. Each bus is represented by | |
2976 | a json-object, which has a key with a json-array of all PCI devices attached | |
2977 | to it. Each device is represented by a json-object. | |
2978 | ||
2979 | The bus json-object contains the following: | |
2980 | ||
2981 | - "bus": bus number (json-int) | |
2982 | - "devices": a json-array of json-objects, each json-object represents a | |
2983 | PCI device | |
2984 | ||
2985 | The PCI device json-object contains the following: | |
2986 | ||
2987 | - "bus": identical to the parent's bus number (json-int) | |
2988 | - "slot": slot number (json-int) | |
2989 | - "function": function number (json-int) | |
2990 | - "class_info": a json-object containing: | |
2991 | - "desc": device class description (json-string, optional) | |
2992 | - "class": device class number (json-int) | |
2993 | - "id": a json-object containing: | |
2994 | - "device": device ID (json-int) | |
2995 | - "vendor": vendor ID (json-int) | |
2996 | - "irq": device's IRQ if assigned (json-int, optional) | |
2997 | - "qdev_id": qdev id string (json-string) | |
2998 | - "pci_bridge": It's a json-object, only present if this device is a | |
2999 | PCI bridge, contains: | |
3000 | - "bus": bus number (json-int) | |
3001 | - "secondary": secondary bus number (json-int) | |
3002 | - "subordinate": subordinate bus number (json-int) | |
3003 | - "io_range": I/O memory range information, a json-object with the | |
3004 | following members: | |
3005 | - "base": base address, in bytes (json-int) | |
3006 | - "limit": limit address, in bytes (json-int) | |
3007 | - "memory_range": memory range information, a json-object with the | |
3008 | following members: | |
3009 | - "base": base address, in bytes (json-int) | |
3010 | - "limit": limit address, in bytes (json-int) | |
3011 | - "prefetchable_range": Prefetchable memory range information, a | |
3012 | json-object with the following members: | |
3013 | - "base": base address, in bytes (json-int) | |
3014 | - "limit": limit address, in bytes (json-int) | |
3015 | - "devices": a json-array of PCI devices if there's any attached, each | |
3016 | each element is represented by a json-object, which contains | |
3017 | the same members of the 'PCI device json-object' described | |
3018 | above (optional) | |
3019 | - "regions": a json-array of json-objects, each json-object represents a | |
3020 | memory region of this device | |
3021 | ||
3022 | The memory range json-object contains the following: | |
3023 | ||
3024 | - "base": base memory address (json-int) | |
3025 | - "limit": limit value (json-int) | |
3026 | ||
3027 | The region json-object can be an I/O region or a memory region, an I/O region | |
3028 | json-object contains the following: | |
3029 | ||
3030 | - "type": "io" (json-string, fixed) | |
3031 | - "bar": BAR number (json-int) | |
3032 | - "address": memory address (json-int) | |
3033 | - "size": memory size (json-int) | |
3034 | ||
3035 | A memory region json-object contains the following: | |
3036 | ||
3037 | - "type": "memory" (json-string, fixed) | |
3038 | - "bar": BAR number (json-int) | |
3039 | - "address": memory address (json-int) | |
3040 | - "size": memory size (json-int) | |
3041 | - "mem_type_64": true or false (json-bool) | |
3042 | - "prefetch": true or false (json-bool) | |
3043 | ||
3044 | Example: | |
3045 | ||
3046 | -> { "execute": "query-pci" } | |
3047 | <- { | |
3048 | "return":[ | |
3049 | { | |
3050 | "bus":0, | |
3051 | "devices":[ | |
3052 | { | |
3053 | "bus":0, | |
3054 | "qdev_id":"", | |
3055 | "slot":0, | |
3056 | "class_info":{ | |
3057 | "class":1536, | |
3058 | "desc":"Host bridge" | |
3059 | }, | |
3060 | "id":{ | |
3061 | "device":32902, | |
3062 | "vendor":4663 | |
3063 | }, | |
3064 | "function":0, | |
3065 | "regions":[ | |
3066 | ||
3067 | ] | |
3068 | }, | |
3069 | { | |
3070 | "bus":0, | |
3071 | "qdev_id":"", | |
3072 | "slot":1, | |
3073 | "class_info":{ | |
3074 | "class":1537, | |
3075 | "desc":"ISA bridge" | |
3076 | }, | |
3077 | "id":{ | |
3078 | "device":32902, | |
3079 | "vendor":28672 | |
3080 | }, | |
3081 | "function":0, | |
3082 | "regions":[ | |
3083 | ||
3084 | ] | |
3085 | }, | |
3086 | { | |
3087 | "bus":0, | |
3088 | "qdev_id":"", | |
3089 | "slot":1, | |
3090 | "class_info":{ | |
3091 | "class":257, | |
3092 | "desc":"IDE controller" | |
3093 | }, | |
3094 | "id":{ | |
3095 | "device":32902, | |
3096 | "vendor":28688 | |
3097 | }, | |
3098 | "function":1, | |
3099 | "regions":[ | |
3100 | { | |
3101 | "bar":4, | |
3102 | "size":16, | |
3103 | "address":49152, | |
3104 | "type":"io" | |
3105 | } | |
3106 | ] | |
3107 | }, | |
3108 | { | |
3109 | "bus":0, | |
3110 | "qdev_id":"", | |
3111 | "slot":2, | |
3112 | "class_info":{ | |
3113 | "class":768, | |
3114 | "desc":"VGA controller" | |
3115 | }, | |
3116 | "id":{ | |
3117 | "device":4115, | |
3118 | "vendor":184 | |
3119 | }, | |
3120 | "function":0, | |
3121 | "regions":[ | |
3122 | { | |
3123 | "prefetch":true, | |
3124 | "mem_type_64":false, | |
3125 | "bar":0, | |
3126 | "size":33554432, | |
3127 | "address":4026531840, | |
3128 | "type":"memory" | |
3129 | }, | |
3130 | { | |
3131 | "prefetch":false, | |
3132 | "mem_type_64":false, | |
3133 | "bar":1, | |
3134 | "size":4096, | |
3135 | "address":4060086272, | |
3136 | "type":"memory" | |
3137 | }, | |
3138 | { | |
3139 | "prefetch":false, | |
3140 | "mem_type_64":false, | |
3141 | "bar":6, | |
3142 | "size":65536, | |
3143 | "address":-1, | |
3144 | "type":"memory" | |
3145 | } | |
3146 | ] | |
3147 | }, | |
3148 | { | |
3149 | "bus":0, | |
3150 | "qdev_id":"", | |
3151 | "irq":11, | |
3152 | "slot":4, | |
3153 | "class_info":{ | |
3154 | "class":1280, | |
3155 | "desc":"RAM controller" | |
3156 | }, | |
3157 | "id":{ | |
3158 | "device":6900, | |
3159 | "vendor":4098 | |
3160 | }, | |
3161 | "function":0, | |
3162 | "regions":[ | |
3163 | { | |
3164 | "bar":0, | |
3165 | "size":32, | |
3166 | "address":49280, | |
3167 | "type":"io" | |
3168 | } | |
3169 | ] | |
3170 | } | |
3171 | ] | |
3172 | } | |
3173 | ] | |
3174 | } | |
3175 | ||
3176 | Note: This example has been shortened as the real response is too long. | |
3177 | ||
3178 | EQMP | |
3179 | ||
79627472 LC |
3180 | { |
3181 | .name = "query-pci", | |
3182 | .args_type = "", | |
7fad30f0 | 3183 | .mhandler.cmd_new = qmp_marshal_query_pci, |
79627472 LC |
3184 | }, |
3185 | ||
82a56f0d LC |
3186 | SQMP |
3187 | query-kvm | |
3188 | --------- | |
3189 | ||
3190 | Show KVM information. | |
3191 | ||
3192 | Return a json-object with the following information: | |
3193 | ||
3194 | - "enabled": true if KVM support is enabled, false otherwise (json-bool) | |
3195 | - "present": true if QEMU has KVM support, false otherwise (json-bool) | |
3196 | ||
3197 | Example: | |
3198 | ||
3199 | -> { "execute": "query-kvm" } | |
3200 | <- { "return": { "enabled": true, "present": true } } | |
3201 | ||
3202 | EQMP | |
3203 | ||
292a2602 LC |
3204 | { |
3205 | .name = "query-kvm", | |
3206 | .args_type = "", | |
7fad30f0 | 3207 | .mhandler.cmd_new = qmp_marshal_query_kvm, |
292a2602 LC |
3208 | }, |
3209 | ||
82a56f0d LC |
3210 | SQMP |
3211 | query-status | |
3212 | ------------ | |
3213 | ||
3214 | Return a json-object with the following information: | |
3215 | ||
3216 | - "running": true if the VM is running, or false if it is paused (json-bool) | |
3217 | - "singlestep": true if the VM is in single step mode, | |
3218 | false otherwise (json-bool) | |
9e37b9dc LC |
3219 | - "status": one of the following values (json-string) |
3220 | "debug" - QEMU is running on a debugger | |
3221 | "inmigrate" - guest is paused waiting for an incoming migration | |
3222 | "internal-error" - An internal error that prevents further guest | |
3223 | execution has occurred | |
3224 | "io-error" - the last IOP has failed and the device is configured | |
3225 | to pause on I/O errors | |
3226 | "paused" - guest has been paused via the 'stop' command | |
3227 | "postmigrate" - guest is paused following a successful 'migrate' | |
3228 | "prelaunch" - QEMU was started with -S and guest has not started | |
3229 | "finish-migrate" - guest is paused to finish the migration process | |
3230 | "restore-vm" - guest is paused to restore VM state | |
3231 | "running" - guest is actively running | |
3232 | "save-vm" - guest is paused to save the VM state | |
3233 | "shutdown" - guest is shut down (and -no-shutdown is in use) | |
3234 | "watchdog" - the watchdog action is configured to pause and | |
3235 | has been triggered | |
82a56f0d LC |
3236 | |
3237 | Example: | |
3238 | ||
3239 | -> { "execute": "query-status" } | |
9e37b9dc | 3240 | <- { "return": { "running": true, "singlestep": false, "status": "running" } } |
82a56f0d LC |
3241 | |
3242 | EQMP | |
1fa9a5e4 LC |
3243 | |
3244 | { | |
3245 | .name = "query-status", | |
3246 | .args_type = "", | |
7fad30f0 | 3247 | .mhandler.cmd_new = qmp_marshal_query_status, |
1fa9a5e4 | 3248 | }, |
82a56f0d LC |
3249 | |
3250 | SQMP | |
3251 | query-mice | |
3252 | ---------- | |
3253 | ||
3254 | Show VM mice information. | |
3255 | ||
3256 | Each mouse is represented by a json-object, the returned value is a json-array | |
3257 | of all mice. | |
3258 | ||
3259 | The mouse json-object contains the following: | |
3260 | ||
3261 | - "name": mouse's name (json-string) | |
3262 | - "index": mouse's index (json-int) | |
3263 | - "current": true if this mouse is receiving events, false otherwise (json-bool) | |
3264 | - "absolute": true if the mouse generates absolute input events (json-bool) | |
3265 | ||
3266 | Example: | |
3267 | ||
3268 | -> { "execute": "query-mice" } | |
3269 | <- { | |
3270 | "return":[ | |
3271 | { | |
3272 | "name":"QEMU Microsoft Mouse", | |
3273 | "index":0, | |
3274 | "current":false, | |
3275 | "absolute":false | |
3276 | }, | |
3277 | { | |
3278 | "name":"QEMU PS/2 Mouse", | |
3279 | "index":1, | |
3280 | "current":true, | |
3281 | "absolute":true | |
3282 | } | |
3283 | ] | |
3284 | } | |
3285 | ||
3286 | EQMP | |
3287 | ||
e235cec3 LC |
3288 | { |
3289 | .name = "query-mice", | |
3290 | .args_type = "", | |
7fad30f0 | 3291 | .mhandler.cmd_new = qmp_marshal_query_mice, |
e235cec3 LC |
3292 | }, |
3293 | ||
82a56f0d LC |
3294 | SQMP |
3295 | query-vnc | |
3296 | --------- | |
3297 | ||
3298 | Show VNC server information. | |
3299 | ||
3300 | Return a json-object with server information. Connected clients are returned | |
3301 | as a json-array of json-objects. | |
3302 | ||
3303 | The main json-object contains the following: | |
3304 | ||
3305 | - "enabled": true or false (json-bool) | |
3306 | - "host": server's IP address (json-string) | |
3307 | - "family": address family (json-string) | |
3308 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
3309 | - "service": server's port number (json-string) | |
3310 | - "auth": authentication method (json-string) | |
3311 | - Possible values: "invalid", "none", "ra2", "ra2ne", "sasl", "tight", | |
3312 | "tls", "ultra", "unknown", "vencrypt", "vencrypt", | |
3313 | "vencrypt+plain", "vencrypt+tls+none", | |
3314 | "vencrypt+tls+plain", "vencrypt+tls+sasl", | |
3315 | "vencrypt+tls+vnc", "vencrypt+x509+none", | |
3316 | "vencrypt+x509+plain", "vencrypt+x509+sasl", | |
3317 | "vencrypt+x509+vnc", "vnc" | |
3318 | - "clients": a json-array of all connected clients | |
3319 | ||
3320 | Clients are described by a json-object, each one contain the following: | |
3321 | ||
3322 | - "host": client's IP address (json-string) | |
3323 | - "family": address family (json-string) | |
3324 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
3325 | - "service": client's port number (json-string) | |
3326 | - "x509_dname": TLS dname (json-string, optional) | |
3327 | - "sasl_username": SASL username (json-string, optional) | |
3328 | ||
3329 | Example: | |
3330 | ||
3331 | -> { "execute": "query-vnc" } | |
3332 | <- { | |
3333 | "return":{ | |
3334 | "enabled":true, | |
3335 | "host":"0.0.0.0", | |
3336 | "service":"50402", | |
3337 | "auth":"vnc", | |
3338 | "family":"ipv4", | |
3339 | "clients":[ | |
3340 | { | |
3341 | "host":"127.0.0.1", | |
3342 | "service":"50401", | |
3343 | "family":"ipv4" | |
3344 | } | |
3345 | ] | |
3346 | } | |
3347 | } | |
3348 | ||
3349 | EQMP | |
3350 | ||
2b54aa87 LC |
3351 | { |
3352 | .name = "query-vnc", | |
3353 | .args_type = "", | |
7fad30f0 | 3354 | .mhandler.cmd_new = qmp_marshal_query_vnc, |
2b54aa87 | 3355 | }, |
df887684 GH |
3356 | { |
3357 | .name = "query-vnc-servers", | |
3358 | .args_type = "", | |
7fad30f0 | 3359 | .mhandler.cmd_new = qmp_marshal_query_vnc_servers, |
df887684 | 3360 | }, |
2b54aa87 | 3361 | |
cb42a870 GH |
3362 | SQMP |
3363 | query-spice | |
3364 | ----------- | |
3365 | ||
3366 | Show SPICE server information. | |
3367 | ||
3368 | Return a json-object with server information. Connected clients are returned | |
3369 | as a json-array of json-objects. | |
3370 | ||
3371 | The main json-object contains the following: | |
3372 | ||
3373 | - "enabled": true or false (json-bool) | |
3374 | - "host": server's IP address (json-string) | |
3375 | - "port": server's port number (json-int, optional) | |
3376 | - "tls-port": server's port number (json-int, optional) | |
3377 | - "auth": authentication method (json-string) | |
3378 | - Possible values: "none", "spice" | |
3379 | - "channels": a json-array of all active channels clients | |
3380 | ||
3381 | Channels are described by a json-object, each one contain the following: | |
3382 | ||
3383 | - "host": client's IP address (json-string) | |
3384 | - "family": address family (json-string) | |
3385 | - Possible values: "ipv4", "ipv6", "unix", "unknown" | |
3386 | - "port": client's port number (json-string) | |
3387 | - "connection-id": spice connection id. All channels with the same id | |
3388 | belong to the same spice session (json-int) | |
3389 | - "channel-type": channel type. "1" is the main control channel, filter for | |
3390 | this one if you want track spice sessions only (json-int) | |
3391 | - "channel-id": channel id. Usually "0", might be different needed when | |
3392 | multiple channels of the same type exist, such as multiple | |
3393 | display channels in a multihead setup (json-int) | |
3599d46b | 3394 | - "tls": whether the channel is encrypted (json-bool) |
cb42a870 GH |
3395 | |
3396 | Example: | |
3397 | ||
3398 | -> { "execute": "query-spice" } | |
3399 | <- { | |
3400 | "return": { | |
3401 | "enabled": true, | |
3402 | "auth": "spice", | |
3403 | "port": 5920, | |
3404 | "tls-port": 5921, | |
3405 | "host": "0.0.0.0", | |
3406 | "channels": [ | |
3407 | { | |
3408 | "port": "54924", | |
3409 | "family": "ipv4", | |
3410 | "channel-type": 1, | |
3411 | "connection-id": 1804289383, | |
3412 | "host": "127.0.0.1", | |
3413 | "channel-id": 0, | |
3414 | "tls": true | |
3415 | }, | |
3416 | { | |
3417 | "port": "36710", | |
3418 | "family": "ipv4", | |
3419 | "channel-type": 4, | |
3420 | "connection-id": 1804289383, | |
3421 | "host": "127.0.0.1", | |
3422 | "channel-id": 0, | |
3423 | "tls": false | |
3424 | }, | |
3425 | [ ... more channels follow ... ] | |
3426 | ] | |
3427 | } | |
3428 | } | |
3429 | ||
3430 | EQMP | |
3431 | ||
d1f29646 LC |
3432 | #if defined(CONFIG_SPICE) |
3433 | { | |
3434 | .name = "query-spice", | |
3435 | .args_type = "", | |
7fad30f0 | 3436 | .mhandler.cmd_new = qmp_marshal_query_spice, |
d1f29646 LC |
3437 | }, |
3438 | #endif | |
3439 | ||
82a56f0d LC |
3440 | SQMP |
3441 | query-name | |
3442 | ---------- | |
3443 | ||
3444 | Show VM name. | |
3445 | ||
3446 | Return a json-object with the following information: | |
3447 | ||
3448 | - "name": VM's name (json-string, optional) | |
3449 | ||
3450 | Example: | |
3451 | ||
3452 | -> { "execute": "query-name" } | |
3453 | <- { "return": { "name": "qemu-name" } } | |
3454 | ||
3455 | EQMP | |
3456 | ||
48a32bed AL |
3457 | { |
3458 | .name = "query-name", | |
3459 | .args_type = "", | |
7fad30f0 | 3460 | .mhandler.cmd_new = qmp_marshal_query_name, |
48a32bed AL |
3461 | }, |
3462 | ||
82a56f0d LC |
3463 | SQMP |
3464 | query-uuid | |
3465 | ---------- | |
3466 | ||
3467 | Show VM UUID. | |
3468 | ||
3469 | Return a json-object with the following information: | |
3470 | ||
3471 | - "UUID": Universally Unique Identifier (json-string) | |
3472 | ||
3473 | Example: | |
3474 | ||
3475 | -> { "execute": "query-uuid" } | |
3476 | <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } } | |
3477 | ||
3478 | EQMP | |
3479 | ||
efab767e LC |
3480 | { |
3481 | .name = "query-uuid", | |
3482 | .args_type = "", | |
7fad30f0 | 3483 | .mhandler.cmd_new = qmp_marshal_query_uuid, |
efab767e LC |
3484 | }, |
3485 | ||
1f8f987d AK |
3486 | SQMP |
3487 | query-command-line-options | |
3488 | -------------------------- | |
3489 | ||
3490 | Show command line option schema. | |
3491 | ||
3492 | Return a json-array of command line option schema for all options (or for | |
3493 | the given option), returning an error if the given option doesn't exist. | |
3494 | ||
3495 | Each array entry contains the following: | |
3496 | ||
3497 | - "option": option name (json-string) | |
3498 | - "parameters": a json-array describes all parameters of the option: | |
3499 | - "name": parameter name (json-string) | |
3500 | - "type": parameter type (one of 'string', 'boolean', 'number', | |
3501 | or 'size') | |
3502 | - "help": human readable description of the parameter | |
3503 | (json-string, optional) | |
e36af94f CL |
3504 | - "default": default value string for the parameter |
3505 | (json-string, optional) | |
1f8f987d AK |
3506 | |
3507 | Example: | |
3508 | ||
3509 | -> { "execute": "query-command-line-options", "arguments": { "option": "option-rom" } } | |
3510 | <- { "return": [ | |
3511 | { | |
3512 | "parameters": [ | |
3513 | { | |
3514 | "name": "romfile", | |
3515 | "type": "string" | |
3516 | }, | |
3517 | { | |
3518 | "name": "bootindex", | |
3519 | "type": "number" | |
3520 | } | |
3521 | ], | |
3522 | "option": "option-rom" | |
3523 | } | |
3524 | ] | |
3525 | } | |
3526 | ||
3527 | EQMP | |
3528 | ||
3529 | { | |
3530 | .name = "query-command-line-options", | |
3531 | .args_type = "option:s?", | |
7fad30f0 | 3532 | .mhandler.cmd_new = qmp_marshal_query_command_line_options, |
1f8f987d AK |
3533 | }, |
3534 | ||
82a56f0d LC |
3535 | SQMP |
3536 | query-migrate | |
3537 | ------------- | |
3538 | ||
3539 | Migration status. | |
3540 | ||
3541 | Return a json-object. If migration is active there will be another json-object | |
3542 | with RAM migration status and if block migration is active another one with | |
3543 | block migration status. | |
3544 | ||
3545 | The main json-object contains the following: | |
3546 | ||
3547 | - "status": migration status (json-string) | |
3b695950 | 3548 | - Possible values: "setup", "active", "completed", "failed", "cancelled" |
7aa939af JQ |
3549 | - "total-time": total amount of ms since migration started. If |
3550 | migration has ended, it returns the total migration | |
817c6045 | 3551 | time (json-int) |
8f3067bd MH |
3552 | - "setup-time" amount of setup time in milliseconds _before_ the |
3553 | iterations begin but _after_ the QMP command is issued. | |
3554 | This is designed to provide an accounting of any activities | |
3555 | (such as RDMA pinning) which may be expensive, but do not | |
3556 | actually occur during the iterative migration rounds | |
3557 | themselves. (json-int) | |
9c5a9fcf JQ |
3558 | - "downtime": only present when migration has finished correctly |
3559 | total amount in ms for downtime that happened (json-int) | |
2c52ddf1 JQ |
3560 | - "expected-downtime": only present while migration is active |
3561 | total amount in ms for downtime that was calculated on | |
817c6045 | 3562 | the last bitmap round (json-int) |
82a56f0d | 3563 | - "ram": only present if "status" is "active", it is a json-object with the |
817c6045 JQ |
3564 | following RAM information: |
3565 | - "transferred": amount transferred in bytes (json-int) | |
3566 | - "remaining": amount remaining to transfer in bytes (json-int) | |
3567 | - "total": total amount of memory in bytes (json-int) | |
3568 | - "duplicate": number of pages filled entirely with the same | |
3569 | byte (json-int) | |
3570 | These are sent over the wire much more efficiently. | |
f1c72795 | 3571 | - "skipped": number of skipped zero pages (json-int) |
805a2505 | 3572 | - "normal" : number of whole pages transferred. I.e. they |
817c6045 JQ |
3573 | were not sent as duplicate or xbzrle pages (json-int) |
3574 | - "normal-bytes" : number of bytes transferred in whole | |
3575 | pages. This is just normal pages times size of one page, | |
3576 | but this way upper levels don't need to care about page | |
3577 | size (json-int) | |
58570ed8 | 3578 | - "dirty-sync-count": times that dirty ram was synchronized (json-int) |
82a56f0d | 3579 | - "disk": only present if "status" is "active" and it is a block migration, |
817c6045 JQ |
3580 | it is a json-object with the following disk information: |
3581 | - "transferred": amount transferred in bytes (json-int) | |
3582 | - "remaining": amount remaining to transfer in bytes json-int) | |
3583 | - "total": total disk size in bytes (json-int) | |
f36d55af OW |
3584 | - "xbzrle-cache": only present if XBZRLE is active. |
3585 | It is a json-object with the following XBZRLE information: | |
817c6045 JQ |
3586 | - "cache-size": XBZRLE cache size in bytes |
3587 | - "bytes": number of bytes transferred for XBZRLE compressed pages | |
f36d55af | 3588 | - "pages": number of XBZRLE compressed pages |
817c6045 | 3589 | - "cache-miss": number of XBRZRLE page cache misses |
8bc39233 | 3590 | - "cache-miss-rate": rate of XBRZRLE page cache misses |
817c6045 JQ |
3591 | - "overflow": number of times XBZRLE overflows. This means |
3592 | that the XBZRLE encoding was bigger than just sent the | |
3593 | whole page, and then we sent the whole page instead (as as | |
3594 | normal page). | |
3595 | ||
82a56f0d LC |
3596 | Examples: |
3597 | ||
3598 | 1. Before the first migration | |
3599 | ||
3600 | -> { "execute": "query-migrate" } | |
3601 | <- { "return": {} } | |
3602 | ||
3603 | 2. Migration is done and has succeeded | |
3604 | ||
3605 | -> { "execute": "query-migrate" } | |
004d4c10 OW |
3606 | <- { "return": { |
3607 | "status": "completed", | |
3608 | "ram":{ | |
3609 | "transferred":123, | |
3610 | "remaining":123, | |
3611 | "total":246, | |
3612 | "total-time":12345, | |
8f3067bd | 3613 | "setup-time":12345, |
9c5a9fcf | 3614 | "downtime":12345, |
004d4c10 OW |
3615 | "duplicate":123, |
3616 | "normal":123, | |
58570ed8 C |
3617 | "normal-bytes":123456, |
3618 | "dirty-sync-count":15 | |
004d4c10 OW |
3619 | } |
3620 | } | |
3621 | } | |
82a56f0d LC |
3622 | |
3623 | 3. Migration is done and has failed | |
3624 | ||
3625 | -> { "execute": "query-migrate" } | |
3626 | <- { "return": { "status": "failed" } } | |
3627 | ||
3628 | 4. Migration is being performed and is not a block migration: | |
3629 | ||
3630 | -> { "execute": "query-migrate" } | |
3631 | <- { | |
3632 | "return":{ | |
3633 | "status":"active", | |
3634 | "ram":{ | |
3635 | "transferred":123, | |
3636 | "remaining":123, | |
62d4e3fe | 3637 | "total":246, |
004d4c10 | 3638 | "total-time":12345, |
8f3067bd | 3639 | "setup-time":12345, |
2c52ddf1 | 3640 | "expected-downtime":12345, |
004d4c10 OW |
3641 | "duplicate":123, |
3642 | "normal":123, | |
58570ed8 C |
3643 | "normal-bytes":123456, |
3644 | "dirty-sync-count":15 | |
82a56f0d LC |
3645 | } |
3646 | } | |
3647 | } | |
3648 | ||
3649 | 5. Migration is being performed and is a block migration: | |
3650 | ||
3651 | -> { "execute": "query-migrate" } | |
3652 | <- { | |
3653 | "return":{ | |
3654 | "status":"active", | |
3655 | "ram":{ | |
3656 | "total":1057024, | |
3657 | "remaining":1053304, | |
62d4e3fe | 3658 | "transferred":3720, |
004d4c10 | 3659 | "total-time":12345, |
8f3067bd | 3660 | "setup-time":12345, |
2c52ddf1 | 3661 | "expected-downtime":12345, |
004d4c10 OW |
3662 | "duplicate":123, |
3663 | "normal":123, | |
58570ed8 C |
3664 | "normal-bytes":123456, |
3665 | "dirty-sync-count":15 | |
82a56f0d LC |
3666 | }, |
3667 | "disk":{ | |
3668 | "total":20971520, | |
3669 | "remaining":20880384, | |
3670 | "transferred":91136 | |
3671 | } | |
3672 | } | |
3673 | } | |
3674 | ||
f36d55af OW |
3675 | 6. Migration is being performed and XBZRLE is active: |
3676 | ||
3677 | -> { "execute": "query-migrate" } | |
3678 | <- { | |
3679 | "return":{ | |
3680 | "status":"active", | |
3681 | "capabilities" : [ { "capability": "xbzrle", "state" : true } ], | |
3682 | "ram":{ | |
3683 | "total":1057024, | |
3684 | "remaining":1053304, | |
3685 | "transferred":3720, | |
3686 | "total-time":12345, | |
8f3067bd | 3687 | "setup-time":12345, |
2c52ddf1 | 3688 | "expected-downtime":12345, |
f36d55af OW |
3689 | "duplicate":10, |
3690 | "normal":3333, | |
58570ed8 C |
3691 | "normal-bytes":3412992, |
3692 | "dirty-sync-count":15 | |
f36d55af OW |
3693 | }, |
3694 | "xbzrle-cache":{ | |
3695 | "cache-size":67108864, | |
3696 | "bytes":20971520, | |
3697 | "pages":2444343, | |
3698 | "cache-miss":2244, | |
8bc39233 | 3699 | "cache-miss-rate":0.123, |
f36d55af OW |
3700 | "overflow":34434 |
3701 | } | |
3702 | } | |
3703 | } | |
3704 | ||
82a56f0d LC |
3705 | EQMP |
3706 | ||
791e7c82 LC |
3707 | { |
3708 | .name = "query-migrate", | |
3709 | .args_type = "", | |
7fad30f0 | 3710 | .mhandler.cmd_new = qmp_marshal_query_migrate, |
791e7c82 LC |
3711 | }, |
3712 | ||
bbf6da32 | 3713 | SQMP |
00458433 | 3714 | migrate-set-capabilities |
817c6045 | 3715 | ------------------------ |
00458433 OW |
3716 | |
3717 | Enable/Disable migration capabilities | |
3718 | ||
817c6045 | 3719 | - "xbzrle": XBZRLE support |
d6d69731 HZ |
3720 | - "rdma-pin-all": pin all pages when using RDMA during migration |
3721 | - "auto-converge": throttle down guest to help convergence of migration | |
3722 | - "zero-blocks": compress zero blocks during block migration | |
164f59e8 | 3723 | - "compress": use multiple compression threads to accelerate live migration |
72e72e1a | 3724 | - "events": generate events for each migration state change |
32c3db5b | 3725 | - "postcopy-ram": postcopy mode for live migration |
00458433 OW |
3726 | |
3727 | Arguments: | |
3728 | ||
3729 | Example: | |
3730 | ||
3731 | -> { "execute": "migrate-set-capabilities" , "arguments": | |
3732 | { "capabilities": [ { "capability": "xbzrle", "state": true } ] } } | |
3733 | ||
3734 | EQMP | |
3735 | ||
3736 | { | |
3737 | .name = "migrate-set-capabilities", | |
43d0a2c1 | 3738 | .args_type = "capabilities:q", |
00458433 | 3739 | .params = "capability:s,state:b", |
7fad30f0 | 3740 | .mhandler.cmd_new = qmp_marshal_migrate_set_capabilities, |
00458433 OW |
3741 | }, |
3742 | SQMP | |
bbf6da32 | 3743 | query-migrate-capabilities |
817c6045 | 3744 | -------------------------- |
bbf6da32 OW |
3745 | |
3746 | Query current migration capabilities | |
3747 | ||
3748 | - "capabilities": migration capabilities state | |
3749 | - "xbzrle" : XBZRLE state (json-bool) | |
d6d69731 HZ |
3750 | - "rdma-pin-all" : RDMA Pin Page state (json-bool) |
3751 | - "auto-converge" : Auto Converge state (json-bool) | |
3752 | - "zero-blocks" : Zero Blocks state (json-bool) | |
164f59e8 HZ |
3753 | - "compress": Multiple compression threads state (json-bool) |
3754 | - "events": Migration state change event state (json-bool) | |
32c3db5b | 3755 | - "postcopy-ram": postcopy ram state (json-bool) |
bbf6da32 OW |
3756 | |
3757 | Arguments: | |
3758 | ||
3759 | Example: | |
3760 | ||
3761 | -> { "execute": "query-migrate-capabilities" } | |
164f59e8 HZ |
3762 | <- {"return": [ |
3763 | {"state": false, "capability": "xbzrle"}, | |
3764 | {"state": false, "capability": "rdma-pin-all"}, | |
3765 | {"state": false, "capability": "auto-converge"}, | |
3766 | {"state": false, "capability": "zero-blocks"}, | |
3767 | {"state": false, "capability": "compress"}, | |
3768 | {"state": true, "capability": "events"}, | |
32c3db5b | 3769 | {"state": false, "capability": "postcopy-ram"} |
164f59e8 | 3770 | ]} |
dbca1b37 | 3771 | |
bbf6da32 OW |
3772 | EQMP |
3773 | ||
3774 | { | |
3775 | .name = "query-migrate-capabilities", | |
3776 | .args_type = "", | |
7fad30f0 | 3777 | .mhandler.cmd_new = qmp_marshal_query_migrate_capabilities, |
bbf6da32 OW |
3778 | }, |
3779 | ||
85de8323 LL |
3780 | SQMP |
3781 | migrate-set-parameters | |
3782 | ---------------------- | |
3783 | ||
3784 | Set migration parameters | |
3785 | ||
3786 | - "compress-level": set compression level during migration (json-int) | |
3787 | - "compress-threads": set compression thread count for migration (json-int) | |
3788 | - "decompress-threads": set decompression thread count for migration (json-int) | |
d85a31d1 JH |
3789 | - "cpu-throttle-initial": set initial percentage of time guest cpus are |
3790 | throttled for auto-converge (json-int) | |
3791 | - "cpu-throttle-increment": set throttle increasing percentage for | |
3792 | auto-converge (json-int) | |
85de8323 LL |
3793 | |
3794 | Arguments: | |
3795 | ||
3796 | Example: | |
3797 | ||
3798 | -> { "execute": "migrate-set-parameters" , "arguments": | |
3799 | { "compress-level": 1 } } | |
3800 | ||
3801 | EQMP | |
3802 | ||
3803 | { | |
3804 | .name = "migrate-set-parameters", | |
3805 | .args_type = | |
d85a31d1 | 3806 | "compress-level:i?,compress-threads:i?,decompress-threads:i?,cpu-throttle-initial:i?,cpu-throttle-increment:i?", |
7fad30f0 | 3807 | .mhandler.cmd_new = qmp_marshal_migrate_set_parameters, |
85de8323 LL |
3808 | }, |
3809 | SQMP | |
3810 | query-migrate-parameters | |
3811 | ------------------------ | |
3812 | ||
3813 | Query current migration parameters | |
3814 | ||
3815 | - "parameters": migration parameters value | |
3816 | - "compress-level" : compression level value (json-int) | |
3817 | - "compress-threads" : compression thread count value (json-int) | |
3818 | - "decompress-threads" : decompression thread count value (json-int) | |
d85a31d1 JH |
3819 | - "cpu-throttle-initial" : initial percentage of time guest cpus are |
3820 | throttled (json-int) | |
3821 | - "cpu-throttle-increment" : throttle increasing percentage for | |
3822 | auto-converge (json-int) | |
85de8323 LL |
3823 | |
3824 | Arguments: | |
3825 | ||
3826 | Example: | |
3827 | ||
3828 | -> { "execute": "query-migrate-parameters" } | |
3829 | <- { | |
3830 | "return": { | |
9c994a97 | 3831 | "decompress-threads": 2, |
d85a31d1 | 3832 | "cpu-throttle-increment": 10, |
9c994a97 HZ |
3833 | "compress-threads": 8, |
3834 | "compress-level": 1, | |
d85a31d1 | 3835 | "cpu-throttle-initial": 20 |
85de8323 LL |
3836 | } |
3837 | } | |
3838 | ||
3839 | EQMP | |
3840 | ||
3841 | { | |
3842 | .name = "query-migrate-parameters", | |
3843 | .args_type = "", | |
7fad30f0 | 3844 | .mhandler.cmd_new = qmp_marshal_query_migrate_parameters, |
85de8323 LL |
3845 | }, |
3846 | ||
82a56f0d LC |
3847 | SQMP |
3848 | query-balloon | |
3849 | ------------- | |
3850 | ||
3851 | Show balloon information. | |
3852 | ||
3853 | Make an asynchronous request for balloon info. When the request completes a | |
3854 | json-object will be returned containing the following data: | |
3855 | ||
3856 | - "actual": current balloon value in bytes (json-int) | |
82a56f0d LC |
3857 | |
3858 | Example: | |
3859 | ||
3860 | -> { "execute": "query-balloon" } | |
3861 | <- { | |
3862 | "return":{ | |
3863 | "actual":1073741824, | |
82a56f0d LC |
3864 | } |
3865 | } | |
3866 | ||
3867 | EQMP | |
3868 | ||
96637bcd LC |
3869 | { |
3870 | .name = "query-balloon", | |
3871 | .args_type = "", | |
7fad30f0 | 3872 | .mhandler.cmd_new = qmp_marshal_query_balloon, |
96637bcd | 3873 | }, |
b4b12c62 | 3874 | |
fb5458cd SH |
3875 | { |
3876 | .name = "query-block-jobs", | |
3877 | .args_type = "", | |
7fad30f0 | 3878 | .mhandler.cmd_new = qmp_marshal_query_block_jobs, |
fb5458cd SH |
3879 | }, |
3880 | ||
b4b12c62 AL |
3881 | { |
3882 | .name = "qom-list", | |
3883 | .args_type = "path:s", | |
7fad30f0 | 3884 | .mhandler.cmd_new = qmp_marshal_qom_list, |
b4b12c62 | 3885 | }, |
eb6e8ea5 AL |
3886 | |
3887 | { | |
3888 | .name = "qom-set", | |
b9f8978c | 3889 | .args_type = "path:s,property:s,value:q", |
6eb3937e | 3890 | .mhandler.cmd_new = qmp_marshal_qom_set, |
eb6e8ea5 AL |
3891 | }, |
3892 | ||
3893 | { | |
3894 | .name = "qom-get", | |
3895 | .args_type = "path:s,property:s", | |
6eb3937e | 3896 | .mhandler.cmd_new = qmp_marshal_qom_get, |
eb6e8ea5 | 3897 | }, |
270b243f | 3898 | |
6dd844db PB |
3899 | { |
3900 | .name = "nbd-server-start", | |
ddffee39 | 3901 | .args_type = "addr:q,tls-creds:s?", |
7fad30f0 | 3902 | .mhandler.cmd_new = qmp_marshal_nbd_server_start, |
6dd844db PB |
3903 | }, |
3904 | { | |
3905 | .name = "nbd-server-add", | |
3906 | .args_type = "device:B,writable:b?", | |
7fad30f0 | 3907 | .mhandler.cmd_new = qmp_marshal_nbd_server_add, |
6dd844db PB |
3908 | }, |
3909 | { | |
3910 | .name = "nbd-server-stop", | |
3911 | .args_type = "", | |
7fad30f0 | 3912 | .mhandler.cmd_new = qmp_marshal_nbd_server_stop, |
6dd844db PB |
3913 | }, |
3914 | ||
270b243f LC |
3915 | { |
3916 | .name = "change-vnc-password", | |
3917 | .args_type = "password:s", | |
7fad30f0 | 3918 | .mhandler.cmd_new = qmp_marshal_change_vnc_password, |
270b243f | 3919 | }, |
5eeee3fa AL |
3920 | { |
3921 | .name = "qom-list-types", | |
3922 | .args_type = "implements:s?,abstract:b?", | |
7fad30f0 | 3923 | .mhandler.cmd_new = qmp_marshal_qom_list_types, |
5eeee3fa | 3924 | }, |
1daa31b9 AL |
3925 | |
3926 | { | |
3927 | .name = "device-list-properties", | |
3928 | .args_type = "typename:s", | |
7fad30f0 | 3929 | .mhandler.cmd_new = qmp_marshal_device_list_properties, |
1daa31b9 AL |
3930 | }, |
3931 | ||
01d3c80d AL |
3932 | { |
3933 | .name = "query-machines", | |
3934 | .args_type = "", | |
7fad30f0 | 3935 | .mhandler.cmd_new = qmp_marshal_query_machines, |
01d3c80d AL |
3936 | }, |
3937 | ||
e4e31c63 AL |
3938 | { |
3939 | .name = "query-cpu-definitions", | |
3940 | .args_type = "", | |
7fad30f0 | 3941 | .mhandler.cmd_new = qmp_marshal_query_cpu_definitions, |
e4e31c63 AL |
3942 | }, |
3943 | ||
99afc91d DB |
3944 | { |
3945 | .name = "query-target", | |
3946 | .args_type = "", | |
7fad30f0 | 3947 | .mhandler.cmd_new = qmp_marshal_query_target, |
99afc91d | 3948 | }, |
f1a1a356 | 3949 | |
d1a0cf73 SB |
3950 | { |
3951 | .name = "query-tpm", | |
3952 | .args_type = "", | |
7fad30f0 | 3953 | .mhandler.cmd_new = qmp_marshal_query_tpm, |
d1a0cf73 SB |
3954 | }, |
3955 | ||
28c4fa32 CB |
3956 | SQMP |
3957 | query-tpm | |
3958 | --------- | |
3959 | ||
3960 | Return information about the TPM device. | |
3961 | ||
3962 | Arguments: None | |
3963 | ||
3964 | Example: | |
3965 | ||
3966 | -> { "execute": "query-tpm" } | |
3967 | <- { "return": | |
3968 | [ | |
3969 | { "model": "tpm-tis", | |
3970 | "options": | |
3971 | { "type": "passthrough", | |
3972 | "data": | |
3973 | { "cancel-path": "/sys/class/misc/tpm0/device/cancel", | |
3974 | "path": "/dev/tpm0" | |
3975 | } | |
3976 | }, | |
3977 | "id": "tpm0" | |
3978 | } | |
3979 | ] | |
3980 | } | |
3981 | ||
3982 | EQMP | |
3983 | ||
d1a0cf73 SB |
3984 | { |
3985 | .name = "query-tpm-models", | |
3986 | .args_type = "", | |
7fad30f0 | 3987 | .mhandler.cmd_new = qmp_marshal_query_tpm_models, |
d1a0cf73 SB |
3988 | }, |
3989 | ||
28c4fa32 CB |
3990 | SQMP |
3991 | query-tpm-models | |
3992 | ---------------- | |
3993 | ||
3994 | Return a list of supported TPM models. | |
3995 | ||
3996 | Arguments: None | |
3997 | ||
3998 | Example: | |
3999 | ||
4000 | -> { "execute": "query-tpm-models" } | |
4001 | <- { "return": [ "tpm-tis" ] } | |
4002 | ||
4003 | EQMP | |
4004 | ||
d1a0cf73 SB |
4005 | { |
4006 | .name = "query-tpm-types", | |
4007 | .args_type = "", | |
7fad30f0 | 4008 | .mhandler.cmd_new = qmp_marshal_query_tpm_types, |
d1a0cf73 SB |
4009 | }, |
4010 | ||
28c4fa32 CB |
4011 | SQMP |
4012 | query-tpm-types | |
4013 | --------------- | |
4014 | ||
4015 | Return a list of supported TPM types. | |
4016 | ||
4017 | Arguments: None | |
4018 | ||
4019 | Example: | |
4020 | ||
4021 | -> { "execute": "query-tpm-types" } | |
4022 | <- { "return": [ "passthrough" ] } | |
4023 | ||
4024 | EQMP | |
4025 | ||
f1a1a356 GH |
4026 | { |
4027 | .name = "chardev-add", | |
4028 | .args_type = "id:s,backend:q", | |
7fad30f0 | 4029 | .mhandler.cmd_new = qmp_marshal_chardev_add, |
f1a1a356 GH |
4030 | }, |
4031 | ||
4032 | SQMP | |
4033 | chardev-add | |
4034 | ---------------- | |
4035 | ||
4036 | Add a chardev. | |
4037 | ||
4038 | Arguments: | |
4039 | ||
4040 | - "id": the chardev's ID, must be unique (json-string) | |
4041 | - "backend": chardev backend type + parameters | |
4042 | ||
ffbdbe59 | 4043 | Examples: |
f1a1a356 GH |
4044 | |
4045 | -> { "execute" : "chardev-add", | |
4046 | "arguments" : { "id" : "foo", | |
4047 | "backend" : { "type" : "null", "data" : {} } } } | |
4048 | <- { "return": {} } | |
4049 | ||
ffbdbe59 GH |
4050 | -> { "execute" : "chardev-add", |
4051 | "arguments" : { "id" : "bar", | |
4052 | "backend" : { "type" : "file", | |
4053 | "data" : { "out" : "/tmp/bar.log" } } } } | |
4054 | <- { "return": {} } | |
4055 | ||
0a1a7fab GH |
4056 | -> { "execute" : "chardev-add", |
4057 | "arguments" : { "id" : "baz", | |
4058 | "backend" : { "type" : "pty", "data" : {} } } } | |
4059 | <- { "return": { "pty" : "/dev/pty/42" } } | |
4060 | ||
f1a1a356 GH |
4061 | EQMP |
4062 | ||
4063 | { | |
4064 | .name = "chardev-remove", | |
4065 | .args_type = "id:s", | |
7fad30f0 | 4066 | .mhandler.cmd_new = qmp_marshal_chardev_remove, |
f1a1a356 GH |
4067 | }, |
4068 | ||
4069 | ||
4070 | SQMP | |
4071 | chardev-remove | |
4072 | -------------- | |
4073 | ||
4074 | Remove a chardev. | |
4075 | ||
4076 | Arguments: | |
4077 | ||
4078 | - "id": the chardev's ID, must exist and not be in use (json-string) | |
4079 | ||
4080 | Example: | |
4081 | ||
4082 | -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } } | |
4083 | <- { "return": {} } | |
4084 | ||
b1be4280 AK |
4085 | EQMP |
4086 | { | |
4087 | .name = "query-rx-filter", | |
4088 | .args_type = "name:s?", | |
7fad30f0 | 4089 | .mhandler.cmd_new = qmp_marshal_query_rx_filter, |
b1be4280 AK |
4090 | }, |
4091 | ||
4092 | SQMP | |
4093 | query-rx-filter | |
4094 | --------------- | |
4095 | ||
4096 | Show rx-filter information. | |
4097 | ||
4098 | Returns a json-array of rx-filter information for all NICs (or for the | |
4099 | given NIC), returning an error if the given NIC doesn't exist, or | |
4100 | given NIC doesn't support rx-filter querying, or given net client | |
4101 | isn't a NIC. | |
4102 | ||
4103 | The query will clear the event notification flag of each NIC, then qemu | |
4104 | will start to emit event to QMP monitor. | |
4105 | ||
4106 | Each array entry contains the following: | |
4107 | ||
4108 | - "name": net client name (json-string) | |
4109 | - "promiscuous": promiscuous mode is enabled (json-bool) | |
4110 | - "multicast": multicast receive state (one of 'normal', 'none', 'all') | |
4111 | - "unicast": unicast receive state (one of 'normal', 'none', 'all') | |
f7bc8ef8 | 4112 | - "vlan": vlan receive state (one of 'normal', 'none', 'all') (Since 2.0) |
b1be4280 AK |
4113 | - "broadcast-allowed": allow to receive broadcast (json-bool) |
4114 | - "multicast-overflow": multicast table is overflowed (json-bool) | |
4115 | - "unicast-overflow": unicast table is overflowed (json-bool) | |
4116 | - "main-mac": main macaddr string (json-string) | |
4117 | - "vlan-table": a json-array of active vlan id | |
4118 | - "unicast-table": a json-array of unicast macaddr string | |
4119 | - "multicast-table": a json-array of multicast macaddr string | |
4120 | ||
4121 | Example: | |
4122 | ||
4123 | -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } } | |
4124 | <- { "return": [ | |
4125 | { | |
4126 | "promiscuous": true, | |
4127 | "name": "vnet0", | |
4128 | "main-mac": "52:54:00:12:34:56", | |
4129 | "unicast": "normal", | |
f7bc8ef8 | 4130 | "vlan": "normal", |
b1be4280 AK |
4131 | "vlan-table": [ |
4132 | 4, | |
4133 | 0 | |
4134 | ], | |
4135 | "unicast-table": [ | |
4136 | ], | |
4137 | "multicast": "normal", | |
4138 | "multicast-overflow": false, | |
4139 | "unicast-overflow": false, | |
4140 | "multicast-table": [ | |
4141 | "01:00:5e:00:00:01", | |
4142 | "33:33:00:00:00:01", | |
4143 | "33:33:ff:12:34:56" | |
4144 | ], | |
4145 | "broadcast-allowed": false | |
4146 | } | |
4147 | ] | |
4148 | } | |
4149 | ||
d26c9a15 KW |
4150 | EQMP |
4151 | ||
4152 | { | |
4153 | .name = "blockdev-add", | |
4154 | .args_type = "options:q", | |
7fad30f0 | 4155 | .mhandler.cmd_new = qmp_marshal_blockdev_add, |
d26c9a15 KW |
4156 | }, |
4157 | ||
4158 | SQMP | |
4159 | blockdev-add | |
4160 | ------------ | |
4161 | ||
4162 | Add a block device. | |
4163 | ||
da2cf4e8 | 4164 | This command is still a work in progress. It doesn't support all |
81b936ae AG |
4165 | block drivers among other things. Stay away from it unless you want |
4166 | to help with its development. | |
da2cf4e8 | 4167 | |
d26c9a15 KW |
4168 | Arguments: |
4169 | ||
4170 | - "options": block driver options | |
4171 | ||
4172 | Example (1): | |
4173 | ||
4174 | -> { "execute": "blockdev-add", | |
4175 | "arguments": { "options" : { "driver": "qcow2", | |
4176 | "file": { "driver": "file", | |
4177 | "filename": "test.qcow2" } } } } | |
4178 | <- { "return": {} } | |
4179 | ||
4180 | Example (2): | |
4181 | ||
4182 | -> { "execute": "blockdev-add", | |
4183 | "arguments": { | |
4184 | "options": { | |
4185 | "driver": "qcow2", | |
4186 | "id": "my_disk", | |
4187 | "discard": "unmap", | |
4188 | "cache": { | |
4189 | "direct": true, | |
4190 | "writeback": true | |
4191 | }, | |
4192 | "file": { | |
4193 | "driver": "file", | |
4194 | "filename": "/tmp/test.qcow2" | |
4195 | }, | |
4196 | "backing": { | |
4197 | "driver": "raw", | |
4198 | "file": { | |
4199 | "driver": "file", | |
4200 | "filename": "/dev/fdset/4" | |
4201 | } | |
4202 | } | |
4203 | } | |
4204 | } | |
4205 | } | |
4206 | ||
4207 | <- { "return": {} } | |
4208 | ||
81b936ae AG |
4209 | EQMP |
4210 | ||
4211 | { | |
4212 | .name = "x-blockdev-del", | |
4213 | .args_type = "id:s?,node-name:s?", | |
4214 | .mhandler.cmd_new = qmp_marshal_x_blockdev_del, | |
4215 | }, | |
4216 | ||
4217 | SQMP | |
4218 | x-blockdev-del | |
4219 | ------------ | |
4220 | Since 2.5 | |
4221 | ||
4222 | Deletes a block device thas has been added using blockdev-add. | |
4223 | The selected device can be either a block backend or a graph node. | |
4224 | ||
4225 | In the former case the backend will be destroyed, along with its | |
4226 | inserted medium if there's any. The command will fail if the backend | |
4227 | or its medium are in use. | |
4228 | ||
4229 | In the latter case the node will be destroyed. The command will fail | |
4230 | if the node is attached to a block backend or is otherwise being | |
4231 | used. | |
4232 | ||
4233 | One of "id" or "node-name" must be specified, but not both. | |
4234 | ||
4235 | This command is still a work in progress and is considered | |
4236 | experimental. Stay away from it unless you want to help with its | |
4237 | development. | |
4238 | ||
4239 | Arguments: | |
4240 | ||
4241 | - "id": Name of the block backend device to delete (json-string, optional) | |
4242 | - "node-name": Name of the graph node to delete (json-string, optional) | |
4243 | ||
4244 | Example: | |
4245 | ||
4246 | -> { "execute": "blockdev-add", | |
4247 | "arguments": { | |
4248 | "options": { | |
4249 | "driver": "qcow2", | |
4250 | "id": "drive0", | |
4251 | "file": { | |
4252 | "driver": "file", | |
4253 | "filename": "test.qcow2" | |
4254 | } | |
4255 | } | |
4256 | } | |
4257 | } | |
4258 | ||
4259 | <- { "return": {} } | |
4260 | ||
4261 | -> { "execute": "x-blockdev-del", | |
4262 | "arguments": { "id": "drive0" } | |
4263 | } | |
4264 | <- { "return": {} } | |
4265 | ||
7d8a9f71 HR |
4266 | EQMP |
4267 | ||
4268 | { | |
4269 | .name = "blockdev-open-tray", | |
4270 | .args_type = "device:s,force:b?", | |
4271 | .mhandler.cmd_new = qmp_marshal_blockdev_open_tray, | |
4272 | }, | |
4273 | ||
4274 | SQMP | |
4275 | blockdev-open-tray | |
4276 | ------------------ | |
4277 | ||
4278 | Opens a block device's tray. If there is a block driver state tree inserted as a | |
4279 | medium, it will become inaccessible to the guest (but it will remain associated | |
4280 | to the block device, so closing the tray will make it accessible again). | |
4281 | ||
4282 | If the tray was already open before, this will be a no-op. | |
4283 | ||
4284 | Once the tray opens, a DEVICE_TRAY_MOVED event is emitted. There are cases in | |
4285 | which no such event will be generated, these include: | |
4286 | - if the guest has locked the tray, @force is false and the guest does not | |
4287 | respond to the eject request | |
4288 | - if the BlockBackend denoted by @device does not have a guest device attached | |
4289 | to it | |
4290 | - if the guest device does not have an actual tray and is empty, for instance | |
4291 | for floppy disk drives | |
4292 | ||
4293 | Arguments: | |
4294 | ||
4295 | - "device": block device name (json-string) | |
4296 | - "force": if false (the default), an eject request will be sent to the guest if | |
4297 | it has locked the tray (and the tray will not be opened immediately); | |
4298 | if true, the tray will be opened regardless of whether it is locked | |
4299 | (json-bool, optional) | |
4300 | ||
4301 | Example: | |
4302 | ||
4303 | -> { "execute": "blockdev-open-tray", | |
4304 | "arguments": { "device": "ide1-cd0" } } | |
4305 | ||
4306 | <- { "timestamp": { "seconds": 1418751016, | |
4307 | "microseconds": 716996 }, | |
4308 | "event": "DEVICE_TRAY_MOVED", | |
4309 | "data": { "device": "ide1-cd0", | |
4310 | "tray-open": true } } | |
4311 | ||
4312 | <- { "return": {} } | |
4313 | ||
abaaf59d HR |
4314 | EQMP |
4315 | ||
4316 | { | |
4317 | .name = "blockdev-close-tray", | |
4318 | .args_type = "device:s", | |
4319 | .mhandler.cmd_new = qmp_marshal_blockdev_close_tray, | |
4320 | }, | |
4321 | ||
4322 | SQMP | |
4323 | blockdev-close-tray | |
4324 | ------------------- | |
4325 | ||
4326 | Closes a block device's tray. If there is a block driver state tree associated | |
4327 | with the block device (which is currently ejected), that tree will be loaded as | |
4328 | the medium. | |
4329 | ||
4330 | If the tray was already closed before, this will be a no-op. | |
4331 | ||
4332 | Arguments: | |
4333 | ||
4334 | - "device": block device name (json-string) | |
4335 | ||
4336 | Example: | |
4337 | ||
4338 | -> { "execute": "blockdev-close-tray", | |
4339 | "arguments": { "device": "ide1-cd0" } } | |
4340 | ||
4341 | <- { "timestamp": { "seconds": 1418751345, | |
4342 | "microseconds": 272147 }, | |
4343 | "event": "DEVICE_TRAY_MOVED", | |
4344 | "data": { "device": "ide1-cd0", | |
4345 | "tray-open": false } } | |
4346 | ||
4347 | <- { "return": {} } | |
4348 | ||
2814f672 HR |
4349 | EQMP |
4350 | ||
4351 | { | |
6e0abc25 | 4352 | .name = "x-blockdev-remove-medium", |
2814f672 | 4353 | .args_type = "device:s", |
6e0abc25 | 4354 | .mhandler.cmd_new = qmp_marshal_x_blockdev_remove_medium, |
2814f672 HR |
4355 | }, |
4356 | ||
4357 | SQMP | |
6e0abc25 HR |
4358 | x-blockdev-remove-medium |
4359 | ------------------------ | |
2814f672 HR |
4360 | |
4361 | Removes a medium (a block driver state tree) from a block device. That block | |
4362 | device's tray must currently be open (unless there is no attached guest device). | |
4363 | ||
4364 | If the tray is open and there is no medium inserted, this will be a no-op. | |
4365 | ||
6e0abc25 HR |
4366 | This command is still a work in progress and is considered experimental. |
4367 | Stay away from it unless you want to help with its development. | |
4368 | ||
2814f672 HR |
4369 | Arguments: |
4370 | ||
4371 | - "device": block device name (json-string) | |
4372 | ||
4373 | Example: | |
4374 | ||
6e0abc25 | 4375 | -> { "execute": "x-blockdev-remove-medium", |
2814f672 HR |
4376 | "arguments": { "device": "ide1-cd0" } } |
4377 | ||
4378 | <- { "error": { "class": "GenericError", | |
4379 | "desc": "Tray of device 'ide1-cd0' is not open" } } | |
4380 | ||
4381 | -> { "execute": "blockdev-open-tray", | |
4382 | "arguments": { "device": "ide1-cd0" } } | |
4383 | ||
4384 | <- { "timestamp": { "seconds": 1418751627, | |
4385 | "microseconds": 549958 }, | |
4386 | "event": "DEVICE_TRAY_MOVED", | |
4387 | "data": { "device": "ide1-cd0", | |
4388 | "tray-open": true } } | |
4389 | ||
4390 | <- { "return": {} } | |
4391 | ||
6e0abc25 | 4392 | -> { "execute": "x-blockdev-remove-medium", |
2814f672 HR |
4393 | "arguments": { "device": "ide1-cd0" } } |
4394 | ||
4395 | <- { "return": {} } | |
4396 | ||
d1299882 HR |
4397 | EQMP |
4398 | ||
4399 | { | |
6e0abc25 | 4400 | .name = "x-blockdev-insert-medium", |
d1299882 | 4401 | .args_type = "device:s,node-name:s", |
6e0abc25 | 4402 | .mhandler.cmd_new = qmp_marshal_x_blockdev_insert_medium, |
d1299882 HR |
4403 | }, |
4404 | ||
4405 | SQMP | |
6e0abc25 HR |
4406 | x-blockdev-insert-medium |
4407 | ------------------------ | |
d1299882 HR |
4408 | |
4409 | Inserts a medium (a block driver state tree) into a block device. That block | |
4410 | device's tray must currently be open (unless there is no attached guest device) | |
4411 | and there must be no medium inserted already. | |
4412 | ||
6e0abc25 HR |
4413 | This command is still a work in progress and is considered experimental. |
4414 | Stay away from it unless you want to help with its development. | |
4415 | ||
d1299882 HR |
4416 | Arguments: |
4417 | ||
4418 | - "device": block device name (json-string) | |
4419 | - "node-name": root node of the BDS tree to insert into the block device | |
4420 | ||
4421 | Example: | |
4422 | ||
4423 | -> { "execute": "blockdev-add", | |
4424 | "arguments": { "options": { "node-name": "node0", | |
4425 | "driver": "raw", | |
4426 | "file": { "driver": "file", | |
4427 | "filename": "fedora.iso" } } } } | |
4428 | ||
4429 | <- { "return": {} } | |
4430 | ||
6e0abc25 | 4431 | -> { "execute": "x-blockdev-insert-medium", |
d1299882 HR |
4432 | "arguments": { "device": "ide1-cd0", |
4433 | "node-name": "node0" } } | |
4434 | ||
4435 | <- { "return": {} } | |
4436 | ||
7f821597 WC |
4437 | EQMP |
4438 | ||
4439 | { | |
4440 | .name = "x-blockdev-change", | |
4441 | .args_type = "parent:B,child:B?,node:B?", | |
4442 | .mhandler.cmd_new = qmp_marshal_x_blockdev_change, | |
4443 | }, | |
4444 | ||
4445 | SQMP | |
4446 | x-blockdev-change | |
4447 | ----------------- | |
4448 | ||
4449 | Dynamically reconfigure the block driver state graph. It can be used | |
4450 | to add, remove, insert or replace a graph node. Currently only the | |
4451 | Quorum driver implements this feature to add or remove its child. This | |
4452 | is useful to fix a broken quorum child. | |
4453 | ||
4454 | If @node is specified, it will be inserted under @parent. @child | |
4455 | may not be specified in this case. If both @parent and @child are | |
4456 | specified but @node is not, @child will be detached from @parent. | |
4457 | ||
4458 | Arguments: | |
4459 | - "parent": the id or name of the parent node (json-string) | |
4460 | - "child": the name of a child under the given parent node (json-string, optional) | |
4461 | - "node": the name of the node that will be added (json-string, optional) | |
4462 | ||
4463 | Note: this command is experimental, and not a stable API. It doesn't | |
4464 | support all kinds of operations, all kinds of children, nor all block | |
4465 | drivers. | |
4466 | ||
4467 | Warning: The data in a new quorum child MUST be consistent with that of | |
4468 | the rest of the array. | |
4469 | ||
4470 | Example: | |
4471 | ||
4472 | Add a new node to a quorum | |
4473 | -> { "execute": "blockdev-add", | |
4474 | "arguments": { "options": { "driver": "raw", | |
4475 | "node-name": "new_node", | |
4476 | "file": { "driver": "file", | |
4477 | "filename": "test.raw" } } } } | |
4478 | <- { "return": {} } | |
4479 | -> { "execute": "x-blockdev-change", | |
4480 | "arguments": { "parent": "disk1", | |
4481 | "node": "new_node" } } | |
4482 | <- { "return": {} } | |
4483 | ||
4484 | Delete a quorum's node | |
4485 | -> { "execute": "x-blockdev-change", | |
4486 | "arguments": { "parent": "disk1", | |
4487 | "child": "children.1" } } | |
4488 | <- { "return": {} } | |
4489 | ||
c13163fb BC |
4490 | EQMP |
4491 | ||
4492 | { | |
4493 | .name = "query-named-block-nodes", | |
4494 | .args_type = "", | |
7fad30f0 | 4495 | .mhandler.cmd_new = qmp_marshal_query_named_block_nodes, |
c13163fb BC |
4496 | }, |
4497 | ||
4498 | SQMP | |
4499 | @query-named-block-nodes | |
4500 | ------------------------ | |
4501 | ||
4502 | Return a list of BlockDeviceInfo for all the named block driver nodes | |
4503 | ||
4504 | Example: | |
4505 | ||
4506 | -> { "execute": "query-named-block-nodes" } | |
4507 | <- { "return": [ { "ro":false, | |
4508 | "drv":"qcow2", | |
4509 | "encrypted":false, | |
4510 | "file":"disks/test.qcow2", | |
4511 | "node-name": "my-node", | |
4512 | "backing_file_depth":1, | |
4513 | "bps":1000000, | |
4514 | "bps_rd":0, | |
4515 | "bps_wr":0, | |
4516 | "iops":1000000, | |
4517 | "iops_rd":0, | |
4518 | "iops_wr":0, | |
4519 | "bps_max": 8000000, | |
4520 | "bps_rd_max": 0, | |
4521 | "bps_wr_max": 0, | |
4522 | "iops_max": 0, | |
4523 | "iops_rd_max": 0, | |
4524 | "iops_wr_max": 0, | |
4525 | "iops_size": 0, | |
e2462113 | 4526 | "write_threshold": 0, |
c13163fb BC |
4527 | "image":{ |
4528 | "filename":"disks/test.qcow2", | |
4529 | "format":"qcow2", | |
4530 | "virtual-size":2048000, | |
4531 | "backing_file":"base.qcow2", | |
4532 | "full-backing-filename":"disks/base.qcow2", | |
5403432f | 4533 | "backing-filename-format":"qcow2", |
c13163fb BC |
4534 | "snapshots":[ |
4535 | { | |
4536 | "id": "1", | |
4537 | "name": "snapshot1", | |
4538 | "vm-state-size": 0, | |
4539 | "date-sec": 10000200, | |
4540 | "date-nsec": 12, | |
4541 | "vm-clock-sec": 206, | |
4542 | "vm-clock-nsec": 30 | |
4543 | } | |
4544 | ], | |
4545 | "backing-image":{ | |
4546 | "filename":"disks/base.qcow2", | |
4547 | "format":"qcow2", | |
4548 | "virtual-size":2048000 | |
4549 | } | |
c059451c | 4550 | } } ] } |
c13163fb | 4551 | |
24fb4133 HR |
4552 | EQMP |
4553 | ||
4554 | { | |
4555 | .name = "blockdev-change-medium", | |
39ff43d9 | 4556 | .args_type = "device:B,filename:F,format:s?,read-only-mode:s?", |
24fb4133 HR |
4557 | .mhandler.cmd_new = qmp_marshal_blockdev_change_medium, |
4558 | }, | |
4559 | ||
4560 | SQMP | |
4561 | blockdev-change-medium | |
4562 | ---------------------- | |
4563 | ||
4564 | Changes the medium inserted into a block device by ejecting the current medium | |
4565 | and loading a new image file which is inserted as the new medium. | |
4566 | ||
4567 | Arguments: | |
4568 | ||
4569 | - "device": device name (json-string) | |
4570 | - "filename": filename of the new image (json-string) | |
4571 | - "format": format of the new image (json-string, optional) | |
39ff43d9 HR |
4572 | - "read-only-mode": new read-only mode (json-string, optional) |
4573 | - Possible values: "retain" (default), "read-only", "read-write" | |
24fb4133 HR |
4574 | |
4575 | Examples: | |
4576 | ||
4577 | 1. Change a removable medium | |
4578 | ||
4579 | -> { "execute": "blockdev-change-medium", | |
4580 | "arguments": { "device": "ide1-cd0", | |
4581 | "filename": "/srv/images/Fedora-12-x86_64-DVD.iso", | |
4582 | "format": "raw" } } | |
4583 | <- { "return": {} } | |
4584 | ||
39ff43d9 HR |
4585 | 2. Load a read-only medium into a writable drive |
4586 | ||
4587 | -> { "execute": "blockdev-change-medium", | |
4588 | "arguments": { "device": "isa-fd0", | |
4589 | "filename": "/srv/images/ro.img", | |
4590 | "format": "raw", | |
4591 | "read-only-mode": "retain" } } | |
4592 | ||
4593 | <- { "error": | |
4594 | { "class": "GenericError", | |
4595 | "desc": "Could not open '/srv/images/ro.img': Permission denied" } } | |
4596 | ||
4597 | -> { "execute": "blockdev-change-medium", | |
4598 | "arguments": { "device": "isa-fd0", | |
4599 | "filename": "/srv/images/ro.img", | |
4600 | "format": "raw", | |
4601 | "read-only-mode": "read-only" } } | |
4602 | ||
4603 | <- { "return": {} } | |
4604 | ||
76b5d850 HT |
4605 | EQMP |
4606 | ||
4607 | { | |
4608 | .name = "query-memdev", | |
4609 | .args_type = "", | |
7fad30f0 | 4610 | .mhandler.cmd_new = qmp_marshal_query_memdev, |
76b5d850 HT |
4611 | }, |
4612 | ||
4613 | SQMP | |
4614 | query-memdev | |
4615 | ------------ | |
4616 | ||
4617 | Show memory devices information. | |
4618 | ||
4619 | ||
4620 | Example (1): | |
4621 | ||
4622 | -> { "execute": "query-memdev" } | |
4623 | <- { "return": [ | |
4624 | { | |
4625 | "size": 536870912, | |
4626 | "merge": false, | |
4627 | "dump": true, | |
4628 | "prealloc": false, | |
4629 | "host-nodes": [0, 1], | |
4630 | "policy": "bind" | |
4631 | }, | |
4632 | { | |
4633 | "size": 536870912, | |
4634 | "merge": false, | |
4635 | "dump": true, | |
4636 | "prealloc": true, | |
4637 | "host-nodes": [2, 3], | |
4638 | "policy": "preferred" | |
4639 | } | |
4640 | ] | |
4641 | } | |
4642 | ||
6f2e2730 IM |
4643 | EQMP |
4644 | ||
4645 | { | |
4646 | .name = "query-memory-devices", | |
4647 | .args_type = "", | |
7fad30f0 | 4648 | .mhandler.cmd_new = qmp_marshal_query_memory_devices, |
6f2e2730 IM |
4649 | }, |
4650 | ||
4651 | SQMP | |
4652 | @query-memory-devices | |
4653 | -------------------- | |
4654 | ||
4655 | Return a list of memory devices. | |
4656 | ||
4657 | Example: | |
4658 | -> { "execute": "query-memory-devices" } | |
4659 | <- { "return": [ { "data": | |
4660 | { "addr": 5368709120, | |
4661 | "hotpluggable": true, | |
4662 | "hotplugged": true, | |
4663 | "id": "d1", | |
4664 | "memdev": "/objects/memX", | |
4665 | "node": 0, | |
4666 | "size": 1073741824, | |
4667 | "slot": 0}, | |
4668 | "type": "dimm" | |
4669 | } ] } | |
f1a1a356 | 4670 | EQMP |
02419bcb IM |
4671 | |
4672 | { | |
4673 | .name = "query-acpi-ospm-status", | |
4674 | .args_type = "", | |
7fad30f0 | 4675 | .mhandler.cmd_new = qmp_marshal_query_acpi_ospm_status, |
02419bcb IM |
4676 | }, |
4677 | ||
4678 | SQMP | |
4679 | @query-acpi-ospm-status | |
4680 | -------------------- | |
4681 | ||
4682 | Return list of ACPIOSTInfo for devices that support status reporting | |
4683 | via ACPI _OST method. | |
4684 | ||
4685 | Example: | |
4686 | -> { "execute": "query-acpi-ospm-status" } | |
4687 | <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0}, | |
4688 | { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0}, | |
4689 | { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0}, | |
4690 | { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0} | |
4691 | ]} | |
4692 | EQMP | |
f2ae8abf MT |
4693 | |
4694 | #if defined TARGET_I386 | |
4695 | { | |
4696 | .name = "rtc-reset-reinjection", | |
4697 | .args_type = "", | |
7fad30f0 | 4698 | .mhandler.cmd_new = qmp_marshal_rtc_reset_reinjection, |
f2ae8abf MT |
4699 | }, |
4700 | #endif | |
4701 | ||
4702 | SQMP | |
4703 | rtc-reset-reinjection | |
4704 | --------------------- | |
4705 | ||
4706 | Reset the RTC interrupt reinjection backlog. | |
4707 | ||
4708 | Arguments: None. | |
4709 | ||
4710 | Example: | |
4711 | ||
4712 | -> { "execute": "rtc-reset-reinjection" } | |
4713 | <- { "return": {} } | |
1dde0f48 LV |
4714 | EQMP |
4715 | ||
4716 | { | |
4717 | .name = "trace-event-get-state", | |
77e2b172 | 4718 | .args_type = "name:s,vcpu:i?", |
7fad30f0 | 4719 | .mhandler.cmd_new = qmp_marshal_trace_event_get_state, |
1dde0f48 LV |
4720 | }, |
4721 | ||
4722 | SQMP | |
4723 | trace-event-get-state | |
4724 | --------------------- | |
4725 | ||
4726 | Query the state of events. | |
4727 | ||
77e2b172 LV |
4728 | Arguments: |
4729 | ||
4730 | - "name": Event name pattern (json-string). | |
4731 | - "vcpu": The vCPU to query, any vCPU by default (json-int, optional). | |
4732 | ||
4733 | An event is returned if: | |
4734 | - its name matches the "name" pattern, and | |
4735 | - if "vcpu" is given, the event has the "vcpu" property. | |
4736 | ||
4737 | Therefore, if "vcpu" is given, the operation will only match per-vCPU events, | |
4738 | returning their state on the specified vCPU. Special case: if "name" is an exact | |
4739 | match, "vcpu" is given and the event does not have the "vcpu" property, an error | |
4740 | is returned. | |
4741 | ||
1dde0f48 LV |
4742 | Example: |
4743 | ||
4744 | -> { "execute": "trace-event-get-state", "arguments": { "name": "qemu_memalign" } } | |
4745 | <- { "return": [ { "name": "qemu_memalign", "state": "disabled" } ] } | |
4746 | EQMP | |
4747 | ||
4748 | { | |
4749 | .name = "trace-event-set-state", | |
77e2b172 | 4750 | .args_type = "name:s,enable:b,ignore-unavailable:b?,vcpu:i?", |
7fad30f0 | 4751 | .mhandler.cmd_new = qmp_marshal_trace_event_set_state, |
1dde0f48 | 4752 | }, |
f2ae8abf | 4753 | |
1dde0f48 LV |
4754 | SQMP |
4755 | trace-event-set-state | |
4756 | --------------------- | |
4757 | ||
4758 | Set the state of events. | |
4759 | ||
77e2b172 LV |
4760 | Arguments: |
4761 | ||
4762 | - "name": Event name pattern (json-string). | |
4763 | - "enable": Whether to enable or disable the event (json-bool). | |
4764 | - "ignore-unavailable": Whether to ignore errors for events that cannot be | |
4765 | changed (json-bool, optional). | |
4766 | - "vcpu": The vCPU to act upon, all vCPUs by default (json-int, optional). | |
4767 | ||
4768 | An event's state is modified if: | |
4769 | - its name matches the "name" pattern, and | |
4770 | - if "vcpu" is given, the event has the "vcpu" property. | |
4771 | ||
4772 | Therefore, if "vcpu" is given, the operation will only match per-vCPU events, | |
4773 | setting their state on the specified vCPU. Special case: if "name" is an exact | |
4774 | match, "vcpu" is given and the event does not have the "vcpu" property, an error | |
4775 | is returned. | |
4776 | ||
1dde0f48 LV |
4777 | Example: |
4778 | ||
4779 | -> { "execute": "trace-event-set-state", "arguments": { "name": "qemu_memalign", "enable": "true" } } | |
4780 | <- { "return": {} } | |
50c6617f MT |
4781 | EQMP |
4782 | ||
4783 | { | |
6575ccdd | 4784 | .name = "input-send-event", |
51fc4476 | 4785 | .args_type = "console:i?,events:q", |
6575ccdd | 4786 | .mhandler.cmd_new = qmp_marshal_input_send_event, |
50c6617f MT |
4787 | }, |
4788 | ||
4789 | SQMP | |
6575ccdd | 4790 | @input-send-event |
50c6617f MT |
4791 | ----------------- |
4792 | ||
4793 | Send input event to guest. | |
4794 | ||
4795 | Arguments: | |
4796 | ||
b98d26e3 GH |
4797 | - "device": display device (json-string, optional) |
4798 | - "head": display head (json-int, optional) | |
4799 | - "events": list of input events | |
50c6617f MT |
4800 | |
4801 | The consoles are visible in the qom tree, under | |
4802 | /backend/console[$index]. They have a device link and head property, so | |
4803 | it is possible to map which console belongs to which device and display. | |
4804 | ||
df5b2adb GH |
4805 | Note: this command is experimental, and not a stable API. |
4806 | ||
50c6617f MT |
4807 | Example (1): |
4808 | ||
4809 | Press left mouse button. | |
4810 | ||
6575ccdd | 4811 | -> { "execute": "input-send-event", |
b98d26e3 | 4812 | "arguments": { "device": "video0", |
50c6617f | 4813 | "events": [ { "type": "btn", |
f22d0af0 | 4814 | "data" : { "down": true, "button": "left" } } ] } } |
50c6617f MT |
4815 | <- { "return": {} } |
4816 | ||
6575ccdd | 4817 | -> { "execute": "input-send-event", |
b98d26e3 | 4818 | "arguments": { "device": "video0", |
50c6617f | 4819 | "events": [ { "type": "btn", |
f22d0af0 | 4820 | "data" : { "down": false, "button": "left" } } ] } } |
50c6617f MT |
4821 | <- { "return": {} } |
4822 | ||
4823 | Example (2): | |
4824 | ||
4825 | Press ctrl-alt-del. | |
4826 | ||
6575ccdd | 4827 | -> { "execute": "input-send-event", |
b98d26e3 | 4828 | "arguments": { "events": [ |
50c6617f MT |
4829 | { "type": "key", "data" : { "down": true, |
4830 | "key": {"type": "qcode", "data": "ctrl" } } }, | |
4831 | { "type": "key", "data" : { "down": true, | |
4832 | "key": {"type": "qcode", "data": "alt" } } }, | |
4833 | { "type": "key", "data" : { "down": true, | |
4834 | "key": {"type": "qcode", "data": "delete" } } } ] } } | |
4835 | <- { "return": {} } | |
4836 | ||
4837 | Example (3): | |
4838 | ||
4839 | Move mouse pointer to absolute coordinates (20000, 400). | |
4840 | ||
6575ccdd | 4841 | -> { "execute": "input-send-event" , |
b98d26e3 | 4842 | "arguments": { "events": [ |
01df5143 GH |
4843 | { "type": "abs", "data" : { "axis": "x", "value" : 20000 } }, |
4844 | { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } } | |
50c6617f MT |
4845 | <- { "return": {} } |
4846 | ||
e2462113 FR |
4847 | EQMP |
4848 | ||
4849 | { | |
4850 | .name = "block-set-write-threshold", | |
4851 | .args_type = "node-name:s,write-threshold:l", | |
7fad30f0 | 4852 | .mhandler.cmd_new = qmp_marshal_block_set_write_threshold, |
e2462113 FR |
4853 | }, |
4854 | ||
4855 | SQMP | |
4856 | block-set-write-threshold | |
4857 | ------------ | |
4858 | ||
4859 | Change the write threshold for a block drive. The threshold is an offset, | |
4860 | thus must be non-negative. Default is no write threshold. | |
4861 | Setting the threshold to zero disables it. | |
4862 | ||
4863 | Arguments: | |
4864 | ||
4865 | - "node-name": the node name in the block driver state graph (json-string) | |
4866 | - "write-threshold": the write threshold in bytes (json-int) | |
4867 | ||
4868 | Example: | |
4869 | ||
4870 | -> { "execute": "block-set-write-threshold", | |
4871 | "arguments": { "node-name": "mydev", | |
4872 | "write-threshold": 17179869184 } } | |
4873 | <- { "return": {} } | |
4874 | ||
f2ae8abf | 4875 | EQMP |
fafa4d50 SF |
4876 | |
4877 | { | |
4878 | .name = "query-rocker", | |
4879 | .args_type = "name:s", | |
7fad30f0 | 4880 | .mhandler.cmd_new = qmp_marshal_query_rocker, |
fafa4d50 SF |
4881 | }, |
4882 | ||
4883 | SQMP | |
4884 | Show rocker switch | |
4885 | ------------------ | |
4886 | ||
4887 | Arguments: | |
4888 | ||
4889 | - "name": switch name | |
4890 | ||
4891 | Example: | |
4892 | ||
4893 | -> { "execute": "query-rocker", "arguments": { "name": "sw1" } } | |
4894 | <- { "return": {"name": "sw1", "ports": 2, "id": 1327446905938}} | |
4895 | ||
4896 | EQMP | |
4897 | ||
4898 | { | |
4899 | .name = "query-rocker-ports", | |
4900 | .args_type = "name:s", | |
7fad30f0 | 4901 | .mhandler.cmd_new = qmp_marshal_query_rocker_ports, |
fafa4d50 SF |
4902 | }, |
4903 | ||
4904 | SQMP | |
4905 | Show rocker switch ports | |
4906 | ------------------------ | |
4907 | ||
4908 | Arguments: | |
4909 | ||
4910 | - "name": switch name | |
4911 | ||
4912 | Example: | |
4913 | ||
4914 | -> { "execute": "query-rocker-ports", "arguments": { "name": "sw1" } } | |
4915 | <- { "return": [ {"duplex": "full", "enabled": true, "name": "sw1.1", | |
4916 | "autoneg": "off", "link-up": true, "speed": 10000}, | |
4917 | {"duplex": "full", "enabled": true, "name": "sw1.2", | |
4918 | "autoneg": "off", "link-up": true, "speed": 10000} | |
4919 | ]} | |
4920 | ||
4921 | EQMP | |
4922 | ||
4923 | { | |
4924 | .name = "query-rocker-of-dpa-flows", | |
4925 | .args_type = "name:s,tbl-id:i?", | |
7fad30f0 | 4926 | .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_flows, |
fafa4d50 SF |
4927 | }, |
4928 | ||
4929 | SQMP | |
4930 | Show rocker switch OF-DPA flow tables | |
4931 | ------------------------------------- | |
4932 | ||
4933 | Arguments: | |
4934 | ||
4935 | - "name": switch name | |
4936 | - "tbl-id": (optional) flow table ID | |
4937 | ||
4938 | Example: | |
4939 | ||
4940 | -> { "execute": "query-rocker-of-dpa-flows", "arguments": { "name": "sw1" } } | |
4941 | <- { "return": [ {"key": {"in-pport": 0, "priority": 1, "tbl-id": 0}, | |
4942 | "hits": 138, | |
4943 | "cookie": 0, | |
4944 | "action": {"goto-tbl": 10}, | |
4945 | "mask": {"in-pport": 4294901760} | |
4946 | }, | |
4947 | {...more...}, | |
4948 | ]} | |
4949 | ||
4950 | EQMP | |
4951 | ||
4952 | { | |
4953 | .name = "query-rocker-of-dpa-groups", | |
4954 | .args_type = "name:s,type:i?", | |
7fad30f0 | 4955 | .mhandler.cmd_new = qmp_marshal_query_rocker_of_dpa_groups, |
fafa4d50 SF |
4956 | }, |
4957 | ||
4958 | SQMP | |
4959 | Show rocker OF-DPA group tables | |
4960 | ------------------------------- | |
4961 | ||
4962 | Arguments: | |
4963 | ||
4964 | - "name": switch name | |
4965 | - "type": (optional) group type | |
4966 | ||
4967 | Example: | |
4968 | ||
4969 | -> { "execute": "query-rocker-of-dpa-groups", "arguments": { "name": "sw1" } } | |
4970 | <- { "return": [ {"type": 0, "out-pport": 2, "pport": 2, "vlan-id": 3841, | |
4971 | "pop-vlan": 1, "id": 251723778}, | |
4972 | {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3841, | |
4973 | "pop-vlan": 1, "id": 251723776}, | |
4974 | {"type": 0, "out-pport": 1, "pport": 1, "vlan-id": 3840, | |
4975 | "pop-vlan": 1, "id": 251658241}, | |
4976 | {"type": 0, "out-pport": 0, "pport": 0, "vlan-id": 3840, | |
4977 | "pop-vlan": 1, "id": 251658240} | |
4978 | ]} | |
ae50a770 PX |
4979 | |
4980 | EQMP | |
4981 | ||
4982 | #if defined TARGET_ARM | |
4983 | { | |
4984 | .name = "query-gic-capabilities", | |
4985 | .args_type = "", | |
4986 | .mhandler.cmd_new = qmp_marshal_query_gic_capabilities, | |
4987 | }, | |
4988 | #endif | |
4989 | ||
4990 | SQMP | |
4991 | query-gic-capabilities | |
4992 | --------------- | |
4993 | ||
4994 | Return a list of GICCapability objects, describing supported GIC | |
4995 | (Generic Interrupt Controller) versions. | |
4996 | ||
4997 | Arguments: None | |
4998 | ||
4999 | Example: | |
5000 | ||
5001 | -> { "execute": "query-gic-capabilities" } | |
5002 | <- { "return": [{ "version": 2, "emulated": true, "kernel": false }, | |
5003 | { "version": 3, "emulated": false, "kernel": true } ] } | |
5004 | ||
5005 | EQMP | |
d4633541 IM |
5006 | |
5007 | { | |
5008 | .name = "query-hotpluggable-cpus", | |
5009 | .args_type = "", | |
5010 | .mhandler.cmd_new = qmp_marshal_query_hotpluggable_cpus, | |
5011 | }, | |
5012 | ||
5013 | SQMP | |
5014 | Show existing/possible CPUs | |
5015 | --------------------------- | |
5016 | ||
5017 | Arguments: None. | |
5018 | ||
5019 | Example for pseries machine type started with | |
5020 | -smp 2,cores=2,maxcpus=4 -cpu POWER8: | |
5021 | ||
5022 | -> { "execute": "query-hotpluggable-cpus" } | |
5023 | <- {"return": [ | |
13f5e800 | 5024 | { "props": { "core-id": 8 }, "type": "POWER8-spapr-cpu-core", |
d4633541 | 5025 | "vcpus-count": 1 }, |
13f5e800 | 5026 | { "props": { "core-id": 0 }, "type": "POWER8-spapr-cpu-core", |
d4633541 IM |
5027 | "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"} |
5028 | ]}' | |
4d952914 IM |
5029 | |
5030 | Example for pc machine type started with | |
5031 | -smp 1,maxcpus=2: | |
5032 | -> { "execute": "query-hotpluggable-cpus" } | |
5033 | <- {"return": [ | |
5034 | { | |
5035 | "type": "qemu64-x86_64-cpu", "vcpus-count": 1, | |
5036 | "props": {"core-id": 0, "socket-id": 1, "thread-id": 0} | |
5037 | }, | |
5038 | { | |
5039 | "qom-path": "/machine/unattached/device[0]", | |
5040 | "type": "qemu64-x86_64-cpu", "vcpus-count": 1, | |
5041 | "props": {"core-id": 0, "socket-id": 0, "thread-id": 0} | |
5042 | } | |
5043 | ]} |