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