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