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