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