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