]> Git Repo - qemu.git/blob - qapi-schema.json
qapi-schema: Collect transaction stuff in qapi/transaction.json
[qemu.git] / qapi-schema.json
1 # -*- Mode: Python -*-
2 ##
3 # = Introduction
4 #
5 # This document describes all commands currently supported by QMP.
6 #
7 # Most of the time their usage is exactly the same as in the user Monitor, this
8 # means that any other document which also describe commands (the manpage,
9 # QEMU's manual, etc) can and should be consulted.
10 #
11 # QMP has two types of commands: regular and query commands. Regular commands
12 # usually change the Virtual Machine's state someway, while query commands just
13 # return information. The sections below are divided accordingly.
14 #
15 # It's important to observe that all communication examples are formatted in
16 # a reader-friendly way, so that they're easier to understand. However, in real
17 # protocol usage, they're emitted as a single line.
18 #
19 # Also, the following notation is used to denote data flow:
20 #
21 # Example:
22 #
23 # | -> data issued by the Client
24 # | <- Server data response
25 #
26 # Please, refer to the QMP specification (docs/interop/qmp-spec.txt) for
27 # detailed information on the Server command and response formats.
28 #
29 # = Stability Considerations
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 ##
51
52 { 'pragma': { 'doc-required': true } }
53
54 # Whitelists to permit QAPI rule violations; think twice before you
55 # add to them!
56 { 'pragma': {
57     # Commands allowed to return a non-dictionary:
58     'returns-whitelist': [
59         'human-monitor-command',
60         'qom-get',
61         'query-migrate-cache-size',
62         'query-tpm-models',
63         'query-tpm-types',
64         'ringbuf-read' ],
65     'name-case-whitelist': [
66         'ACPISlotType',         # DIMM, visible through query-acpi-ospm-status
67         'CpuInfoMIPS',          # PC, visible through query-cpu
68         'CpuInfoTricore',       # PC, visible through query-cpu
69         'QapiErrorClass',       # all members, visible through errors
70         'UuidInfo',             # UUID, visible through query-uuid
71         'X86CPURegister32',     # all members, visible indirectly through qom-get
72         'q_obj_CpuInfo-base'    # CPU, visible through query-cpu
73     ] } }
74
75 # Documentation generated with qapi2texi.py is in source order, with
76 # included sub-schemas inserted at the first include directive
77 # (subsequent include directives have no effect).  To get a sane and
78 # stable order, it's best to include each sub-schema just once, or
79 # include it first in qapi-schema.json.
80
81 { 'include': 'qapi/common.json' }
82 { 'include': 'qapi/sockets.json' }
83 { 'include': 'qapi/run-state.json' }
84 { 'include': 'qapi/crypto.json' }
85 { 'include': 'qapi/block.json' }
86 { 'include': 'qapi/char.json' }
87 { 'include': 'qapi/net.json' }
88 { 'include': 'qapi/rocker.json' }
89 { 'include': 'qapi/ui.json' }
90 { 'include': 'qapi/migration.json' }
91 { 'include': 'qapi/transaction.json' }
92 { 'include': 'qapi/event.json' }
93 { 'include': 'qapi/trace.json' }
94 { 'include': 'qapi/introspect.json' }
95
96 ##
97 # = QMP commands
98 ##
99
100 ##
101 # @qmp_capabilities:
102 #
103 # Enable QMP capabilities.
104 #
105 # Arguments: None.
106 #
107 # Example:
108 #
109 # -> { "execute": "qmp_capabilities" }
110 # <- { "return": {} }
111 #
112 # Notes: This command is valid exactly when first connecting: it must be
113 # issued before any other command will be accepted, and will fail once the
114 # monitor is accepting other commands. (see qemu docs/interop/qmp-spec.txt)
115 #
116 # Since: 0.13
117 #
118 ##
119 { 'command': 'qmp_capabilities' }
120
121 ##
122 # @LostTickPolicy:
123 #
124 # Policy for handling lost ticks in timer devices.
125 #
126 # @discard: throw away the missed tick(s) and continue with future injection
127 #           normally.  Guest time may be delayed, unless the OS has explicit
128 #           handling of lost ticks
129 #
130 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
131 #         delayed due to the late tick
132 #
133 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
134 #         may be delayed, depending on how the OS reacts to the merging
135 #         of ticks
136 #
137 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
138 #        guest time should not be delayed once catchup is complete.
139 #
140 # Since: 2.0
141 ##
142 { 'enum': 'LostTickPolicy',
143   'data': ['discard', 'delay', 'merge', 'slew' ] }
144
145 ##
146 # @add_client:
147 #
148 # Allow client connections for VNC, Spice and socket based
149 # character devices to be passed in to QEMU via SCM_RIGHTS.
150 #
151 # @protocol: protocol name. Valid names are "vnc", "spice" or the
152 #            name of a character device (eg. from -chardev id=XXXX)
153 #
154 # @fdname: file descriptor name previously passed via 'getfd' command
155 #
156 # @skipauth: whether to skip authentication. Only applies
157 #            to "vnc" and "spice" protocols
158 #
159 # @tls: whether to perform TLS. Only applies to the "spice"
160 #       protocol
161 #
162 # Returns: nothing on success.
163 #
164 # Since: 0.14.0
165 #
166 # Example:
167 #
168 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
169 #                                              "fdname": "myclient" } }
170 # <- { "return": {} }
171 #
172 ##
173 { 'command': 'add_client',
174   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
175             '*tls': 'bool' } }
176
177 ##
178 # @NameInfo:
179 #
180 # Guest name information.
181 #
182 # @name: The name of the guest
183 #
184 # Since: 0.14.0
185 ##
186 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
187
188 ##
189 # @query-name:
190 #
191 # Return the name information of a guest.
192 #
193 # Returns: @NameInfo of the guest
194 #
195 # Since: 0.14.0
196 #
197 # Example:
198 #
199 # -> { "execute": "query-name" }
200 # <- { "return": { "name": "qemu-name" } }
201 #
202 ##
203 { 'command': 'query-name', 'returns': 'NameInfo' }
204
205 ##
206 # @KvmInfo:
207 #
208 # Information about support for KVM acceleration
209 #
210 # @enabled: true if KVM acceleration is active
211 #
212 # @present: true if KVM acceleration is built into this executable
213 #
214 # Since: 0.14.0
215 ##
216 { 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
217
218 ##
219 # @query-kvm:
220 #
221 # Returns information about KVM acceleration
222 #
223 # Returns: @KvmInfo
224 #
225 # Since: 0.14.0
226 #
227 # Example:
228 #
229 # -> { "execute": "query-kvm" }
230 # <- { "return": { "enabled": true, "present": true } }
231 #
232 ##
233 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
234
235 ##
236 # @UuidInfo:
237 #
238 # Guest UUID information (Universally Unique Identifier).
239 #
240 # @UUID: the UUID of the guest
241 #
242 # Since: 0.14.0
243 #
244 # Notes: If no UUID was specified for the guest, a null UUID is returned.
245 ##
246 { 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
247
248 ##
249 # @query-uuid:
250 #
251 # Query the guest UUID information.
252 #
253 # Returns: The @UuidInfo for the guest
254 #
255 # Since: 0.14.0
256 #
257 # Example:
258 #
259 # -> { "execute": "query-uuid" }
260 # <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
261 #
262 ##
263 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
264
265 ##
266 # @EventInfo:
267 #
268 # Information about a QMP event
269 #
270 # @name: The event name
271 #
272 # Since: 1.2.0
273 ##
274 { 'struct': 'EventInfo', 'data': {'name': 'str'} }
275
276 ##
277 # @query-events:
278 #
279 # Return a list of supported QMP events by this server
280 #
281 # Returns: A list of @EventInfo for all supported events
282 #
283 # Since: 1.2.0
284 #
285 # Example:
286 #
287 # -> { "execute": "query-events" }
288 # <- {
289 #      "return": [
290 #          {
291 #             "name":"SHUTDOWN"
292 #          },
293 #          {
294 #             "name":"RESET"
295 #          }
296 #       ]
297 #    }
298 #
299 # Note: This example has been shortened as the real response is too long.
300 #
301 ##
302 { 'command': 'query-events', 'returns': ['EventInfo'] }
303
304 ##
305 # @CpuInfoArch:
306 #
307 # An enumeration of cpu types that enable additional information during
308 # @query-cpus.
309 #
310 # Since: 2.6
311 ##
312 { 'enum': 'CpuInfoArch',
313   'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
314
315 ##
316 # @CpuInfo:
317 #
318 # Information about a virtual CPU
319 #
320 # @CPU: the index of the virtual CPU
321 #
322 # @current: this only exists for backwards compatibility and should be ignored
323 #
324 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
325 #          to a processor specific low power mode.
326 #
327 # @qom_path: path to the CPU object in the QOM tree (since 2.4)
328 #
329 # @thread_id: ID of the underlying host thread
330 #
331 # @props: properties describing to which node/socket/core/thread
332 #         virtual CPU belongs to, provided if supported by board (since 2.10)
333 #
334 # @arch: architecture of the cpu, which determines which additional fields
335 #        will be listed (since 2.6)
336 #
337 # Since: 0.14.0
338 #
339 # Notes: @halted is a transient state that changes frequently.  By the time the
340 #        data is sent to the client, the guest may no longer be halted.
341 ##
342 { 'union': 'CpuInfo',
343   'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
344            'qom_path': 'str', 'thread_id': 'int',
345            '*props': 'CpuInstanceProperties', 'arch': 'CpuInfoArch' },
346   'discriminator': 'arch',
347   'data': { 'x86': 'CpuInfoX86',
348             'sparc': 'CpuInfoSPARC',
349             'ppc': 'CpuInfoPPC',
350             'mips': 'CpuInfoMIPS',
351             'tricore': 'CpuInfoTricore',
352             'other': 'CpuInfoOther' } }
353
354 ##
355 # @CpuInfoX86:
356 #
357 # Additional information about a virtual i386 or x86_64 CPU
358 #
359 # @pc: the 64-bit instruction pointer
360 #
361 # Since: 2.6
362 ##
363 { 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
364
365 ##
366 # @CpuInfoSPARC:
367 #
368 # Additional information about a virtual SPARC CPU
369 #
370 # @pc: the PC component of the instruction pointer
371 #
372 # @npc: the NPC component of the instruction pointer
373 #
374 # Since: 2.6
375 ##
376 { 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
377
378 ##
379 # @CpuInfoPPC:
380 #
381 # Additional information about a virtual PPC CPU
382 #
383 # @nip: the instruction pointer
384 #
385 # Since: 2.6
386 ##
387 { 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
388
389 ##
390 # @CpuInfoMIPS:
391 #
392 # Additional information about a virtual MIPS CPU
393 #
394 # @PC: the instruction pointer
395 #
396 # Since: 2.6
397 ##
398 { 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
399
400 ##
401 # @CpuInfoTricore:
402 #
403 # Additional information about a virtual Tricore CPU
404 #
405 # @PC: the instruction pointer
406 #
407 # Since: 2.6
408 ##
409 { 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
410
411 ##
412 # @CpuInfoOther:
413 #
414 # No additional information is available about the virtual CPU
415 #
416 # Since: 2.6
417 #
418 ##
419 { 'struct': 'CpuInfoOther', 'data': { } }
420
421 ##
422 # @query-cpus:
423 #
424 # Returns a list of information about each virtual CPU.
425 #
426 # Returns: a list of @CpuInfo for each virtual CPU
427 #
428 # Since: 0.14.0
429 #
430 # Example:
431 #
432 # -> { "execute": "query-cpus" }
433 # <- { "return": [
434 #          {
435 #             "CPU":0,
436 #             "current":true,
437 #             "halted":false,
438 #             "qom_path":"/machine/unattached/device[0]",
439 #             "arch":"x86",
440 #             "pc":3227107138,
441 #             "thread_id":3134
442 #          },
443 #          {
444 #             "CPU":1,
445 #             "current":false,
446 #             "halted":true,
447 #             "qom_path":"/machine/unattached/device[2]",
448 #             "arch":"x86",
449 #             "pc":7108165,
450 #             "thread_id":3135
451 #          }
452 #       ]
453 #    }
454 #
455 ##
456 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
457
458 ##
459 # @IOThreadInfo:
460 #
461 # Information about an iothread
462 #
463 # @id: the identifier of the iothread
464 #
465 # @thread-id: ID of the underlying host thread
466 #
467 # @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
468 #               (since 2.9)
469 #
470 # @poll-grow: how many ns will be added to polling time, 0 means that it's not
471 #             configured (since 2.9)
472 #
473 # @poll-shrink: how many ns will be removed from polling time, 0 means that
474 #               it's not configured (since 2.9)
475 #
476 # Since: 2.0
477 ##
478 { 'struct': 'IOThreadInfo',
479   'data': {'id': 'str',
480            'thread-id': 'int',
481            'poll-max-ns': 'int',
482            'poll-grow': 'int',
483            'poll-shrink': 'int' } }
484
485 ##
486 # @query-iothreads:
487 #
488 # Returns a list of information about each iothread.
489 #
490 # Note: this list excludes the QEMU main loop thread, which is not declared
491 # using the -object iothread command-line option.  It is always the main thread
492 # of the process.
493 #
494 # Returns: a list of @IOThreadInfo for each iothread
495 #
496 # Since: 2.0
497 #
498 # Example:
499 #
500 # -> { "execute": "query-iothreads" }
501 # <- { "return": [
502 #          {
503 #             "id":"iothread0",
504 #             "thread-id":3134
505 #          },
506 #          {
507 #             "id":"iothread1",
508 #             "thread-id":3135
509 #          }
510 #       ]
511 #    }
512 #
513 ##
514 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
515
516 ##
517 # @BalloonInfo:
518 #
519 # Information about the guest balloon device.
520 #
521 # @actual: the number of bytes the balloon currently contains
522 #
523 # Since: 0.14.0
524 #
525 ##
526 { 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
527
528 ##
529 # @query-balloon:
530 #
531 # Return information about the balloon device.
532 #
533 # Returns: @BalloonInfo on success
534 #
535 #          If the balloon driver is enabled but not functional because the KVM
536 #          kernel module cannot support it, KvmMissingCap
537 #
538 #          If no balloon device is present, DeviceNotActive
539 #
540 # Since: 0.14.0
541 #
542 # Example:
543 #
544 # -> { "execute": "query-balloon" }
545 # <- { "return": {
546 #          "actual": 1073741824,
547 #       }
548 #    }
549 #
550 ##
551 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
552
553 ##
554 # @PciMemoryRange:
555 #
556 # A PCI device memory region
557 #
558 # @base: the starting address (guest physical)
559 #
560 # @limit: the ending address (guest physical)
561 #
562 # Since: 0.14.0
563 ##
564 { 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
565
566 ##
567 # @PciMemoryRegion:
568 #
569 # Information about a PCI device I/O region.
570 #
571 # @bar: the index of the Base Address Register for this region
572 #
573 # @type: 'io' if the region is a PIO region
574 #        'memory' if the region is a MMIO region
575 #
576 # @size: memory size
577 #
578 # @prefetch: if @type is 'memory', true if the memory is prefetchable
579 #
580 # @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
581 #
582 # Since: 0.14.0
583 ##
584 { 'struct': 'PciMemoryRegion',
585   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
586            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
587
588 ##
589 # @PciBusInfo:
590 #
591 # Information about a bus of a PCI Bridge device
592 #
593 # @number: primary bus interface number.  This should be the number of the
594 #          bus the device resides on.
595 #
596 # @secondary: secondary bus interface number.  This is the number of the
597 #             main bus for the bridge
598 #
599 # @subordinate: This is the highest number bus that resides below the
600 #               bridge.
601 #
602 # @io_range: The PIO range for all devices on this bridge
603 #
604 # @memory_range: The MMIO range for all devices on this bridge
605 #
606 # @prefetchable_range: The range of prefetchable MMIO for all devices on
607 #                      this bridge
608 #
609 # Since: 2.4
610 ##
611 { 'struct': 'PciBusInfo',
612   'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
613            'io_range': 'PciMemoryRange',
614            'memory_range': 'PciMemoryRange',
615            'prefetchable_range': 'PciMemoryRange' } }
616
617 ##
618 # @PciBridgeInfo:
619 #
620 # Information about a PCI Bridge device
621 #
622 # @bus: information about the bus the device resides on
623 #
624 # @devices: a list of @PciDeviceInfo for each device on this bridge
625 #
626 # Since: 0.14.0
627 ##
628 { 'struct': 'PciBridgeInfo',
629   'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
630
631 ##
632 # @PciDeviceClass:
633 #
634 # Information about the Class of a PCI device
635 #
636 # @desc: a string description of the device's class
637 #
638 # @class: the class code of the device
639 #
640 # Since: 2.4
641 ##
642 { 'struct': 'PciDeviceClass',
643   'data': {'*desc': 'str', 'class': 'int'} }
644
645 ##
646 # @PciDeviceId:
647 #
648 # Information about the Id of a PCI device
649 #
650 # @device: the PCI device id
651 #
652 # @vendor: the PCI vendor id
653 #
654 # Since: 2.4
655 ##
656 { 'struct': 'PciDeviceId',
657   'data': {'device': 'int', 'vendor': 'int'} }
658
659 ##
660 # @PciDeviceInfo:
661 #
662 # Information about a PCI device
663 #
664 # @bus: the bus number of the device
665 #
666 # @slot: the slot the device is located in
667 #
668 # @function: the function of the slot used by the device
669 #
670 # @class_info: the class of the device
671 #
672 # @id: the PCI device id
673 #
674 # @irq: if an IRQ is assigned to the device, the IRQ number
675 #
676 # @qdev_id: the device name of the PCI device
677 #
678 # @pci_bridge: if the device is a PCI bridge, the bridge information
679 #
680 # @regions: a list of the PCI I/O regions associated with the device
681 #
682 # Notes: the contents of @class_info.desc are not stable and should only be
683 #        treated as informational.
684 #
685 # Since: 0.14.0
686 ##
687 { 'struct': 'PciDeviceInfo',
688   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
689            'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
690            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
691            'regions': ['PciMemoryRegion']} }
692
693 ##
694 # @PciInfo:
695 #
696 # Information about a PCI bus
697 #
698 # @bus: the bus index
699 #
700 # @devices: a list of devices on this bus
701 #
702 # Since: 0.14.0
703 ##
704 { 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
705
706 ##
707 # @query-pci:
708 #
709 # Return information about the PCI bus topology of the guest.
710 #
711 # Returns: a list of @PciInfo for each PCI bus. Each bus is
712 # represented by a json-object, which has a key with a json-array of
713 # all PCI devices attached to it. Each device is represented by a
714 # json-object.
715 #
716 # Since: 0.14.0
717 #
718 # Example:
719 #
720 # -> { "execute": "query-pci" }
721 # <- { "return": [
722 #          {
723 #             "bus": 0,
724 #             "devices": [
725 #                {
726 #                   "bus": 0,
727 #                   "qdev_id": "",
728 #                   "slot": 0,
729 #                   "class_info": {
730 #                      "class": 1536,
731 #                      "desc": "Host bridge"
732 #                   },
733 #                   "id": {
734 #                      "device": 32902,
735 #                      "vendor": 4663
736 #                   },
737 #                   "function": 0,
738 #                   "regions": [
739 #                   ]
740 #                },
741 #                {
742 #                   "bus": 0,
743 #                   "qdev_id": "",
744 #                   "slot": 1,
745 #                   "class_info": {
746 #                      "class": 1537,
747 #                      "desc": "ISA bridge"
748 #                   },
749 #                   "id": {
750 #                      "device": 32902,
751 #                      "vendor": 28672
752 #                   },
753 #                   "function": 0,
754 #                   "regions": [
755 #                   ]
756 #                },
757 #                {
758 #                   "bus": 0,
759 #                   "qdev_id": "",
760 #                   "slot": 1,
761 #                   "class_info": {
762 #                      "class": 257,
763 #                      "desc": "IDE controller"
764 #                   },
765 #                   "id": {
766 #                      "device": 32902,
767 #                      "vendor": 28688
768 #                   },
769 #                   "function": 1,
770 #                   "regions": [
771 #                      {
772 #                         "bar": 4,
773 #                         "size": 16,
774 #                         "address": 49152,
775 #                         "type": "io"
776 #                      }
777 #                   ]
778 #                },
779 #                {
780 #                   "bus": 0,
781 #                   "qdev_id": "",
782 #                   "slot": 2,
783 #                   "class_info": {
784 #                      "class": 768,
785 #                      "desc": "VGA controller"
786 #                   },
787 #                   "id": {
788 #                      "device": 4115,
789 #                      "vendor": 184
790 #                   },
791 #                   "function": 0,
792 #                   "regions": [
793 #                      {
794 #                         "prefetch": true,
795 #                         "mem_type_64": false,
796 #                         "bar": 0,
797 #                         "size": 33554432,
798 #                         "address": 4026531840,
799 #                         "type": "memory"
800 #                      },
801 #                      {
802 #                         "prefetch": false,
803 #                         "mem_type_64": false,
804 #                         "bar": 1,
805 #                         "size": 4096,
806 #                         "address": 4060086272,
807 #                         "type": "memory"
808 #                      },
809 #                      {
810 #                         "prefetch": false,
811 #                         "mem_type_64": false,
812 #                         "bar": 6,
813 #                         "size": 65536,
814 #                         "address": -1,
815 #                         "type": "memory"
816 #                      }
817 #                   ]
818 #                },
819 #                {
820 #                   "bus": 0,
821 #                   "qdev_id": "",
822 #                   "irq": 11,
823 #                   "slot": 4,
824 #                   "class_info": {
825 #                      "class": 1280,
826 #                      "desc": "RAM controller"
827 #                   },
828 #                   "id": {
829 #                      "device": 6900,
830 #                      "vendor": 4098
831 #                   },
832 #                   "function": 0,
833 #                   "regions": [
834 #                      {
835 #                         "bar": 0,
836 #                         "size": 32,
837 #                         "address": 49280,
838 #                         "type": "io"
839 #                      }
840 #                   ]
841 #                }
842 #             ]
843 #          }
844 #       ]
845 #    }
846 #
847 # Note: This example has been shortened as the real response is too long.
848 #
849 ##
850 { 'command': 'query-pci', 'returns': ['PciInfo'] }
851
852 ##
853 # @quit:
854 #
855 # This command will cause the QEMU process to exit gracefully.  While every
856 # attempt is made to send the QMP response before terminating, this is not
857 # guaranteed.  When using this interface, a premature EOF would not be
858 # unexpected.
859 #
860 # Since: 0.14.0
861 #
862 # Example:
863 #
864 # -> { "execute": "quit" }
865 # <- { "return": {} }
866 ##
867 { 'command': 'quit' }
868
869 ##
870 # @stop:
871 #
872 # Stop all guest VCPU execution.
873 #
874 # Since:  0.14.0
875 #
876 # Notes:  This function will succeed even if the guest is already in the stopped
877 #         state.  In "inmigrate" state, it will ensure that the guest
878 #         remains paused once migration finishes, as if the -S option was
879 #         passed on the command line.
880 #
881 # Example:
882 #
883 # -> { "execute": "stop" }
884 # <- { "return": {} }
885 #
886 ##
887 { 'command': 'stop' }
888
889 ##
890 # @system_reset:
891 #
892 # Performs a hard reset of a guest.
893 #
894 # Since: 0.14.0
895 #
896 # Example:
897 #
898 # -> { "execute": "system_reset" }
899 # <- { "return": {} }
900 #
901 ##
902 { 'command': 'system_reset' }
903
904 ##
905 # @system_powerdown:
906 #
907 # Requests that a guest perform a powerdown operation.
908 #
909 # Since: 0.14.0
910 #
911 # Notes: A guest may or may not respond to this command.  This command
912 #        returning does not indicate that a guest has accepted the request or
913 #        that it has shut down.  Many guests will respond to this command by
914 #        prompting the user in some way.
915 # Example:
916 #
917 # -> { "execute": "system_powerdown" }
918 # <- { "return": {} }
919 #
920 ##
921 { 'command': 'system_powerdown' }
922
923 ##
924 # @cpu:
925 #
926 # This command is a nop that is only provided for the purposes of compatibility.
927 #
928 # Since: 0.14.0
929 #
930 # Notes: Do not use this command.
931 ##
932 { 'command': 'cpu', 'data': {'index': 'int'} }
933
934 ##
935 # @cpu-add:
936 #
937 # Adds CPU with specified ID
938 #
939 # @id: ID of CPU to be created, valid values [0..max_cpus)
940 #
941 # Returns: Nothing on success
942 #
943 # Since: 1.5
944 #
945 # Example:
946 #
947 # -> { "execute": "cpu-add", "arguments": { "id": 2 } }
948 # <- { "return": {} }
949 #
950 ##
951 { 'command': 'cpu-add', 'data': {'id': 'int'} }
952
953 ##
954 # @memsave:
955 #
956 # Save a portion of guest memory to a file.
957 #
958 # @val: the virtual address of the guest to start from
959 #
960 # @size: the size of memory region to save
961 #
962 # @filename: the file to save the memory to as binary data
963 #
964 # @cpu-index: the index of the virtual CPU to use for translating the
965 #                       virtual address (defaults to CPU 0)
966 #
967 # Returns: Nothing on success
968 #
969 # Since: 0.14.0
970 #
971 # Notes: Errors were not reliably returned until 1.1
972 #
973 # Example:
974 #
975 # -> { "execute": "memsave",
976 #      "arguments": { "val": 10,
977 #                     "size": 100,
978 #                     "filename": "/tmp/virtual-mem-dump" } }
979 # <- { "return": {} }
980 #
981 ##
982 { 'command': 'memsave',
983   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
984
985 ##
986 # @pmemsave:
987 #
988 # Save a portion of guest physical memory to a file.
989 #
990 # @val: the physical address of the guest to start from
991 #
992 # @size: the size of memory region to save
993 #
994 # @filename: the file to save the memory to as binary data
995 #
996 # Returns: Nothing on success
997 #
998 # Since: 0.14.0
999 #
1000 # Notes: Errors were not reliably returned until 1.1
1001 #
1002 # Example:
1003 #
1004 # -> { "execute": "pmemsave",
1005 #      "arguments": { "val": 10,
1006 #                     "size": 100,
1007 #                     "filename": "/tmp/physical-mem-dump" } }
1008 # <- { "return": {} }
1009 #
1010 ##
1011 { 'command': 'pmemsave',
1012   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1013
1014 ##
1015 # @cont:
1016 #
1017 # Resume guest VCPU execution.
1018 #
1019 # Since:  0.14.0
1020 #
1021 # Returns:  If successful, nothing
1022 #
1023 # Notes:  This command will succeed if the guest is currently running.  It
1024 #         will also succeed if the guest is in the "inmigrate" state; in
1025 #         this case, the effect of the command is to make sure the guest
1026 #         starts once migration finishes, removing the effect of the -S
1027 #         command line option if it was passed.
1028 #
1029 # Example:
1030 #
1031 # -> { "execute": "cont" }
1032 # <- { "return": {} }
1033 #
1034 ##
1035 { 'command': 'cont' }
1036
1037 ##
1038 # @system_wakeup:
1039 #
1040 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1041 #
1042 # Since:  1.1
1043 #
1044 # Returns:  nothing.
1045 #
1046 # Example:
1047 #
1048 # -> { "execute": "system_wakeup" }
1049 # <- { "return": {} }
1050 #
1051 ##
1052 { 'command': 'system_wakeup' }
1053
1054 ##
1055 # @inject-nmi:
1056 #
1057 # Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
1058 # The command fails when the guest doesn't support injecting.
1059 #
1060 # Returns:  If successful, nothing
1061 #
1062 # Since:  0.14.0
1063 #
1064 # Note: prior to 2.1, this command was only supported for x86 and s390 VMs
1065 #
1066 # Example:
1067 #
1068 # -> { "execute": "inject-nmi" }
1069 # <- { "return": {} }
1070 #
1071 ##
1072 { 'command': 'inject-nmi' }
1073
1074 ##
1075 # @balloon:
1076 #
1077 # Request the balloon driver to change its balloon size.
1078 #
1079 # @value: the target size of the balloon in bytes
1080 #
1081 # Returns: Nothing on success
1082 #          If the balloon driver is enabled but not functional because the KVM
1083 #            kernel module cannot support it, KvmMissingCap
1084 #          If no balloon device is present, DeviceNotActive
1085 #
1086 # Notes: This command just issues a request to the guest.  When it returns,
1087 #        the balloon size may not have changed.  A guest can change the balloon
1088 #        size independent of this command.
1089 #
1090 # Since: 0.14.0
1091 #
1092 # Example:
1093 #
1094 # -> { "execute": "balloon", "arguments": { "value": 536870912 } }
1095 # <- { "return": {} }
1096 #
1097 ##
1098 { 'command': 'balloon', 'data': {'value': 'int'} }
1099
1100 ##
1101 # @human-monitor-command:
1102 #
1103 # Execute a command on the human monitor and return the output.
1104 #
1105 # @command-line: the command to execute in the human monitor
1106 #
1107 # @cpu-index: The CPU to use for commands that require an implicit CPU
1108 #
1109 # Returns: the output of the command as a string
1110 #
1111 # Since: 0.14.0
1112 #
1113 # Notes: This command only exists as a stop-gap.  Its use is highly
1114 #        discouraged.  The semantics of this command are not
1115 #        guaranteed: this means that command names, arguments and
1116 #        responses can change or be removed at ANY time.  Applications
1117 #        that rely on long term stability guarantees should NOT
1118 #        use this command.
1119 #
1120 #        Known limitations:
1121 #
1122 #        * This command is stateless, this means that commands that depend
1123 #          on state information (such as getfd) might not work
1124 #
1125 #        * Commands that prompt the user for data don't currently work
1126 #
1127 # Example:
1128 #
1129 # -> { "execute": "human-monitor-command",
1130 #      "arguments": { "command-line": "info kvm" } }
1131 # <- { "return": "kvm support: enabled\r\n" }
1132 #
1133 ##
1134 { 'command': 'human-monitor-command',
1135   'data': {'command-line': 'str', '*cpu-index': 'int'},
1136   'returns': 'str' }
1137
1138 ##
1139 # @ObjectPropertyInfo:
1140 #
1141 # @name: the name of the property
1142 #
1143 # @type: the type of the property.  This will typically come in one of four
1144 #        forms:
1145 #
1146 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1147 #           These types are mapped to the appropriate JSON type.
1148 #
1149 #        2) A child type in the form 'child<subtype>' where subtype is a qdev
1150 #           device type name.  Child properties create the composition tree.
1151 #
1152 #        3) A link type in the form 'link<subtype>' where subtype is a qdev
1153 #           device type name.  Link properties form the device model graph.
1154 #
1155 # Since: 1.2
1156 ##
1157 { 'struct': 'ObjectPropertyInfo',
1158   'data': { 'name': 'str', 'type': 'str' } }
1159
1160 ##
1161 # @qom-list:
1162 #
1163 # This command will list any properties of a object given a path in the object
1164 # model.
1165 #
1166 # @path: the path within the object model.  See @qom-get for a description of
1167 #        this parameter.
1168 #
1169 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1170 #          object.
1171 #
1172 # Since: 1.2
1173 ##
1174 { 'command': 'qom-list',
1175   'data': { 'path': 'str' },
1176   'returns': [ 'ObjectPropertyInfo' ] }
1177
1178 ##
1179 # @qom-get:
1180 #
1181 # This command will get a property from a object model path and return the
1182 # value.
1183 #
1184 # @path: The path within the object model.  There are two forms of supported
1185 #        paths--absolute and partial paths.
1186 #
1187 #        Absolute paths are derived from the root object and can follow child<>
1188 #        or link<> properties.  Since they can follow link<> properties, they
1189 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1190 #        and are prefixed  with a leading slash.
1191 #
1192 #        Partial paths look like relative filenames.  They do not begin
1193 #        with a prefix.  The matching rules for partial paths are subtle but
1194 #        designed to make specifying objects easy.  At each level of the
1195 #        composition tree, the partial path is matched as an absolute path.
1196 #        The first match is not returned.  At least two matches are searched
1197 #        for.  A successful result is only returned if only one match is
1198 #        found.  If more than one match is found, a flag is return to
1199 #        indicate that the match was ambiguous.
1200 #
1201 # @property: The property name to read
1202 #
1203 # Returns: The property value.  The type depends on the property
1204 #          type. child<> and link<> properties are returned as #str
1205 #          pathnames.  All integer property types (u8, u16, etc) are
1206 #          returned as #int.
1207 #
1208 # Since: 1.2
1209 ##
1210 { 'command': 'qom-get',
1211   'data': { 'path': 'str', 'property': 'str' },
1212   'returns': 'any' }
1213
1214 ##
1215 # @qom-set:
1216 #
1217 # This command will set a property from a object model path.
1218 #
1219 # @path: see @qom-get for a description of this parameter
1220 #
1221 # @property: the property name to set
1222 #
1223 # @value: a value who's type is appropriate for the property type.  See @qom-get
1224 #         for a description of type mapping.
1225 #
1226 # Since: 1.2
1227 ##
1228 { 'command': 'qom-set',
1229   'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
1230
1231 ##
1232 # @change:
1233 #
1234 # This command is multiple commands multiplexed together.
1235 #
1236 # @device: This is normally the name of a block device but it may also be 'vnc'.
1237 #          when it's 'vnc', then sub command depends on @target
1238 #
1239 # @target: If @device is a block device, then this is the new filename.
1240 #          If @device is 'vnc', then if the value 'password' selects the vnc
1241 #          change password command.   Otherwise, this specifies a new server URI
1242 #          address to listen to for VNC connections.
1243 #
1244 # @arg:    If @device is a block device, then this is an optional format to open
1245 #          the device with.
1246 #          If @device is 'vnc' and @target is 'password', this is the new VNC
1247 #          password to set.  See change-vnc-password for additional notes.
1248 #
1249 # Returns: Nothing on success.
1250 #          If @device is not a valid block device, DeviceNotFound
1251 #
1252 # Notes:  This interface is deprecated, and it is strongly recommended that you
1253 #         avoid using it.  For changing block devices, use
1254 #         blockdev-change-medium; for changing VNC parameters, use
1255 #         change-vnc-password.
1256 #
1257 # Since: 0.14.0
1258 #
1259 # Example:
1260 #
1261 # 1. Change a removable medium
1262 #
1263 # -> { "execute": "change",
1264 #      "arguments": { "device": "ide1-cd0",
1265 #                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
1266 # <- { "return": {} }
1267 #
1268 # 2. Change VNC password
1269 #
1270 # -> { "execute": "change",
1271 #      "arguments": { "device": "vnc", "target": "password",
1272 #                     "arg": "foobar1" } }
1273 # <- { "return": {} }
1274 #
1275 ##
1276 { 'command': 'change',
1277   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1278
1279 ##
1280 # @ObjectTypeInfo:
1281 #
1282 # This structure describes a search result from @qom-list-types
1283 #
1284 # @name: the type name found in the search
1285 #
1286 # @abstract: the type is abstract and can't be directly instantiated.
1287 #            Omitted if false. (since 2.10)
1288 #
1289 # @parent: Name of parent type, if any (since 2.10)
1290 #
1291 # Since: 1.1
1292 ##
1293 { 'struct': 'ObjectTypeInfo',
1294   'data': { 'name': 'str', '*abstract': 'bool', '*parent': 'str' } }
1295
1296 ##
1297 # @qom-list-types:
1298 #
1299 # This command will return a list of types given search parameters
1300 #
1301 # @implements: if specified, only return types that implement this type name
1302 #
1303 # @abstract: if true, include abstract types in the results
1304 #
1305 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1306 #
1307 # Since: 1.1
1308 ##
1309 { 'command': 'qom-list-types',
1310   'data': { '*implements': 'str', '*abstract': 'bool' },
1311   'returns': [ 'ObjectTypeInfo' ] }
1312
1313 ##
1314 # @DevicePropertyInfo:
1315 #
1316 # Information about device properties.
1317 #
1318 # @name: the name of the property
1319 # @type: the typename of the property
1320 # @description: if specified, the description of the property.
1321 #               (since 2.2)
1322 #
1323 # Since: 1.2
1324 ##
1325 { 'struct': 'DevicePropertyInfo',
1326   'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1327
1328 ##
1329 # @device-list-properties:
1330 #
1331 # List properties associated with a device.
1332 #
1333 # @typename: the type name of a device
1334 #
1335 # Returns: a list of DevicePropertyInfo describing a devices properties
1336 #
1337 # Since: 1.2
1338 ##
1339 { 'command': 'device-list-properties',
1340   'data': { 'typename': 'str'},
1341   'returns': [ 'DevicePropertyInfo' ] }
1342
1343 ##
1344 # @xen-set-global-dirty-log:
1345 #
1346 # Enable or disable the global dirty log mode.
1347 #
1348 # @enable: true to enable, false to disable.
1349 #
1350 # Returns: nothing
1351 #
1352 # Since: 1.3
1353 #
1354 # Example:
1355 #
1356 # -> { "execute": "xen-set-global-dirty-log",
1357 #      "arguments": { "enable": true } }
1358 # <- { "return": {} }
1359 #
1360 ##
1361 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
1362
1363 ##
1364 # @device_add:
1365 #
1366 # @driver: the name of the new device's driver
1367 #
1368 # @bus: the device's parent bus (device tree path)
1369 #
1370 # @id: the device's ID, must be unique
1371 #
1372 # Additional arguments depend on the type.
1373 #
1374 # Add a device.
1375 #
1376 # Notes:
1377 # 1. For detailed information about this command, please refer to the
1378 #    'docs/qdev-device-use.txt' file.
1379 #
1380 # 2. It's possible to list device properties by running QEMU with the
1381 #    "-device DEVICE,help" command-line argument, where DEVICE is the
1382 #    device's name
1383 #
1384 # Example:
1385 #
1386 # -> { "execute": "device_add",
1387 #      "arguments": { "driver": "e1000", "id": "net1",
1388 #                     "bus": "pci.0",
1389 #                     "mac": "52:54:00:12:34:56" } }
1390 # <- { "return": {} }
1391 #
1392 # TODO: This command effectively bypasses QAPI completely due to its
1393 # "additional arguments" business.  It shouldn't have been added to
1394 # the schema in this form.  It should be qapified properly, or
1395 # replaced by a properly qapified command.
1396 #
1397 # Since: 0.13
1398 ##
1399 { 'command': 'device_add',
1400   'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
1401   'gen': false } # so we can get the additional arguments
1402
1403 ##
1404 # @device_del:
1405 #
1406 # Remove a device from a guest
1407 #
1408 # @id: the device's ID or QOM path
1409 #
1410 # Returns: Nothing on success
1411 #          If @id is not a valid device, DeviceNotFound
1412 #
1413 # Notes: When this command completes, the device may not be removed from the
1414 #        guest.  Hot removal is an operation that requires guest cooperation.
1415 #        This command merely requests that the guest begin the hot removal
1416 #        process.  Completion of the device removal process is signaled with a
1417 #        DEVICE_DELETED event. Guest reset will automatically complete removal
1418 #        for all devices.
1419 #
1420 # Since: 0.14.0
1421 #
1422 # Example:
1423 #
1424 # -> { "execute": "device_del",
1425 #      "arguments": { "id": "net1" } }
1426 # <- { "return": {} }
1427 #
1428 # -> { "execute": "device_del",
1429 #      "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
1430 # <- { "return": {} }
1431 #
1432 ##
1433 { 'command': 'device_del', 'data': {'id': 'str'} }
1434
1435 ##
1436 # @DumpGuestMemoryFormat:
1437 #
1438 # An enumeration of guest-memory-dump's format.
1439 #
1440 # @elf: elf format
1441 #
1442 # @kdump-zlib: kdump-compressed format with zlib-compressed
1443 #
1444 # @kdump-lzo: kdump-compressed format with lzo-compressed
1445 #
1446 # @kdump-snappy: kdump-compressed format with snappy-compressed
1447 #
1448 # Since: 2.0
1449 ##
1450 { 'enum': 'DumpGuestMemoryFormat',
1451   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
1452
1453 ##
1454 # @dump-guest-memory:
1455 #
1456 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1457 # very long depending on the amount of guest memory.
1458 #
1459 # @paging: if true, do paging to get guest's memory mapping. This allows
1460 #          using gdb to process the core file.
1461 #
1462 #          IMPORTANT: this option can make QEMU allocate several gigabytes
1463 #                     of RAM. This can happen for a large guest, or a
1464 #                     malicious guest pretending to be large.
1465 #
1466 #          Also, paging=true has the following limitations:
1467 #
1468 #             1. The guest may be in a catastrophic state or can have corrupted
1469 #                memory, which cannot be trusted
1470 #             2. The guest can be in real-mode even if paging is enabled. For
1471 #                example, the guest uses ACPI to sleep, and ACPI sleep state
1472 #                goes in real-mode
1473 #             3. Currently only supported on i386 and x86_64.
1474 #
1475 # @protocol: the filename or file descriptor of the vmcore. The supported
1476 #            protocols are:
1477 #
1478 #            1. file: the protocol starts with "file:", and the following
1479 #               string is the file's path.
1480 #            2. fd: the protocol starts with "fd:", and the following string
1481 #               is the fd's name.
1482 #
1483 # @detach: if true, QMP will return immediately rather than
1484 #          waiting for the dump to finish. The user can track progress
1485 #          using "query-dump". (since 2.6).
1486 #
1487 # @begin: if specified, the starting physical address.
1488 #
1489 # @length: if specified, the memory size, in bytes. If you don't
1490 #          want to dump all guest's memory, please specify the start @begin
1491 #          and @length
1492 #
1493 # @format: if specified, the format of guest memory dump. But non-elf
1494 #          format is conflict with paging and filter, ie. @paging, @begin and
1495 #          @length is not allowed to be specified with non-elf @format at the
1496 #          same time (since 2.0)
1497 #
1498 # Note: All boolean arguments default to false
1499 #
1500 # Returns: nothing on success
1501 #
1502 # Since: 1.2
1503 #
1504 # Example:
1505 #
1506 # -> { "execute": "dump-guest-memory",
1507 #      "arguments": { "protocol": "fd:dump" } }
1508 # <- { "return": {} }
1509 #
1510 ##
1511 { 'command': 'dump-guest-memory',
1512   'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
1513             '*begin': 'int', '*length': 'int',
1514             '*format': 'DumpGuestMemoryFormat'} }
1515
1516 ##
1517 # @DumpStatus:
1518 #
1519 # Describe the status of a long-running background guest memory dump.
1520 #
1521 # @none: no dump-guest-memory has started yet.
1522 #
1523 # @active: there is one dump running in background.
1524 #
1525 # @completed: the last dump has finished successfully.
1526 #
1527 # @failed: the last dump has failed.
1528 #
1529 # Since: 2.6
1530 ##
1531 { 'enum': 'DumpStatus',
1532   'data': [ 'none', 'active', 'completed', 'failed' ] }
1533
1534 ##
1535 # @DumpQueryResult:
1536 #
1537 # The result format for 'query-dump'.
1538 #
1539 # @status: enum of @DumpStatus, which shows current dump status
1540 #
1541 # @completed: bytes written in latest dump (uncompressed)
1542 #
1543 # @total: total bytes to be written in latest dump (uncompressed)
1544 #
1545 # Since: 2.6
1546 ##
1547 { 'struct': 'DumpQueryResult',
1548   'data': { 'status': 'DumpStatus',
1549             'completed': 'int',
1550             'total': 'int' } }
1551
1552 ##
1553 # @query-dump:
1554 #
1555 # Query latest dump status.
1556 #
1557 # Returns: A @DumpStatus object showing the dump status.
1558 #
1559 # Since: 2.6
1560 #
1561 # Example:
1562 #
1563 # -> { "execute": "query-dump" }
1564 # <- { "return": { "status": "active", "completed": 1024000,
1565 #                  "total": 2048000 } }
1566 #
1567 ##
1568 { 'command': 'query-dump', 'returns': 'DumpQueryResult' }
1569
1570 ##
1571 # @DumpGuestMemoryCapability:
1572 #
1573 # A list of the available formats for dump-guest-memory
1574 #
1575 # Since: 2.0
1576 ##
1577 { 'struct': 'DumpGuestMemoryCapability',
1578   'data': {
1579       'formats': ['DumpGuestMemoryFormat'] } }
1580
1581 ##
1582 # @query-dump-guest-memory-capability:
1583 #
1584 # Returns the available formats for dump-guest-memory
1585 #
1586 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
1587 #           dump-guest-memory
1588 #
1589 # Since: 2.0
1590 #
1591 # Example:
1592 #
1593 # -> { "execute": "query-dump-guest-memory-capability" }
1594 # <- { "return": { "formats":
1595 #                  ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
1596 #
1597 ##
1598 { 'command': 'query-dump-guest-memory-capability',
1599   'returns': 'DumpGuestMemoryCapability' }
1600
1601 ##
1602 # @dump-skeys:
1603 #
1604 # Dump guest's storage keys
1605 #
1606 # @filename: the path to the file to dump to
1607 #
1608 # This command is only supported on s390 architecture.
1609 #
1610 # Since: 2.5
1611 #
1612 # Example:
1613 #
1614 # -> { "execute": "dump-skeys",
1615 #      "arguments": { "filename": "/tmp/skeys" } }
1616 # <- { "return": {} }
1617 #
1618 ##
1619 { 'command': 'dump-skeys',
1620   'data': { 'filename': 'str' } }
1621
1622 ##
1623 # @object-add:
1624 #
1625 # Create a QOM object.
1626 #
1627 # @qom-type: the class name for the object to be created
1628 #
1629 # @id: the name of the new object
1630 #
1631 # @props: a dictionary of properties to be passed to the backend
1632 #
1633 # Returns: Nothing on success
1634 #          Error if @qom-type is not a valid class name
1635 #
1636 # Since: 2.0
1637 #
1638 # Example:
1639 #
1640 # -> { "execute": "object-add",
1641 #      "arguments": { "qom-type": "rng-random", "id": "rng1",
1642 #                     "props": { "filename": "/dev/hwrng" } } }
1643 # <- { "return": {} }
1644 #
1645 ##
1646 { 'command': 'object-add',
1647   'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
1648
1649 ##
1650 # @object-del:
1651 #
1652 # Remove a QOM object.
1653 #
1654 # @id: the name of the QOM object to remove
1655 #
1656 # Returns: Nothing on success
1657 #          Error if @id is not a valid id for a QOM object
1658 #
1659 # Since: 2.0
1660 #
1661 # Example:
1662 #
1663 # -> { "execute": "object-del", "arguments": { "id": "rng1" } }
1664 # <- { "return": {} }
1665 #
1666 ##
1667 { 'command': 'object-del', 'data': {'id': 'str'} }
1668
1669 ##
1670 # @getfd:
1671 #
1672 # Receive a file descriptor via SCM rights and assign it a name
1673 #
1674 # @fdname: file descriptor name
1675 #
1676 # Returns: Nothing on success
1677 #
1678 # Since: 0.14.0
1679 #
1680 # Notes: If @fdname already exists, the file descriptor assigned to
1681 #        it will be closed and replaced by the received file
1682 #        descriptor.
1683 #
1684 #        The 'closefd' command can be used to explicitly close the
1685 #        file descriptor when it is no longer needed.
1686 #
1687 # Example:
1688 #
1689 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
1690 # <- { "return": {} }
1691 #
1692 ##
1693 { 'command': 'getfd', 'data': {'fdname': 'str'} }
1694
1695 ##
1696 # @closefd:
1697 #
1698 # Close a file descriptor previously passed via SCM rights
1699 #
1700 # @fdname: file descriptor name
1701 #
1702 # Returns: Nothing on success
1703 #
1704 # Since: 0.14.0
1705 #
1706 # Example:
1707 #
1708 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
1709 # <- { "return": {} }
1710 #
1711 ##
1712 { 'command': 'closefd', 'data': {'fdname': 'str'} }
1713
1714 ##
1715 # @MachineInfo:
1716 #
1717 # Information describing a machine.
1718 #
1719 # @name: the name of the machine
1720 #
1721 # @alias: an alias for the machine name
1722 #
1723 # @is-default: whether the machine is default
1724 #
1725 # @cpu-max: maximum number of CPUs supported by the machine type
1726 #           (since 1.5.0)
1727 #
1728 # @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
1729 #
1730 # Since: 1.2.0
1731 ##
1732 { 'struct': 'MachineInfo',
1733   'data': { 'name': 'str', '*alias': 'str',
1734             '*is-default': 'bool', 'cpu-max': 'int',
1735             'hotpluggable-cpus': 'bool'} }
1736
1737 ##
1738 # @query-machines:
1739 #
1740 # Return a list of supported machines
1741 #
1742 # Returns: a list of MachineInfo
1743 #
1744 # Since: 1.2.0
1745 ##
1746 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
1747
1748 ##
1749 # @CpuDefinitionInfo:
1750 #
1751 # Virtual CPU definition.
1752 #
1753 # @name: the name of the CPU definition
1754 #
1755 # @migration-safe: whether a CPU definition can be safely used for
1756 #                  migration in combination with a QEMU compatibility machine
1757 #                  when migrating between different QMU versions and between
1758 #                  hosts with different sets of (hardware or software)
1759 #                  capabilities. If not provided, information is not available
1760 #                  and callers should not assume the CPU definition to be
1761 #                  migration-safe. (since 2.8)
1762 #
1763 # @static: whether a CPU definition is static and will not change depending on
1764 #          QEMU version, machine type, machine options and accelerator options.
1765 #          A static model is always migration-safe. (since 2.8)
1766 #
1767 # @unavailable-features: List of properties that prevent
1768 #                        the CPU model from running in the current
1769 #                        host. (since 2.8)
1770 # @typename: Type name that can be used as argument to @device-list-properties,
1771 #            to introspect properties configurable using -cpu or -global.
1772 #            (since 2.9)
1773 #
1774 # @unavailable-features is a list of QOM property names that
1775 # represent CPU model attributes that prevent the CPU from running.
1776 # If the QOM property is read-only, that means there's no known
1777 # way to make the CPU model run in the current host. Implementations
1778 # that choose not to provide specific information return the
1779 # property name "type".
1780 # If the property is read-write, it means that it MAY be possible
1781 # to run the CPU model in the current host if that property is
1782 # changed. Management software can use it as hints to suggest or
1783 # choose an alternative for the user, or just to generate meaningful
1784 # error messages explaining why the CPU model can't be used.
1785 # If @unavailable-features is an empty list, the CPU model is
1786 # runnable using the current host and machine-type.
1787 # If @unavailable-features is not present, runnability
1788 # information for the CPU is not available.
1789 #
1790 # Since: 1.2.0
1791 ##
1792 { 'struct': 'CpuDefinitionInfo',
1793   'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
1794             '*unavailable-features': [ 'str' ], 'typename': 'str' } }
1795
1796 ##
1797 # @query-cpu-definitions:
1798 #
1799 # Return a list of supported virtual CPU definitions
1800 #
1801 # Returns: a list of CpuDefInfo
1802 #
1803 # Since: 1.2.0
1804 ##
1805 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
1806
1807 ##
1808 # @CpuModelInfo:
1809 #
1810 # Virtual CPU model.
1811 #
1812 # A CPU model consists of the name of a CPU definition, to which
1813 # delta changes are applied (e.g. features added/removed). Most magic values
1814 # that an architecture might require should be hidden behind the name.
1815 # However, if required, architectures can expose relevant properties.
1816 #
1817 # @name: the name of the CPU definition the model is based on
1818 # @props: a dictionary of QOM properties to be applied
1819 #
1820 # Since: 2.8.0
1821 ##
1822 { 'struct': 'CpuModelInfo',
1823   'data': { 'name': 'str',
1824             '*props': 'any' } }
1825
1826 ##
1827 # @CpuModelExpansionType:
1828 #
1829 # An enumeration of CPU model expansion types.
1830 #
1831 # @static: Expand to a static CPU model, a combination of a static base
1832 #          model name and property delta changes. As the static base model will
1833 #          never change, the expanded CPU model will be the same, independant of
1834 #          independent of QEMU version, machine type, machine options, and
1835 #          accelerator options. Therefore, the resulting model can be used by
1836 #          tooling without having to specify a compatibility machine - e.g. when
1837 #          displaying the "host" model. static CPU models are migration-safe.
1838 #
1839 # @full: Expand all properties. The produced model is not guaranteed to be
1840 #        migration-safe, but allows tooling to get an insight and work with
1841 #        model details.
1842 #
1843 # Note: When a non-migration-safe CPU model is expanded in static mode, some
1844 # features enabled by the CPU model may be omitted, because they can't be
1845 # implemented by a static CPU model definition (e.g. cache info passthrough and
1846 # PMU passthrough in x86). If you need an accurate representation of the
1847 # features enabled by a non-migration-safe CPU model, use @full. If you need a
1848 # static representation that will keep ABI compatibility even when changing QEMU
1849 # version or machine-type, use @static (but keep in mind that some features may
1850 # be omitted).
1851 #
1852 # Since: 2.8.0
1853 ##
1854 { 'enum': 'CpuModelExpansionType',
1855   'data': [ 'static', 'full' ] }
1856
1857
1858 ##
1859 # @CpuModelExpansionInfo:
1860 #
1861 # The result of a cpu model expansion.
1862 #
1863 # @model: the expanded CpuModelInfo.
1864 #
1865 # Since: 2.8.0
1866 ##
1867 { 'struct': 'CpuModelExpansionInfo',
1868   'data': { 'model': 'CpuModelInfo' } }
1869
1870
1871 ##
1872 # @query-cpu-model-expansion:
1873 #
1874 # Expands a given CPU model (or a combination of CPU model + additional options)
1875 # to different granularities, allowing tooling to get an understanding what a
1876 # specific CPU model looks like in QEMU under a certain configuration.
1877 #
1878 # This interface can be used to query the "host" CPU model.
1879 #
1880 # The data returned by this command may be affected by:
1881 #
1882 # * QEMU version: CPU models may look different depending on the QEMU version.
1883 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
1884 # * machine-type: CPU model  may look different depending on the machine-type.
1885 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
1886 # * machine options (including accelerator): in some architectures, CPU models
1887 #   may look different depending on machine and accelerator options. (Except for
1888 #   CPU models reported as "static" in query-cpu-definitions.)
1889 # * "-cpu" arguments and global properties: arguments to the -cpu option and
1890 #   global properties may affect expansion of CPU models. Using
1891 #   query-cpu-model-expansion while using these is not advised.
1892 #
1893 # Some architectures may not support all expansion types. s390x supports
1894 # "full" and "static".
1895 #
1896 # Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
1897 #          not supported, if the model cannot be expanded, if the model contains
1898 #          an unknown CPU definition name, unknown properties or properties
1899 #          with a wrong type. Also returns an error if an expansion type is
1900 #          not supported.
1901 #
1902 # Since: 2.8.0
1903 ##
1904 { 'command': 'query-cpu-model-expansion',
1905   'data': { 'type': 'CpuModelExpansionType',
1906             'model': 'CpuModelInfo' },
1907   'returns': 'CpuModelExpansionInfo' }
1908
1909 ##
1910 # @CpuModelCompareResult:
1911 #
1912 # An enumeration of CPU model comparation results. The result is usually
1913 # calculated using e.g. CPU features or CPU generations.
1914 #
1915 # @incompatible: If model A is incompatible to model B, model A is not
1916 #                guaranteed to run where model B runs and the other way around.
1917 #
1918 # @identical: If model A is identical to model B, model A is guaranteed to run
1919 #             where model B runs and the other way around.
1920 #
1921 # @superset: If model A is a superset of model B, model B is guaranteed to run
1922 #            where model A runs. There are no guarantees about the other way.
1923 #
1924 # @subset: If model A is a subset of model B, model A is guaranteed to run
1925 #          where model B runs. There are no guarantees about the other way.
1926 #
1927 # Since: 2.8.0
1928 ##
1929 { 'enum': 'CpuModelCompareResult',
1930   'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
1931
1932 ##
1933 # @CpuModelCompareInfo:
1934 #
1935 # The result of a CPU model comparison.
1936 #
1937 # @result: The result of the compare operation.
1938 # @responsible-properties: List of properties that led to the comparison result
1939 #                          not being identical.
1940 #
1941 # @responsible-properties is a list of QOM property names that led to
1942 # both CPUs not being detected as identical. For identical models, this
1943 # list is empty.
1944 # If a QOM property is read-only, that means there's no known way to make the
1945 # CPU models identical. If the special property name "type" is included, the
1946 # models are by definition not identical and cannot be made identical.
1947 #
1948 # Since: 2.8.0
1949 ##
1950 { 'struct': 'CpuModelCompareInfo',
1951   'data': {'result': 'CpuModelCompareResult',
1952            'responsible-properties': ['str']
1953           }
1954 }
1955
1956 ##
1957 # @query-cpu-model-comparison:
1958 #
1959 # Compares two CPU models, returning how they compare in a specific
1960 # configuration. The results indicates how both models compare regarding
1961 # runnability. This result can be used by tooling to make decisions if a
1962 # certain CPU model will run in a certain configuration or if a compatible
1963 # CPU model has to be created by baselining.
1964 #
1965 # Usually, a CPU model is compared against the maximum possible CPU model
1966 # of a certain configuration (e.g. the "host" model for KVM). If that CPU
1967 # model is identical or a subset, it will run in that configuration.
1968 #
1969 # The result returned by this command may be affected by:
1970 #
1971 # * QEMU version: CPU models may look different depending on the QEMU version.
1972 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
1973 # * machine-type: CPU model may look different depending on the machine-type.
1974 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
1975 # * machine options (including accelerator): in some architectures, CPU models
1976 #   may look different depending on machine and accelerator options. (Except for
1977 #   CPU models reported as "static" in query-cpu-definitions.)
1978 # * "-cpu" arguments and global properties: arguments to the -cpu option and
1979 #   global properties may affect expansion of CPU models. Using
1980 #   query-cpu-model-expansion while using these is not advised.
1981 #
1982 # Some architectures may not support comparing CPU models. s390x supports
1983 # comparing CPU models.
1984 #
1985 # Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
1986 #          not supported, if a model cannot be used, if a model contains
1987 #          an unknown cpu definition name, unknown properties or properties
1988 #          with wrong types.
1989 #
1990 # Since: 2.8.0
1991 ##
1992 { 'command': 'query-cpu-model-comparison',
1993   'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
1994   'returns': 'CpuModelCompareInfo' }
1995
1996 ##
1997 # @CpuModelBaselineInfo:
1998 #
1999 # The result of a CPU model baseline.
2000 #
2001 # @model: the baselined CpuModelInfo.
2002 #
2003 # Since: 2.8.0
2004 ##
2005 { 'struct': 'CpuModelBaselineInfo',
2006   'data': { 'model': 'CpuModelInfo' } }
2007
2008 ##
2009 # @query-cpu-model-baseline:
2010 #
2011 # Baseline two CPU models, creating a compatible third model. The created
2012 # model will always be a static, migration-safe CPU model (see "static"
2013 # CPU model expansion for details).
2014 #
2015 # This interface can be used by tooling to create a compatible CPU model out
2016 # two CPU models. The created CPU model will be identical to or a subset of
2017 # both CPU models when comparing them. Therefore, the created CPU model is
2018 # guaranteed to run where the given CPU models run.
2019 #
2020 # The result returned by this command may be affected by:
2021 #
2022 # * QEMU version: CPU models may look different depending on the QEMU version.
2023 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2024 # * machine-type: CPU model may look different depending on the machine-type.
2025 #   (Except for CPU models reported as "static" in query-cpu-definitions.)
2026 # * machine options (including accelerator): in some architectures, CPU models
2027 #   may look different depending on machine and accelerator options. (Except for
2028 #   CPU models reported as "static" in query-cpu-definitions.)
2029 # * "-cpu" arguments and global properties: arguments to the -cpu option and
2030 #   global properties may affect expansion of CPU models. Using
2031 #   query-cpu-model-expansion while using these is not advised.
2032 #
2033 # Some architectures may not support baselining CPU models. s390x supports
2034 # baselining CPU models.
2035 #
2036 # Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
2037 #          not supported, if a model cannot be used, if a model contains
2038 #          an unknown cpu definition name, unknown properties or properties
2039 #          with wrong types.
2040 #
2041 # Since: 2.8.0
2042 ##
2043 { 'command': 'query-cpu-model-baseline',
2044   'data': { 'modela': 'CpuModelInfo',
2045             'modelb': 'CpuModelInfo' },
2046   'returns': 'CpuModelBaselineInfo' }
2047
2048 ##
2049 # @AddfdInfo:
2050 #
2051 # Information about a file descriptor that was added to an fd set.
2052 #
2053 # @fdset-id: The ID of the fd set that @fd was added to.
2054 #
2055 # @fd: The file descriptor that was received via SCM rights and
2056 #      added to the fd set.
2057 #
2058 # Since: 1.2.0
2059 ##
2060 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2061
2062 ##
2063 # @add-fd:
2064 #
2065 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2066 #
2067 # @fdset-id: The ID of the fd set to add the file descriptor to.
2068 #
2069 # @opaque: A free-form string that can be used to describe the fd.
2070 #
2071 # Returns: @AddfdInfo on success
2072 #
2073 #          If file descriptor was not received, FdNotSupplied
2074 #
2075 #          If @fdset-id is a negative value, InvalidParameterValue
2076 #
2077 # Notes: The list of fd sets is shared by all monitor connections.
2078 #
2079 #        If @fdset-id is not specified, a new fd set will be created.
2080 #
2081 # Since: 1.2.0
2082 #
2083 # Example:
2084 #
2085 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
2086 # <- { "return": { "fdset-id": 1, "fd": 3 } }
2087 #
2088 ##
2089 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2090   'returns': 'AddfdInfo' }
2091
2092 ##
2093 # @remove-fd:
2094 #
2095 # Remove a file descriptor from an fd set.
2096 #
2097 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2098 #
2099 # @fd: The file descriptor that is to be removed.
2100 #
2101 # Returns: Nothing on success
2102 #          If @fdset-id or @fd is not found, FdNotFound
2103 #
2104 # Since: 1.2.0
2105 #
2106 # Notes: The list of fd sets is shared by all monitor connections.
2107 #
2108 #        If @fd is not specified, all file descriptors in @fdset-id
2109 #        will be removed.
2110 #
2111 # Example:
2112 #
2113 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
2114 # <- { "return": {} }
2115 #
2116 ##
2117 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2118
2119 ##
2120 # @FdsetFdInfo:
2121 #
2122 # Information about a file descriptor that belongs to an fd set.
2123 #
2124 # @fd: The file descriptor value.
2125 #
2126 # @opaque: A free-form string that can be used to describe the fd.
2127 #
2128 # Since: 1.2.0
2129 ##
2130 { 'struct': 'FdsetFdInfo',
2131   'data': {'fd': 'int', '*opaque': 'str'} }
2132
2133 ##
2134 # @FdsetInfo:
2135 #
2136 # Information about an fd set.
2137 #
2138 # @fdset-id: The ID of the fd set.
2139 #
2140 # @fds: A list of file descriptors that belong to this fd set.
2141 #
2142 # Since: 1.2.0
2143 ##
2144 { 'struct': 'FdsetInfo',
2145   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2146
2147 ##
2148 # @query-fdsets:
2149 #
2150 # Return information describing all fd sets.
2151 #
2152 # Returns: A list of @FdsetInfo
2153 #
2154 # Since: 1.2.0
2155 #
2156 # Note: The list of fd sets is shared by all monitor connections.
2157 #
2158 # Example:
2159 #
2160 # -> { "execute": "query-fdsets" }
2161 # <- { "return": [
2162 #        {
2163 #          "fds": [
2164 #            {
2165 #              "fd": 30,
2166 #              "opaque": "rdonly:/path/to/file"
2167 #            },
2168 #            {
2169 #              "fd": 24,
2170 #              "opaque": "rdwr:/path/to/file"
2171 #            }
2172 #          ],
2173 #          "fdset-id": 1
2174 #        },
2175 #        {
2176 #          "fds": [
2177 #            {
2178 #              "fd": 28
2179 #            },
2180 #            {
2181 #              "fd": 29
2182 #            }
2183 #          ],
2184 #          "fdset-id": 0
2185 #        }
2186 #      ]
2187 #    }
2188 #
2189 ##
2190 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
2191
2192 ##
2193 # @TargetInfo:
2194 #
2195 # Information describing the QEMU target.
2196 #
2197 # @arch: the target architecture (eg "x86_64", "i386", etc)
2198 #
2199 # Since: 1.2.0
2200 ##
2201 { 'struct': 'TargetInfo',
2202   'data': { 'arch': 'str' } }
2203
2204 ##
2205 # @query-target:
2206 #
2207 # Return information about the target for this QEMU
2208 #
2209 # Returns: TargetInfo
2210 #
2211 # Since: 1.2.0
2212 ##
2213 { 'command': 'query-target', 'returns': 'TargetInfo' }
2214
2215 ##
2216 # @TpmModel:
2217 #
2218 # An enumeration of TPM models
2219 #
2220 # @tpm-tis: TPM TIS model
2221 #
2222 # Since: 1.5
2223 ##
2224 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
2225
2226 ##
2227 # @query-tpm-models:
2228 #
2229 # Return a list of supported TPM models
2230 #
2231 # Returns: a list of TpmModel
2232 #
2233 # Since: 1.5
2234 #
2235 # Example:
2236 #
2237 # -> { "execute": "query-tpm-models" }
2238 # <- { "return": [ "tpm-tis" ] }
2239 #
2240 ##
2241 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
2242
2243 ##
2244 # @TpmType:
2245 #
2246 # An enumeration of TPM types
2247 #
2248 # @passthrough: TPM passthrough type
2249 #
2250 # Since: 1.5
2251 ##
2252 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
2253
2254 ##
2255 # @query-tpm-types:
2256 #
2257 # Return a list of supported TPM types
2258 #
2259 # Returns: a list of TpmType
2260 #
2261 # Since: 1.5
2262 #
2263 # Example:
2264 #
2265 # -> { "execute": "query-tpm-types" }
2266 # <- { "return": [ "passthrough" ] }
2267 #
2268 ##
2269 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
2270
2271 ##
2272 # @TPMPassthroughOptions:
2273 #
2274 # Information about the TPM passthrough type
2275 #
2276 # @path: string describing the path used for accessing the TPM device
2277 #
2278 # @cancel-path: string showing the TPM's sysfs cancel file
2279 #               for cancellation of TPM commands while they are executing
2280 #
2281 # Since: 1.5
2282 ##
2283 { 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
2284                                              '*cancel-path' : 'str'} }
2285
2286 ##
2287 # @TpmTypeOptions:
2288 #
2289 # A union referencing different TPM backend types' configuration options
2290 #
2291 # @type: 'passthrough' The configuration options for the TPM passthrough type
2292 #
2293 # Since: 1.5
2294 ##
2295 { 'union': 'TpmTypeOptions',
2296    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
2297
2298 ##
2299 # @TPMInfo:
2300 #
2301 # Information about the TPM
2302 #
2303 # @id: The Id of the TPM
2304 #
2305 # @model: The TPM frontend model
2306 #
2307 # @options: The TPM (backend) type configuration options
2308 #
2309 # Since: 1.5
2310 ##
2311 { 'struct': 'TPMInfo',
2312   'data': {'id': 'str',
2313            'model': 'TpmModel',
2314            'options': 'TpmTypeOptions' } }
2315
2316 ##
2317 # @query-tpm:
2318 #
2319 # Return information about the TPM device
2320 #
2321 # Returns: @TPMInfo on success
2322 #
2323 # Since: 1.5
2324 #
2325 # Example:
2326 #
2327 # -> { "execute": "query-tpm" }
2328 # <- { "return":
2329 #      [
2330 #        { "model": "tpm-tis",
2331 #          "options":
2332 #            { "type": "passthrough",
2333 #              "data":
2334 #                { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
2335 #                  "path": "/dev/tpm0"
2336 #                }
2337 #            },
2338 #          "id": "tpm0"
2339 #        }
2340 #      ]
2341 #    }
2342 #
2343 ##
2344 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
2345
2346 ##
2347 # @AcpiTableOptions:
2348 #
2349 # Specify an ACPI table on the command line to load.
2350 #
2351 # At most one of @file and @data can be specified. The list of files specified
2352 # by any one of them is loaded and concatenated in order. If both are omitted,
2353 # @data is implied.
2354 #
2355 # Other fields / optargs can be used to override fields of the generic ACPI
2356 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
2357 # Description Table Header. If a header field is not overridden, then the
2358 # corresponding value from the concatenated blob is used (in case of @file), or
2359 # it is filled in with a hard-coded value (in case of @data).
2360 #
2361 # String fields are copied into the matching ACPI member from lowest address
2362 # upwards, and silently truncated / NUL-padded to length.
2363 #
2364 # @sig: table signature / identifier (4 bytes)
2365 #
2366 # @rev: table revision number (dependent on signature, 1 byte)
2367 #
2368 # @oem_id: OEM identifier (6 bytes)
2369 #
2370 # @oem_table_id: OEM table identifier (8 bytes)
2371 #
2372 # @oem_rev: OEM-supplied revision number (4 bytes)
2373 #
2374 # @asl_compiler_id: identifier of the utility that created the table
2375 #                   (4 bytes)
2376 #
2377 # @asl_compiler_rev: revision number of the utility that created the
2378 #                    table (4 bytes)
2379 #
2380 # @file: colon (:) separated list of pathnames to load and
2381 #        concatenate as table data. The resultant binary blob is expected to
2382 #        have an ACPI table header. At least one file is required. This field
2383 #        excludes @data.
2384 #
2385 # @data: colon (:) separated list of pathnames to load and
2386 #        concatenate as table data. The resultant binary blob must not have an
2387 #        ACPI table header. At least one file is required. This field excludes
2388 #        @file.
2389 #
2390 # Since: 1.5
2391 ##
2392 { 'struct': 'AcpiTableOptions',
2393   'data': {
2394     '*sig':               'str',
2395     '*rev':               'uint8',
2396     '*oem_id':            'str',
2397     '*oem_table_id':      'str',
2398     '*oem_rev':           'uint32',
2399     '*asl_compiler_id':   'str',
2400     '*asl_compiler_rev':  'uint32',
2401     '*file':              'str',
2402     '*data':              'str' }}
2403
2404 ##
2405 # @CommandLineParameterType:
2406 #
2407 # Possible types for an option parameter.
2408 #
2409 # @string: accepts a character string
2410 #
2411 # @boolean: accepts "on" or "off"
2412 #
2413 # @number: accepts a number
2414 #
2415 # @size: accepts a number followed by an optional suffix (K)ilo,
2416 #        (M)ega, (G)iga, (T)era
2417 #
2418 # Since: 1.5
2419 ##
2420 { 'enum': 'CommandLineParameterType',
2421   'data': ['string', 'boolean', 'number', 'size'] }
2422
2423 ##
2424 # @CommandLineParameterInfo:
2425 #
2426 # Details about a single parameter of a command line option.
2427 #
2428 # @name: parameter name
2429 #
2430 # @type: parameter @CommandLineParameterType
2431 #
2432 # @help: human readable text string, not suitable for parsing.
2433 #
2434 # @default: default value string (since 2.1)
2435 #
2436 # Since: 1.5
2437 ##
2438 { 'struct': 'CommandLineParameterInfo',
2439   'data': { 'name': 'str',
2440             'type': 'CommandLineParameterType',
2441             '*help': 'str',
2442             '*default': 'str' } }
2443
2444 ##
2445 # @CommandLineOptionInfo:
2446 #
2447 # Details about a command line option, including its list of parameter details
2448 #
2449 # @option: option name
2450 #
2451 # @parameters: an array of @CommandLineParameterInfo
2452 #
2453 # Since: 1.5
2454 ##
2455 { 'struct': 'CommandLineOptionInfo',
2456   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
2457
2458 ##
2459 # @query-command-line-options:
2460 #
2461 # Query command line option schema.
2462 #
2463 # @option: option name
2464 #
2465 # Returns: list of @CommandLineOptionInfo for all options (or for the given
2466 #          @option).  Returns an error if the given @option doesn't exist.
2467 #
2468 # Since: 1.5
2469 #
2470 # Example:
2471 #
2472 # -> { "execute": "query-command-line-options",
2473 #      "arguments": { "option": "option-rom" } }
2474 # <- { "return": [
2475 #         {
2476 #             "parameters": [
2477 #                 {
2478 #                     "name": "romfile",
2479 #                     "type": "string"
2480 #                 },
2481 #                 {
2482 #                     "name": "bootindex",
2483 #                     "type": "number"
2484 #                 }
2485 #             ],
2486 #             "option": "option-rom"
2487 #         }
2488 #      ]
2489 #    }
2490 #
2491 ##
2492 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
2493  'returns': ['CommandLineOptionInfo'] }
2494
2495 ##
2496 # @X86CPURegister32:
2497 #
2498 # A X86 32-bit register
2499 #
2500 # Since: 1.5
2501 ##
2502 { 'enum': 'X86CPURegister32',
2503   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
2504
2505 ##
2506 # @X86CPUFeatureWordInfo:
2507 #
2508 # Information about a X86 CPU feature word
2509 #
2510 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
2511 #
2512 # @cpuid-input-ecx: Input ECX value for CPUID instruction for that
2513 #                   feature word
2514 #
2515 # @cpuid-register: Output register containing the feature bits
2516 #
2517 # @features: value of output register, containing the feature bits
2518 #
2519 # Since: 1.5
2520 ##
2521 { 'struct': 'X86CPUFeatureWordInfo',
2522   'data': { 'cpuid-input-eax': 'int',
2523             '*cpuid-input-ecx': 'int',
2524             'cpuid-register': 'X86CPURegister32',
2525             'features': 'int' } }
2526
2527 ##
2528 # @DummyForceArrays:
2529 #
2530 # Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
2531 #
2532 # Since: 2.5
2533 ##
2534 { 'struct': 'DummyForceArrays',
2535   'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
2536
2537
2538 ##
2539 # @NumaOptionsType:
2540 #
2541 # @node: NUMA nodes configuration
2542 #
2543 # @dist: NUMA distance configuration (since 2.10)
2544 #
2545 # @cpu: property based CPU(s) to node mapping (Since: 2.10)
2546 #
2547 # Since: 2.1
2548 ##
2549 { 'enum': 'NumaOptionsType',
2550   'data': [ 'node', 'dist', 'cpu' ] }
2551
2552 ##
2553 # @NumaOptions:
2554 #
2555 # A discriminated record of NUMA options. (for OptsVisitor)
2556 #
2557 # Since: 2.1
2558 ##
2559 { 'union': 'NumaOptions',
2560   'base': { 'type': 'NumaOptionsType' },
2561   'discriminator': 'type',
2562   'data': {
2563     'node': 'NumaNodeOptions',
2564     'dist': 'NumaDistOptions',
2565     'cpu': 'NumaCpuOptions' }}
2566
2567 ##
2568 # @NumaNodeOptions:
2569 #
2570 # Create a guest NUMA node. (for OptsVisitor)
2571 #
2572 # @nodeid: NUMA node ID (increase by 1 from 0 if omitted)
2573 #
2574 # @cpus: VCPUs belonging to this node (assign VCPUS round-robin
2575 #         if omitted)
2576 #
2577 # @mem: memory size of this node; mutually exclusive with @memdev.
2578 #       Equally divide total memory among nodes if both @mem and @memdev are
2579 #       omitted.
2580 #
2581 # @memdev: memory backend object.  If specified for one node,
2582 #          it must be specified for all nodes.
2583 #
2584 # Since: 2.1
2585 ##
2586 { 'struct': 'NumaNodeOptions',
2587   'data': {
2588    '*nodeid': 'uint16',
2589    '*cpus':   ['uint16'],
2590    '*mem':    'size',
2591    '*memdev': 'str' }}
2592
2593 ##
2594 # @NumaDistOptions:
2595 #
2596 # Set the distance between 2 NUMA nodes.
2597 #
2598 # @src: source NUMA node.
2599 #
2600 # @dst: destination NUMA node.
2601 #
2602 # @val: NUMA distance from source node to destination node.
2603 #       When a node is unreachable from another node, set the distance
2604 #       between them to 255.
2605 #
2606 # Since: 2.10
2607 ##
2608 { 'struct': 'NumaDistOptions',
2609   'data': {
2610    'src': 'uint16',
2611    'dst': 'uint16',
2612    'val': 'uint8' }}
2613
2614 ##
2615 # @NumaCpuOptions:
2616 #
2617 # Option "-numa cpu" overrides default cpu to node mapping.
2618 # It accepts the same set of cpu properties as returned by
2619 # query-hotpluggable-cpus[].props, where node-id could be used to
2620 # override default node mapping.
2621 #
2622 # Since: 2.10
2623 ##
2624 { 'struct': 'NumaCpuOptions',
2625    'base': 'CpuInstanceProperties',
2626    'data' : {} }
2627
2628 ##
2629 # @HostMemPolicy:
2630 #
2631 # Host memory policy types
2632 #
2633 # @default: restore default policy, remove any nondefault policy
2634 #
2635 # @preferred: set the preferred host nodes for allocation
2636 #
2637 # @bind: a strict policy that restricts memory allocation to the
2638 #        host nodes specified
2639 #
2640 # @interleave: memory allocations are interleaved across the set
2641 #              of host nodes specified
2642 #
2643 # Since: 2.1
2644 ##
2645 { 'enum': 'HostMemPolicy',
2646   'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
2647
2648 ##
2649 # @Memdev:
2650 #
2651 # Information about memory backend
2652 #
2653 # @id: backend's ID if backend has 'id' property (since 2.9)
2654 #
2655 # @size: memory backend size
2656 #
2657 # @merge: enables or disables memory merge support
2658 #
2659 # @dump: includes memory backend's memory in a core dump or not
2660 #
2661 # @prealloc: enables or disables memory preallocation
2662 #
2663 # @host-nodes: host nodes for its memory policy
2664 #
2665 # @policy: memory policy of memory backend
2666 #
2667 # Since: 2.1
2668 ##
2669 { 'struct': 'Memdev',
2670   'data': {
2671     '*id':        'str',
2672     'size':       'size',
2673     'merge':      'bool',
2674     'dump':       'bool',
2675     'prealloc':   'bool',
2676     'host-nodes': ['uint16'],
2677     'policy':     'HostMemPolicy' }}
2678
2679 ##
2680 # @query-memdev:
2681 #
2682 # Returns information for all memory backends.
2683 #
2684 # Returns: a list of @Memdev.
2685 #
2686 # Since: 2.1
2687 #
2688 # Example:
2689 #
2690 # -> { "execute": "query-memdev" }
2691 # <- { "return": [
2692 #        {
2693 #          "id": "mem1",
2694 #          "size": 536870912,
2695 #          "merge": false,
2696 #          "dump": true,
2697 #          "prealloc": false,
2698 #          "host-nodes": [0, 1],
2699 #          "policy": "bind"
2700 #        },
2701 #        {
2702 #          "size": 536870912,
2703 #          "merge": false,
2704 #          "dump": true,
2705 #          "prealloc": true,
2706 #          "host-nodes": [2, 3],
2707 #          "policy": "preferred"
2708 #        }
2709 #      ]
2710 #    }
2711 #
2712 ##
2713 { 'command': 'query-memdev', 'returns': ['Memdev'] }
2714
2715 ##
2716 # @PCDIMMDeviceInfo:
2717 #
2718 # PCDIMMDevice state information
2719 #
2720 # @id: device's ID
2721 #
2722 # @addr: physical address, where device is mapped
2723 #
2724 # @size: size of memory that the device provides
2725 #
2726 # @slot: slot number at which device is plugged in
2727 #
2728 # @node: NUMA node number where device is plugged in
2729 #
2730 # @memdev: memory backend linked with device
2731 #
2732 # @hotplugged: true if device was hotplugged
2733 #
2734 # @hotpluggable: true if device if could be added/removed while machine is running
2735 #
2736 # Since: 2.1
2737 ##
2738 { 'struct': 'PCDIMMDeviceInfo',
2739   'data': { '*id': 'str',
2740             'addr': 'int',
2741             'size': 'int',
2742             'slot': 'int',
2743             'node': 'int',
2744             'memdev': 'str',
2745             'hotplugged': 'bool',
2746             'hotpluggable': 'bool'
2747           }
2748 }
2749
2750 ##
2751 # @MemoryDeviceInfo:
2752 #
2753 # Union containing information about a memory device
2754 #
2755 # Since: 2.1
2756 ##
2757 { 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
2758
2759 ##
2760 # @query-memory-devices:
2761 #
2762 # Lists available memory devices and their state
2763 #
2764 # Since: 2.1
2765 #
2766 # Example:
2767 #
2768 # -> { "execute": "query-memory-devices" }
2769 # <- { "return": [ { "data":
2770 #                       { "addr": 5368709120,
2771 #                         "hotpluggable": true,
2772 #                         "hotplugged": true,
2773 #                         "id": "d1",
2774 #                         "memdev": "/objects/memX",
2775 #                         "node": 0,
2776 #                         "size": 1073741824,
2777 #                         "slot": 0},
2778 #                    "type": "dimm"
2779 #                  } ] }
2780 #
2781 ##
2782 { 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
2783
2784 ##
2785 # @ACPISlotType:
2786 #
2787 # @DIMM: memory slot
2788 # @CPU: logical CPU slot (since 2.7)
2789 ##
2790 { 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
2791
2792 ##
2793 # @ACPIOSTInfo:
2794 #
2795 # OSPM Status Indication for a device
2796 # For description of possible values of @source and @status fields
2797 # see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
2798 #
2799 # @device: device ID associated with slot
2800 #
2801 # @slot: slot ID, unique per slot of a given @slot-type
2802 #
2803 # @slot-type: type of the slot
2804 #
2805 # @source: an integer containing the source event
2806 #
2807 # @status: an integer containing the status code
2808 #
2809 # Since: 2.1
2810 ##
2811 { 'struct': 'ACPIOSTInfo',
2812   'data'  : { '*device': 'str',
2813               'slot': 'str',
2814               'slot-type': 'ACPISlotType',
2815               'source': 'int',
2816               'status': 'int' } }
2817
2818 ##
2819 # @query-acpi-ospm-status:
2820 #
2821 # Return a list of ACPIOSTInfo for devices that support status
2822 # reporting via ACPI _OST method.
2823 #
2824 # Since: 2.1
2825 #
2826 # Example:
2827 #
2828 # -> { "execute": "query-acpi-ospm-status" }
2829 # <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
2830 #                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
2831 #                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
2832 #                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
2833 #    ]}
2834 #
2835 ##
2836 { 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
2837
2838 ##
2839 # @IoOperationType:
2840 #
2841 # An enumeration of the I/O operation types
2842 #
2843 # @read: read operation
2844 #
2845 # @write: write operation
2846 #
2847 # Since: 2.1
2848 ##
2849 { 'enum': 'IoOperationType',
2850   'data': [ 'read', 'write' ] }
2851
2852 ##
2853 # @rtc-reset-reinjection:
2854 #
2855 # This command will reset the RTC interrupt reinjection backlog.
2856 # Can be used if another mechanism to synchronize guest time
2857 # is in effect, for example QEMU guest agent's guest-set-time
2858 # command.
2859 #
2860 # Since: 2.1
2861 #
2862 # Example:
2863 #
2864 # -> { "execute": "rtc-reset-reinjection" }
2865 # <- { "return": {} }
2866 #
2867 ##
2868 { 'command': 'rtc-reset-reinjection' }
2869
2870 ##
2871 # @ReplayMode:
2872 #
2873 # Mode of the replay subsystem.
2874 #
2875 # @none: normal execution mode. Replay or record are not enabled.
2876 #
2877 # @record: record mode. All non-deterministic data is written into the
2878 #          replay log.
2879 #
2880 # @play: replay mode. Non-deterministic data required for system execution
2881 #        is read from the log.
2882 #
2883 # Since: 2.5
2884 ##
2885 { 'enum': 'ReplayMode',
2886   'data': [ 'none', 'record', 'play' ] }
2887
2888 ##
2889 # @xen-load-devices-state:
2890 #
2891 # Load the state of all devices from file. The RAM and the block devices
2892 # of the VM are not loaded by this command.
2893 #
2894 # @filename: the file to load the state of the devices from as binary
2895 # data. See xen-save-devices-state.txt for a description of the binary
2896 # format.
2897 #
2898 # Since: 2.7
2899 #
2900 # Example:
2901 #
2902 # -> { "execute": "xen-load-devices-state",
2903 #      "arguments": { "filename": "/tmp/resume" } }
2904 # <- { "return": {} }
2905 #
2906 ##
2907 { 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
2908
2909 ##
2910 # @GICCapability:
2911 #
2912 # The struct describes capability for a specific GIC (Generic
2913 # Interrupt Controller) version. These bits are not only decided by
2914 # QEMU/KVM software version, but also decided by the hardware that
2915 # the program is running upon.
2916 #
2917 # @version:  version of GIC to be described. Currently, only 2 and 3
2918 #            are supported.
2919 #
2920 # @emulated: whether current QEMU/hardware supports emulated GIC
2921 #            device in user space.
2922 #
2923 # @kernel:   whether current QEMU/hardware supports hardware
2924 #            accelerated GIC device in kernel.
2925 #
2926 # Since: 2.6
2927 ##
2928 { 'struct': 'GICCapability',
2929   'data': { 'version': 'int',
2930             'emulated': 'bool',
2931             'kernel': 'bool' } }
2932
2933 ##
2934 # @query-gic-capabilities:
2935 #
2936 # This command is ARM-only. It will return a list of GICCapability
2937 # objects that describe its capability bits.
2938 #
2939 # Returns: a list of GICCapability objects.
2940 #
2941 # Since: 2.6
2942 #
2943 # Example:
2944 #
2945 # -> { "execute": "query-gic-capabilities" }
2946 # <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
2947 #                 { "version": 3, "emulated": false, "kernel": true } ] }
2948 #
2949 ##
2950 { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
2951
2952 ##
2953 # @CpuInstanceProperties:
2954 #
2955 # List of properties to be used for hotplugging a CPU instance,
2956 # it should be passed by management with device_add command when
2957 # a CPU is being hotplugged.
2958 #
2959 # @node-id: NUMA node ID the CPU belongs to
2960 # @socket-id: socket number within node/board the CPU belongs to
2961 # @core-id: core number within socket the CPU belongs to
2962 # @thread-id: thread number within core the CPU belongs to
2963 #
2964 # Note: currently there are 4 properties that could be present
2965 # but management should be prepared to pass through other
2966 # properties with device_add command to allow for future
2967 # interface extension. This also requires the filed names to be kept in
2968 # sync with the properties passed to -device/device_add.
2969 #
2970 # Since: 2.7
2971 ##
2972 { 'struct': 'CpuInstanceProperties',
2973   'data': { '*node-id': 'int',
2974             '*socket-id': 'int',
2975             '*core-id': 'int',
2976             '*thread-id': 'int'
2977   }
2978 }
2979
2980 ##
2981 # @HotpluggableCPU:
2982 #
2983 # @type: CPU object type for usage with device_add command
2984 # @props: list of properties to be used for hotplugging CPU
2985 # @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
2986 # @qom-path: link to existing CPU object if CPU is present or
2987 #            omitted if CPU is not present.
2988 #
2989 # Since: 2.7
2990 ##
2991 { 'struct': 'HotpluggableCPU',
2992   'data': { 'type': 'str',
2993             'vcpus-count': 'int',
2994             'props': 'CpuInstanceProperties',
2995             '*qom-path': 'str'
2996           }
2997 }
2998
2999 ##
3000 # @query-hotpluggable-cpus:
3001 #
3002 # Returns: a list of HotpluggableCPU objects.
3003 #
3004 # Since: 2.7
3005 #
3006 # Example:
3007 #
3008 # For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
3009 #
3010 # -> { "execute": "query-hotpluggable-cpus" }
3011 # <- {"return": [
3012 #      { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
3013 #        "vcpus-count": 1 },
3014 #      { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
3015 #        "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
3016 #    ]}'
3017 #
3018 # For pc machine type started with -smp 1,maxcpus=2:
3019 #
3020 # -> { "execute": "query-hotpluggable-cpus" }
3021 # <- {"return": [
3022 #      {
3023 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3024 #         "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
3025 #      },
3026 #      {
3027 #         "qom-path": "/machine/unattached/device[0]",
3028 #         "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
3029 #         "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
3030 #      }
3031 #    ]}
3032 #
3033 ##
3034 { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
3035
3036 ##
3037 # @GuidInfo:
3038 #
3039 # GUID information.
3040 #
3041 # @guid: the globally unique identifier
3042 #
3043 # Since: 2.9
3044 ##
3045 { 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
3046
3047 ##
3048 # @query-vm-generation-id:
3049 #
3050 # Show Virtual Machine Generation ID
3051 #
3052 # Since 2.9
3053 ##
3054 { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
This page took 0.191856 seconds and 4 git commands to generate.