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