xref: /openbmc/qemu/qapi/misc.json (revision db0f08df)
1# -*- Mode: Python -*-
2# vim: filetype=python
3#
4
5##
6# = Miscellanea
7##
8
9{ 'include': 'common.json' }
10
11##
12# @add_client:
13#
14# Allow client connections for VNC, Spice and socket based
15# character devices to be passed in to QEMU via SCM_RIGHTS.
16#
17# @protocol: protocol name. Valid names are "vnc", "spice" or the
18#            name of a character device (eg. from -chardev id=XXXX)
19#
20# @fdname: file descriptor name previously passed via 'getfd' command
21#
22# @skipauth: whether to skip authentication. Only applies
23#            to "vnc" and "spice" protocols
24#
25# @tls: whether to perform TLS. Only applies to the "spice"
26#       protocol
27#
28# Returns: nothing on success.
29#
30# Since: 0.14.0
31#
32# Example:
33#
34# -> { "execute": "add_client", "arguments": { "protocol": "vnc",
35#                                              "fdname": "myclient" } }
36# <- { "return": {} }
37#
38##
39{ 'command': 'add_client',
40  'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
41            '*tls': 'bool' } }
42
43##
44# @NameInfo:
45#
46# Guest name information.
47#
48# @name: The name of the guest
49#
50# Since: 0.14.0
51##
52{ 'struct': 'NameInfo', 'data': {'*name': 'str'} }
53
54##
55# @query-name:
56#
57# Return the name information of a guest.
58#
59# Returns: @NameInfo of the guest
60#
61# Since: 0.14.0
62#
63# Example:
64#
65# -> { "execute": "query-name" }
66# <- { "return": { "name": "qemu-name" } }
67#
68##
69{ 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true }
70
71##
72# @KvmInfo:
73#
74# Information about support for KVM acceleration
75#
76# @enabled: true if KVM acceleration is active
77#
78# @present: true if KVM acceleration is built into this executable
79#
80# Since: 0.14.0
81##
82{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
83
84##
85# @query-kvm:
86#
87# Returns information about KVM acceleration
88#
89# Returns: @KvmInfo
90#
91# Since: 0.14.0
92#
93# Example:
94#
95# -> { "execute": "query-kvm" }
96# <- { "return": { "enabled": true, "present": true } }
97#
98##
99{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
100
101##
102# @UuidInfo:
103#
104# Guest UUID information (Universally Unique Identifier).
105#
106# @UUID: the UUID of the guest
107#
108# Since: 0.14.0
109#
110# Notes: If no UUID was specified for the guest, a null UUID is returned.
111##
112{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
113
114##
115# @query-uuid:
116#
117# Query the guest UUID information.
118#
119# Returns: The @UuidInfo for the guest
120#
121# Since: 0.14.0
122#
123# Example:
124#
125# -> { "execute": "query-uuid" }
126# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
127#
128##
129{ 'command': 'query-uuid', 'returns': 'UuidInfo', 'allow-preconfig': true }
130
131##
132# @IOThreadInfo:
133#
134# Information about an iothread
135#
136# @id: the identifier of the iothread
137#
138# @thread-id: ID of the underlying host thread
139#
140# @poll-max-ns: maximum polling time in ns, 0 means polling is disabled
141#               (since 2.9)
142#
143# @poll-grow: how many ns will be added to polling time, 0 means that it's not
144#             configured (since 2.9)
145#
146# @poll-shrink: how many ns will be removed from polling time, 0 means that
147#               it's not configured (since 2.9)
148#
149# Since: 2.0
150##
151{ 'struct': 'IOThreadInfo',
152  'data': {'id': 'str',
153           'thread-id': 'int',
154           'poll-max-ns': 'int',
155           'poll-grow': 'int',
156           'poll-shrink': 'int' } }
157
158##
159# @query-iothreads:
160#
161# Returns a list of information about each iothread.
162#
163# Note: this list excludes the QEMU main loop thread, which is not declared
164#       using the -object iothread command-line option.  It is always the main thread
165#       of the process.
166#
167# Returns: a list of @IOThreadInfo for each iothread
168#
169# Since: 2.0
170#
171# Example:
172#
173# -> { "execute": "query-iothreads" }
174# <- { "return": [
175#          {
176#             "id":"iothread0",
177#             "thread-id":3134
178#          },
179#          {
180#             "id":"iothread1",
181#             "thread-id":3135
182#          }
183#       ]
184#    }
185#
186##
187{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'],
188  'allow-preconfig': true }
189
190##
191# @PciMemoryRange:
192#
193# A PCI device memory region
194#
195# @base: the starting address (guest physical)
196#
197# @limit: the ending address (guest physical)
198#
199# Since: 0.14.0
200##
201{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
202
203##
204# @PciMemoryRegion:
205#
206# Information about a PCI device I/O region.
207#
208# @bar: the index of the Base Address Register for this region
209#
210# @type: - 'io' if the region is a PIO region
211#        - 'memory' if the region is a MMIO region
212#
213# @size: memory size
214#
215# @prefetch: if @type is 'memory', true if the memory is prefetchable
216#
217# @mem_type_64: if @type is 'memory', true if the BAR is 64-bit
218#
219# Since: 0.14.0
220##
221{ 'struct': 'PciMemoryRegion',
222  'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
223           '*prefetch': 'bool', '*mem_type_64': 'bool' } }
224
225##
226# @PciBusInfo:
227#
228# Information about a bus of a PCI Bridge device
229#
230# @number: primary bus interface number.  This should be the number of the
231#          bus the device resides on.
232#
233# @secondary: secondary bus interface number.  This is the number of the
234#             main bus for the bridge
235#
236# @subordinate: This is the highest number bus that resides below the
237#               bridge.
238#
239# @io_range: The PIO range for all devices on this bridge
240#
241# @memory_range: The MMIO range for all devices on this bridge
242#
243# @prefetchable_range: The range of prefetchable MMIO for all devices on
244#                      this bridge
245#
246# Since: 2.4
247##
248{ 'struct': 'PciBusInfo',
249  'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
250           'io_range': 'PciMemoryRange',
251           'memory_range': 'PciMemoryRange',
252           'prefetchable_range': 'PciMemoryRange' } }
253
254##
255# @PciBridgeInfo:
256#
257# Information about a PCI Bridge device
258#
259# @bus: information about the bus the device resides on
260#
261# @devices: a list of @PciDeviceInfo for each device on this bridge
262#
263# Since: 0.14.0
264##
265{ 'struct': 'PciBridgeInfo',
266  'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
267
268##
269# @PciDeviceClass:
270#
271# Information about the Class of a PCI device
272#
273# @desc: a string description of the device's class
274#
275# @class: the class code of the device
276#
277# Since: 2.4
278##
279{ 'struct': 'PciDeviceClass',
280  'data': {'*desc': 'str', 'class': 'int'} }
281
282##
283# @PciDeviceId:
284#
285# Information about the Id of a PCI device
286#
287# @device: the PCI device id
288#
289# @vendor: the PCI vendor id
290#
291# @subsystem: the PCI subsystem id (since 3.1)
292#
293# @subsystem-vendor: the PCI subsystem vendor id (since 3.1)
294#
295# Since: 2.4
296##
297{ 'struct': 'PciDeviceId',
298  'data': {'device': 'int', 'vendor': 'int', '*subsystem': 'int',
299            '*subsystem-vendor': 'int'} }
300
301##
302# @PciDeviceInfo:
303#
304# Information about a PCI device
305#
306# @bus: the bus number of the device
307#
308# @slot: the slot the device is located in
309#
310# @function: the function of the slot used by the device
311#
312# @class_info: the class of the device
313#
314# @id: the PCI device id
315#
316# @irq: if an IRQ is assigned to the device, the IRQ number
317#
318# @irq_pin: the IRQ pin, zero means no IRQ (since 5.1)
319#
320# @qdev_id: the device name of the PCI device
321#
322# @pci_bridge: if the device is a PCI bridge, the bridge information
323#
324# @regions: a list of the PCI I/O regions associated with the device
325#
326# Notes: the contents of @class_info.desc are not stable and should only be
327#        treated as informational.
328#
329# Since: 0.14.0
330##
331{ 'struct': 'PciDeviceInfo',
332  'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
333           'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
334           '*irq': 'int', 'irq_pin': 'int', 'qdev_id': 'str',
335           '*pci_bridge': 'PciBridgeInfo', 'regions': ['PciMemoryRegion'] }}
336
337##
338# @PciInfo:
339#
340# Information about a PCI bus
341#
342# @bus: the bus index
343#
344# @devices: a list of devices on this bus
345#
346# Since: 0.14.0
347##
348{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
349
350##
351# @query-pci:
352#
353# Return information about the PCI bus topology of the guest.
354#
355# Returns: a list of @PciInfo for each PCI bus. Each bus is
356#          represented by a json-object, which has a key with a json-array of
357#          all PCI devices attached to it. Each device is represented by a
358#          json-object.
359#
360# Since: 0.14.0
361#
362# Example:
363#
364# -> { "execute": "query-pci" }
365# <- { "return": [
366#          {
367#             "bus": 0,
368#             "devices": [
369#                {
370#                   "bus": 0,
371#                   "qdev_id": "",
372#                   "slot": 0,
373#                   "class_info": {
374#                      "class": 1536,
375#                      "desc": "Host bridge"
376#                   },
377#                   "id": {
378#                      "device": 32902,
379#                      "vendor": 4663
380#                   },
381#                   "function": 0,
382#                   "regions": [
383#                   ]
384#                },
385#                {
386#                   "bus": 0,
387#                   "qdev_id": "",
388#                   "slot": 1,
389#                   "class_info": {
390#                      "class": 1537,
391#                      "desc": "ISA bridge"
392#                   },
393#                   "id": {
394#                      "device": 32902,
395#                      "vendor": 28672
396#                   },
397#                   "function": 0,
398#                   "regions": [
399#                   ]
400#                },
401#                {
402#                   "bus": 0,
403#                   "qdev_id": "",
404#                   "slot": 1,
405#                   "class_info": {
406#                      "class": 257,
407#                      "desc": "IDE controller"
408#                   },
409#                   "id": {
410#                      "device": 32902,
411#                      "vendor": 28688
412#                   },
413#                   "function": 1,
414#                   "regions": [
415#                      {
416#                         "bar": 4,
417#                         "size": 16,
418#                         "address": 49152,
419#                         "type": "io"
420#                      }
421#                   ]
422#                },
423#                {
424#                   "bus": 0,
425#                   "qdev_id": "",
426#                   "slot": 2,
427#                   "class_info": {
428#                      "class": 768,
429#                      "desc": "VGA controller"
430#                   },
431#                   "id": {
432#                      "device": 4115,
433#                      "vendor": 184
434#                   },
435#                   "function": 0,
436#                   "regions": [
437#                      {
438#                         "prefetch": true,
439#                         "mem_type_64": false,
440#                         "bar": 0,
441#                         "size": 33554432,
442#                         "address": 4026531840,
443#                         "type": "memory"
444#                      },
445#                      {
446#                         "prefetch": false,
447#                         "mem_type_64": false,
448#                         "bar": 1,
449#                         "size": 4096,
450#                         "address": 4060086272,
451#                         "type": "memory"
452#                      },
453#                      {
454#                         "prefetch": false,
455#                         "mem_type_64": false,
456#                         "bar": 6,
457#                         "size": 65536,
458#                         "address": -1,
459#                         "type": "memory"
460#                      }
461#                   ]
462#                },
463#                {
464#                   "bus": 0,
465#                   "qdev_id": "",
466#                   "irq": 11,
467#                   "slot": 4,
468#                   "class_info": {
469#                      "class": 1280,
470#                      "desc": "RAM controller"
471#                   },
472#                   "id": {
473#                      "device": 6900,
474#                      "vendor": 4098
475#                   },
476#                   "function": 0,
477#                   "regions": [
478#                      {
479#                         "bar": 0,
480#                         "size": 32,
481#                         "address": 49280,
482#                         "type": "io"
483#                      }
484#                   ]
485#                }
486#             ]
487#          }
488#       ]
489#    }
490#
491# Note: This example has been shortened as the real response is too long.
492#
493##
494{ 'command': 'query-pci', 'returns': ['PciInfo'] }
495
496##
497# @stop:
498#
499# Stop all guest VCPU execution.
500#
501# Since:  0.14.0
502#
503# Notes: This function will succeed even if the guest is already in the stopped
504#        state.  In "inmigrate" state, it will ensure that the guest
505#        remains paused once migration finishes, as if the -S option was
506#        passed on the command line.
507#
508# Example:
509#
510# -> { "execute": "stop" }
511# <- { "return": {} }
512#
513##
514{ 'command': 'stop' }
515
516##
517# @system_reset:
518#
519# Performs a hard reset of a guest.
520#
521# Since: 0.14.0
522#
523# Example:
524#
525# -> { "execute": "system_reset" }
526# <- { "return": {} }
527#
528##
529{ 'command': 'system_reset' }
530
531##
532# @system_powerdown:
533#
534# Requests that a guest perform a powerdown operation.
535#
536# Since: 0.14.0
537#
538# Notes: A guest may or may not respond to this command.  This command
539#        returning does not indicate that a guest has accepted the request or
540#        that it has shut down.  Many guests will respond to this command by
541#        prompting the user in some way.
542# Example:
543#
544# -> { "execute": "system_powerdown" }
545# <- { "return": {} }
546#
547##
548{ 'command': 'system_powerdown' }
549
550##
551# @memsave:
552#
553# Save a portion of guest memory to a file.
554#
555# @val: the virtual address of the guest to start from
556#
557# @size: the size of memory region to save
558#
559# @filename: the file to save the memory to as binary data
560#
561# @cpu-index: the index of the virtual CPU to use for translating the
562#             virtual address (defaults to CPU 0)
563#
564# Returns: Nothing on success
565#
566# Since: 0.14.0
567#
568# Notes: Errors were not reliably returned until 1.1
569#
570# Example:
571#
572# -> { "execute": "memsave",
573#      "arguments": { "val": 10,
574#                     "size": 100,
575#                     "filename": "/tmp/virtual-mem-dump" } }
576# <- { "return": {} }
577#
578##
579{ 'command': 'memsave',
580  'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
581
582##
583# @pmemsave:
584#
585# Save a portion of guest physical memory to a file.
586#
587# @val: the physical address of the guest to start from
588#
589# @size: the size of memory region to save
590#
591# @filename: the file to save the memory to as binary data
592#
593# Returns: Nothing on success
594#
595# Since: 0.14.0
596#
597# Notes: Errors were not reliably returned until 1.1
598#
599# Example:
600#
601# -> { "execute": "pmemsave",
602#      "arguments": { "val": 10,
603#                     "size": 100,
604#                     "filename": "/tmp/physical-mem-dump" } }
605# <- { "return": {} }
606#
607##
608{ 'command': 'pmemsave',
609  'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
610
611##
612# @cont:
613#
614# Resume guest VCPU execution.
615#
616# Since:  0.14.0
617#
618# Returns:  If successful, nothing
619#
620# Notes: This command will succeed if the guest is currently running.  It
621#        will also succeed if the guest is in the "inmigrate" state; in
622#        this case, the effect of the command is to make sure the guest
623#        starts once migration finishes, removing the effect of the -S
624#        command line option if it was passed.
625#
626# Example:
627#
628# -> { "execute": "cont" }
629# <- { "return": {} }
630#
631##
632{ 'command': 'cont' }
633
634##
635# @x-exit-preconfig:
636#
637# Exit from "preconfig" state
638#
639# This command makes QEMU exit the preconfig state and proceed with
640# VM initialization using configuration data provided on the command line
641# and via the QMP monitor during the preconfig state. The command is only
642# available during the preconfig state (i.e. when the --preconfig command
643# line option was in use).
644#
645# Since 3.0
646#
647# Returns: nothing
648#
649# Example:
650#
651# -> { "execute": "x-exit-preconfig" }
652# <- { "return": {} }
653#
654##
655{ 'command': 'x-exit-preconfig', 'allow-preconfig': true }
656
657##
658# @system_wakeup:
659#
660# Wake up guest from suspend. If the guest has wake-up from suspend
661# support enabled (wakeup-suspend-support flag from
662# query-current-machine), wake-up guest from suspend if the guest is
663# in SUSPENDED state. Return an error otherwise.
664#
665# Since:  1.1
666#
667# Returns:  nothing.
668#
669# Note: prior to 4.0, this command does nothing in case the guest
670#       isn't suspended.
671#
672# Example:
673#
674# -> { "execute": "system_wakeup" }
675# <- { "return": {} }
676#
677##
678{ 'command': 'system_wakeup' }
679
680##
681# @inject-nmi:
682#
683# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
684# The command fails when the guest doesn't support injecting.
685#
686# Returns:  If successful, nothing
687#
688# Since:  0.14.0
689#
690# Note: prior to 2.1, this command was only supported for x86 and s390 VMs
691#
692# Example:
693#
694# -> { "execute": "inject-nmi" }
695# <- { "return": {} }
696#
697##
698{ 'command': 'inject-nmi' }
699
700##
701# @human-monitor-command:
702#
703# Execute a command on the human monitor and return the output.
704#
705# @command-line: the command to execute in the human monitor
706#
707# @cpu-index: The CPU to use for commands that require an implicit CPU
708#
709# Features:
710# @savevm-monitor-nodes: If present, HMP command savevm only snapshots
711#                        monitor-owned nodes if they have no parents.
712#                        This allows the use of 'savevm' with
713#                        -blockdev. (since 4.2)
714#
715# Returns: the output of the command as a string
716#
717# Since: 0.14.0
718#
719# Notes: This command only exists as a stop-gap.  Its use is highly
720#        discouraged.  The semantics of this command are not
721#        guaranteed: this means that command names, arguments and
722#        responses can change or be removed at ANY time.  Applications
723#        that rely on long term stability guarantees should NOT
724#        use this command.
725#
726#        Known limitations:
727#
728#        * This command is stateless, this means that commands that depend
729#          on state information (such as getfd) might not work
730#
731#        * Commands that prompt the user for data don't currently work
732#
733# Example:
734#
735# -> { "execute": "human-monitor-command",
736#      "arguments": { "command-line": "info kvm" } }
737# <- { "return": "kvm support: enabled\r\n" }
738#
739##
740{ 'command': 'human-monitor-command',
741  'data': {'command-line': 'str', '*cpu-index': 'int'},
742  'returns': 'str',
743  'features': [ 'savevm-monitor-nodes' ] }
744
745##
746# @change:
747#
748# This command is multiple commands multiplexed together.
749#
750# @device: This is normally the name of a block device but it may also be 'vnc'.
751#          when it's 'vnc', then sub command depends on @target
752#
753# @target: If @device is a block device, then this is the new filename.
754#          If @device is 'vnc', then if the value 'password' selects the vnc
755#          change password command.   Otherwise, this specifies a new server URI
756#          address to listen to for VNC connections.
757#
758# @arg: If @device is a block device, then this is an optional format to open
759#       the device with.
760#       If @device is 'vnc' and @target is 'password', this is the new VNC
761#       password to set.  See change-vnc-password for additional notes.
762#
763# Features:
764# @deprecated: This command is deprecated.  For changing block
765#              devices, use 'blockdev-change-medium' instead; for changing VNC
766#              parameters, use 'change-vnc-password' instead.
767#
768# Returns: - Nothing on success.
769#          - If @device is not a valid block device, DeviceNotFound
770#
771# Since: 0.14.0
772#
773# Example:
774#
775# 1. Change a removable medium
776#
777# -> { "execute": "change",
778#      "arguments": { "device": "ide1-cd0",
779#                     "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
780# <- { "return": {} }
781#
782# 2. Change VNC password
783#
784# -> { "execute": "change",
785#      "arguments": { "device": "vnc", "target": "password",
786#                     "arg": "foobar1" } }
787# <- { "return": {} }
788#
789##
790{ 'command': 'change',
791  'data': {'device': 'str', 'target': 'str', '*arg': 'str'},
792  'features': [ 'deprecated' ] }
793
794##
795# @xen-set-global-dirty-log:
796#
797# Enable or disable the global dirty log mode.
798#
799# @enable: true to enable, false to disable.
800#
801# Returns: nothing
802#
803# Since: 1.3
804#
805# Example:
806#
807# -> { "execute": "xen-set-global-dirty-log",
808#      "arguments": { "enable": true } }
809# <- { "return": {} }
810#
811##
812{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
813
814##
815# @getfd:
816#
817# Receive a file descriptor via SCM rights and assign it a name
818#
819# @fdname: file descriptor name
820#
821# Returns: Nothing on success
822#
823# Since: 0.14.0
824#
825# Notes: If @fdname already exists, the file descriptor assigned to
826#        it will be closed and replaced by the received file
827#        descriptor.
828#
829#        The 'closefd' command can be used to explicitly close the
830#        file descriptor when it is no longer needed.
831#
832# Example:
833#
834# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
835# <- { "return": {} }
836#
837##
838{ 'command': 'getfd', 'data': {'fdname': 'str'} }
839
840##
841# @closefd:
842#
843# Close a file descriptor previously passed via SCM rights
844#
845# @fdname: file descriptor name
846#
847# Returns: Nothing on success
848#
849# Since: 0.14.0
850#
851# Example:
852#
853# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
854# <- { "return": {} }
855#
856##
857{ 'command': 'closefd', 'data': {'fdname': 'str'} }
858
859##
860# @MemoryInfo:
861#
862# Actual memory information in bytes.
863#
864# @base-memory: size of "base" memory specified with command line
865#               option -m.
866#
867# @plugged-memory: size of memory that can be hot-unplugged. This field
868#                  is omitted if target doesn't support memory hotplug
869#                  (i.e. CONFIG_MEM_DEVICE not defined at build time).
870#
871# Since: 2.11.0
872##
873{ 'struct': 'MemoryInfo',
874  'data'  : { 'base-memory': 'size', '*plugged-memory': 'size' } }
875
876##
877# @query-memory-size-summary:
878#
879# Return the amount of initially allocated and present hotpluggable (if
880# enabled) memory in bytes.
881#
882# Example:
883#
884# -> { "execute": "query-memory-size-summary" }
885# <- { "return": { "base-memory": 4294967296, "plugged-memory": 0 } }
886#
887# Since: 2.11.0
888##
889{ 'command': 'query-memory-size-summary', 'returns': 'MemoryInfo' }
890
891
892##
893# @AddfdInfo:
894#
895# Information about a file descriptor that was added to an fd set.
896#
897# @fdset-id: The ID of the fd set that @fd was added to.
898#
899# @fd: The file descriptor that was received via SCM rights and
900#      added to the fd set.
901#
902# Since: 1.2.0
903##
904{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
905
906##
907# @add-fd:
908#
909# Add a file descriptor, that was passed via SCM rights, to an fd set.
910#
911# @fdset-id: The ID of the fd set to add the file descriptor to.
912#
913# @opaque: A free-form string that can be used to describe the fd.
914#
915# Returns: - @AddfdInfo on success
916#          - If file descriptor was not received, FdNotSupplied
917#          - If @fdset-id is a negative value, InvalidParameterValue
918#
919# Notes: The list of fd sets is shared by all monitor connections.
920#
921#        If @fdset-id is not specified, a new fd set will be created.
922#
923# Since: 1.2.0
924#
925# Example:
926#
927# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
928# <- { "return": { "fdset-id": 1, "fd": 3 } }
929#
930##
931{ 'command': 'add-fd',
932  'data': { '*fdset-id': 'int',
933            '*opaque': 'str' },
934  'returns': 'AddfdInfo' }
935
936##
937# @remove-fd:
938#
939# Remove a file descriptor from an fd set.
940#
941# @fdset-id: The ID of the fd set that the file descriptor belongs to.
942#
943# @fd: The file descriptor that is to be removed.
944#
945# Returns: - Nothing on success
946#          - If @fdset-id or @fd is not found, FdNotFound
947#
948# Since: 1.2.0
949#
950# Notes: The list of fd sets is shared by all monitor connections.
951#
952#        If @fd is not specified, all file descriptors in @fdset-id
953#        will be removed.
954#
955# Example:
956#
957# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
958# <- { "return": {} }
959#
960##
961{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
962
963##
964# @FdsetFdInfo:
965#
966# Information about a file descriptor that belongs to an fd set.
967#
968# @fd: The file descriptor value.
969#
970# @opaque: A free-form string that can be used to describe the fd.
971#
972# Since: 1.2.0
973##
974{ 'struct': 'FdsetFdInfo',
975  'data': {'fd': 'int', '*opaque': 'str'} }
976
977##
978# @FdsetInfo:
979#
980# Information about an fd set.
981#
982# @fdset-id: The ID of the fd set.
983#
984# @fds: A list of file descriptors that belong to this fd set.
985#
986# Since: 1.2.0
987##
988{ 'struct': 'FdsetInfo',
989  'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
990
991##
992# @query-fdsets:
993#
994# Return information describing all fd sets.
995#
996# Returns: A list of @FdsetInfo
997#
998# Since: 1.2.0
999#
1000# Note: The list of fd sets is shared by all monitor connections.
1001#
1002# Example:
1003#
1004# -> { "execute": "query-fdsets" }
1005# <- { "return": [
1006#        {
1007#          "fds": [
1008#            {
1009#              "fd": 30,
1010#              "opaque": "rdonly:/path/to/file"
1011#            },
1012#            {
1013#              "fd": 24,
1014#              "opaque": "rdwr:/path/to/file"
1015#            }
1016#          ],
1017#          "fdset-id": 1
1018#        },
1019#        {
1020#          "fds": [
1021#            {
1022#              "fd": 28
1023#            },
1024#            {
1025#              "fd": 29
1026#            }
1027#          ],
1028#          "fdset-id": 0
1029#        }
1030#      ]
1031#    }
1032#
1033##
1034{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
1035
1036##
1037# @AcpiTableOptions:
1038#
1039# Specify an ACPI table on the command line to load.
1040#
1041# At most one of @file and @data can be specified. The list of files specified
1042# by any one of them is loaded and concatenated in order. If both are omitted,
1043# @data is implied.
1044#
1045# Other fields / optargs can be used to override fields of the generic ACPI
1046# table header; refer to the ACPI specification 5.0, section 5.2.6 System
1047# Description Table Header. If a header field is not overridden, then the
1048# corresponding value from the concatenated blob is used (in case of @file), or
1049# it is filled in with a hard-coded value (in case of @data).
1050#
1051# String fields are copied into the matching ACPI member from lowest address
1052# upwards, and silently truncated / NUL-padded to length.
1053#
1054# @sig: table signature / identifier (4 bytes)
1055#
1056# @rev: table revision number (dependent on signature, 1 byte)
1057#
1058# @oem_id: OEM identifier (6 bytes)
1059#
1060# @oem_table_id: OEM table identifier (8 bytes)
1061#
1062# @oem_rev: OEM-supplied revision number (4 bytes)
1063#
1064# @asl_compiler_id: identifier of the utility that created the table
1065#                   (4 bytes)
1066#
1067# @asl_compiler_rev: revision number of the utility that created the
1068#                    table (4 bytes)
1069#
1070# @file: colon (:) separated list of pathnames to load and
1071#        concatenate as table data. The resultant binary blob is expected to
1072#        have an ACPI table header. At least one file is required. This field
1073#        excludes @data.
1074#
1075# @data: colon (:) separated list of pathnames to load and
1076#        concatenate as table data. The resultant binary blob must not have an
1077#        ACPI table header. At least one file is required. This field excludes
1078#        @file.
1079#
1080# Since: 1.5
1081##
1082{ 'struct': 'AcpiTableOptions',
1083  'data': {
1084    '*sig':               'str',
1085    '*rev':               'uint8',
1086    '*oem_id':            'str',
1087    '*oem_table_id':      'str',
1088    '*oem_rev':           'uint32',
1089    '*asl_compiler_id':   'str',
1090    '*asl_compiler_rev':  'uint32',
1091    '*file':              'str',
1092    '*data':              'str' }}
1093
1094##
1095# @CommandLineParameterType:
1096#
1097# Possible types for an option parameter.
1098#
1099# @string: accepts a character string
1100#
1101# @boolean: accepts "on" or "off"
1102#
1103# @number: accepts a number
1104#
1105# @size: accepts a number followed by an optional suffix (K)ilo,
1106#        (M)ega, (G)iga, (T)era
1107#
1108# Since: 1.5
1109##
1110{ 'enum': 'CommandLineParameterType',
1111  'data': ['string', 'boolean', 'number', 'size'] }
1112
1113##
1114# @CommandLineParameterInfo:
1115#
1116# Details about a single parameter of a command line option.
1117#
1118# @name: parameter name
1119#
1120# @type: parameter @CommandLineParameterType
1121#
1122# @help: human readable text string, not suitable for parsing.
1123#
1124# @default: default value string (since 2.1)
1125#
1126# Since: 1.5
1127##
1128{ 'struct': 'CommandLineParameterInfo',
1129  'data': { 'name': 'str',
1130            'type': 'CommandLineParameterType',
1131            '*help': 'str',
1132            '*default': 'str' } }
1133
1134##
1135# @CommandLineOptionInfo:
1136#
1137# Details about a command line option, including its list of parameter details
1138#
1139# @option: option name
1140#
1141# @parameters: an array of @CommandLineParameterInfo
1142#
1143# Since: 1.5
1144##
1145{ 'struct': 'CommandLineOptionInfo',
1146  'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
1147
1148##
1149# @query-command-line-options:
1150#
1151# Query command line option schema.
1152#
1153# @option: option name
1154#
1155# Returns: list of @CommandLineOptionInfo for all options (or for the given
1156#          @option).  Returns an error if the given @option doesn't exist.
1157#
1158# Since: 1.5
1159#
1160# Example:
1161#
1162# -> { "execute": "query-command-line-options",
1163#      "arguments": { "option": "option-rom" } }
1164# <- { "return": [
1165#         {
1166#             "parameters": [
1167#                 {
1168#                     "name": "romfile",
1169#                     "type": "string"
1170#                 },
1171#                 {
1172#                     "name": "bootindex",
1173#                     "type": "number"
1174#                 }
1175#             ],
1176#             "option": "option-rom"
1177#         }
1178#      ]
1179#    }
1180#
1181##
1182{'command': 'query-command-line-options',
1183 'data': { '*option': 'str' },
1184 'returns': ['CommandLineOptionInfo'],
1185 'allow-preconfig': true }
1186
1187##
1188# @PCDIMMDeviceInfo:
1189#
1190# PCDIMMDevice state information
1191#
1192# @id: device's ID
1193#
1194# @addr: physical address, where device is mapped
1195#
1196# @size: size of memory that the device provides
1197#
1198# @slot: slot number at which device is plugged in
1199#
1200# @node: NUMA node number where device is plugged in
1201#
1202# @memdev: memory backend linked with device
1203#
1204# @hotplugged: true if device was hotplugged
1205#
1206# @hotpluggable: true if device if could be added/removed while machine is running
1207#
1208# Since: 2.1
1209##
1210{ 'struct': 'PCDIMMDeviceInfo',
1211  'data': { '*id': 'str',
1212            'addr': 'int',
1213            'size': 'int',
1214            'slot': 'int',
1215            'node': 'int',
1216            'memdev': 'str',
1217            'hotplugged': 'bool',
1218            'hotpluggable': 'bool'
1219          }
1220}
1221
1222##
1223# @VirtioPMEMDeviceInfo:
1224#
1225# VirtioPMEM state information
1226#
1227# @id: device's ID
1228#
1229# @memaddr: physical address in memory, where device is mapped
1230#
1231# @size: size of memory that the device provides
1232#
1233# @memdev: memory backend linked with device
1234#
1235# Since: 4.1
1236##
1237{ 'struct': 'VirtioPMEMDeviceInfo',
1238  'data': { '*id': 'str',
1239            'memaddr': 'size',
1240            'size': 'size',
1241            'memdev': 'str'
1242          }
1243}
1244
1245##
1246# @VirtioMEMDeviceInfo:
1247#
1248# VirtioMEMDevice state information
1249#
1250# @id: device's ID
1251#
1252# @memaddr: physical address in memory, where device is mapped
1253#
1254# @requested-size: the user requested size of the device
1255#
1256# @size: the (current) size of memory that the device provides
1257#
1258# @max-size: the maximum size of memory that the device can provide
1259#
1260# @block-size: the block size of memory that the device provides
1261#
1262# @node: NUMA node number where device is assigned to
1263#
1264# @memdev: memory backend linked with the region
1265#
1266# Since: 5.1
1267##
1268{ 'struct': 'VirtioMEMDeviceInfo',
1269  'data': { '*id': 'str',
1270            'memaddr': 'size',
1271            'requested-size': 'size',
1272            'size': 'size',
1273            'max-size': 'size',
1274            'block-size': 'size',
1275            'node': 'int',
1276            'memdev': 'str'
1277          }
1278}
1279
1280##
1281# @MemoryDeviceInfo:
1282#
1283# Union containing information about a memory device
1284#
1285# nvdimm is included since 2.12. virtio-pmem is included since 4.1.
1286# virtio-mem is included since 5.1.
1287#
1288# Since: 2.1
1289##
1290{ 'union': 'MemoryDeviceInfo',
1291  'data': { 'dimm': 'PCDIMMDeviceInfo',
1292            'nvdimm': 'PCDIMMDeviceInfo',
1293            'virtio-pmem': 'VirtioPMEMDeviceInfo',
1294            'virtio-mem': 'VirtioMEMDeviceInfo'
1295          }
1296}
1297
1298##
1299# @query-memory-devices:
1300#
1301# Lists available memory devices and their state
1302#
1303# Since: 2.1
1304#
1305# Example:
1306#
1307# -> { "execute": "query-memory-devices" }
1308# <- { "return": [ { "data":
1309#                       { "addr": 5368709120,
1310#                         "hotpluggable": true,
1311#                         "hotplugged": true,
1312#                         "id": "d1",
1313#                         "memdev": "/objects/memX",
1314#                         "node": 0,
1315#                         "size": 1073741824,
1316#                         "slot": 0},
1317#                    "type": "dimm"
1318#                  } ] }
1319#
1320##
1321{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
1322
1323##
1324# @MEMORY_DEVICE_SIZE_CHANGE:
1325#
1326# Emitted when the size of a memory device changes. Only emitted for memory
1327# devices that can actually change the size (e.g., virtio-mem due to guest
1328# action).
1329#
1330# @id: device's ID
1331# @size: the new size of memory that the device provides
1332#
1333# Note: this event is rate-limited.
1334#
1335# Since: 5.1
1336#
1337# Example:
1338#
1339# <- { "event": "MEMORY_DEVICE_SIZE_CHANGE",
1340#      "data": { "id": "vm0", "size": 1073741824},
1341#      "timestamp": { "seconds": 1588168529, "microseconds": 201316 } }
1342#
1343##
1344{ 'event': 'MEMORY_DEVICE_SIZE_CHANGE',
1345  'data': { '*id': 'str', 'size': 'size' } }
1346
1347
1348##
1349# @MEM_UNPLUG_ERROR:
1350#
1351# Emitted when memory hot unplug error occurs.
1352#
1353# @device: device name
1354#
1355# @msg: Informative message
1356#
1357# Since: 2.4
1358#
1359# Example:
1360#
1361# <- { "event": "MEM_UNPLUG_ERROR"
1362#      "data": { "device": "dimm1",
1363#                "msg": "acpi: device unplug for unsupported device"
1364#      },
1365#      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
1366#
1367##
1368{ 'event': 'MEM_UNPLUG_ERROR',
1369  'data': { 'device': 'str', 'msg': 'str' } }
1370
1371##
1372# @ACPISlotType:
1373#
1374# @DIMM: memory slot
1375# @CPU: logical CPU slot (since 2.7)
1376##
1377{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
1378
1379##
1380# @ACPIOSTInfo:
1381#
1382# OSPM Status Indication for a device
1383# For description of possible values of @source and @status fields
1384# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
1385#
1386# @device: device ID associated with slot
1387#
1388# @slot: slot ID, unique per slot of a given @slot-type
1389#
1390# @slot-type: type of the slot
1391#
1392# @source: an integer containing the source event
1393#
1394# @status: an integer containing the status code
1395#
1396# Since: 2.1
1397##
1398{ 'struct': 'ACPIOSTInfo',
1399  'data'  : { '*device': 'str',
1400              'slot': 'str',
1401              'slot-type': 'ACPISlotType',
1402              'source': 'int',
1403              'status': 'int' } }
1404
1405##
1406# @query-acpi-ospm-status:
1407#
1408# Return a list of ACPIOSTInfo for devices that support status
1409# reporting via ACPI _OST method.
1410#
1411# Since: 2.1
1412#
1413# Example:
1414#
1415# -> { "execute": "query-acpi-ospm-status" }
1416# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
1417#                  { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
1418#                  { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
1419#                  { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
1420#    ]}
1421#
1422##
1423{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
1424
1425##
1426# @ACPI_DEVICE_OST:
1427#
1428# Emitted when guest executes ACPI _OST method.
1429#
1430# @info: OSPM Status Indication
1431#
1432# Since: 2.1
1433#
1434# Example:
1435#
1436# <- { "event": "ACPI_DEVICE_OST",
1437#      "data": { "device": "d1", "slot": "0",
1438#                "slot-type": "DIMM", "source": 1, "status": 0 } }
1439#
1440##
1441{ 'event': 'ACPI_DEVICE_OST',
1442     'data': { 'info': 'ACPIOSTInfo' } }
1443
1444##
1445# @ReplayMode:
1446#
1447# Mode of the replay subsystem.
1448#
1449# @none: normal execution mode. Replay or record are not enabled.
1450#
1451# @record: record mode. All non-deterministic data is written into the
1452#          replay log.
1453#
1454# @play: replay mode. Non-deterministic data required for system execution
1455#        is read from the log.
1456#
1457# Since: 2.5
1458##
1459{ 'enum': 'ReplayMode',
1460  'data': [ 'none', 'record', 'play' ] }
1461
1462##
1463# @xen-load-devices-state:
1464#
1465# Load the state of all devices from file. The RAM and the block devices
1466# of the VM are not loaded by this command.
1467#
1468# @filename: the file to load the state of the devices from as binary
1469#            data. See xen-save-devices-state.txt for a description of the binary
1470#            format.
1471#
1472# Since: 2.7
1473#
1474# Example:
1475#
1476# -> { "execute": "xen-load-devices-state",
1477#      "arguments": { "filename": "/tmp/resume" } }
1478# <- { "return": {} }
1479#
1480##
1481{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
1482