qmp: query-block: add 'encryption_key_missing' field
[qemu/ar7.git] / qapi-schema.json
bloba62bf6867b32013b919a4307e968fc5264768a50
1 # -*- Mode: Python -*-
3 # QAPI Schema
5 ##
6 # @NameInfo:
8 # Guest name information.
10 # @name: #optional The name of the guest
12 # Since 0.14.0
14 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
17 # @query-name:
19 # Return the name information of a guest.
21 # Returns: @NameInfo of the guest
23 # Since 0.14.0
25 { 'command': 'query-name', 'returns': 'NameInfo' }
28 # @VersionInfo:
30 # A description of QEMU's version.
32 # @qemu.major:  The major version of QEMU
34 # @qemu.minor:  The minor version of QEMU
36 # @qemu.micro:  The micro version of QEMU.  By current convention, a micro
37 #               version of 50 signifies a development branch.  A micro version
38 #               greater than or equal to 90 signifies a release candidate for
39 #               the next minor version.  A micro version of less than 50
40 #               signifies a stable release.
42 # @package:     QEMU will always set this field to an empty string.  Downstream
43 #               versions of QEMU should set this to a non-empty string.  The
44 #               exact format depends on the downstream however it highly
45 #               recommended that a unique name is used.
47 # Since: 0.14.0
49 { 'type': 'VersionInfo',
50   'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
51            'package': 'str'} }
54 # @query-version:
56 # Returns the current version of QEMU.
58 # Returns:  A @VersionInfo object describing the current version of QEMU.
60 # Since: 0.14.0
62 { 'command': 'query-version', 'returns': 'VersionInfo' }
65 # @KvmInfo:
67 # Information about support for KVM acceleration
69 # @enabled: true if KVM acceleration is active
71 # @present: true if KVM acceleration is built into this executable
73 # Since: 0.14.0
75 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
78 # @query-kvm:
80 # Returns information about KVM acceleration
82 # Returns: @KvmInfo
84 # Since: 0.14.0
86 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
89 # @RunState
91 # An enumation of VM run states.
93 # @debug: QEMU is running on a debugger
95 # @finish-migrate: guest is paused to finish the migration process
97 # @inmigrate: guest is paused waiting for an incoming migration
99 # @internal-error: An internal error that prevents further guest execution
100 # has occurred
102 # @io-error: the last IOP has failed and the device is configured to pause
103 # on I/O errors
105 # @paused: guest has been paused via the 'stop' command
107 # @postmigrate: guest is paused following a successful 'migrate'
109 # @prelaunch: QEMU was started with -S and guest has not started
111 # @restore-vm: guest is paused to restore VM state
113 # @running: guest is actively running
115 # @save-vm: guest is paused to save the VM state
117 # @shutdown: guest is shut down (and -no-shutdown is in use)
119 # @suspended: guest is suspended (ACPI S3)
121 # @watchdog: the watchdog action is configured to pause and has been triggered
123 { 'enum': 'RunState',
124   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
125             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
126             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
129 # @StatusInfo:
131 # Information about VCPU run state
133 # @running: true if all VCPUs are runnable, false if not runnable
135 # @singlestep: true if VCPUs are in single-step mode
137 # @status: the virtual machine @RunState
139 # Since:  0.14.0
141 # Notes: @singlestep is enabled through the GDB stub
143 { 'type': 'StatusInfo',
144   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
147 # @query-status:
149 # Query the run status of all VCPUs
151 # Returns: @StatusInfo reflecting all VCPUs
153 # Since:  0.14.0
155 { 'command': 'query-status', 'returns': 'StatusInfo' }
158 # @UuidInfo:
160 # Guest UUID information.
162 # @UUID: the UUID of the guest
164 # Since: 0.14.0
166 # Notes: If no UUID was specified for the guest, a null UUID is returned.
168 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
171 # @query-uuid:
173 # Query the guest UUID information.
175 # Returns: The @UuidInfo for the guest
177 # Since 0.14.0
179 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
182 # @ChardevInfo:
184 # Information about a character device.
186 # @label: the label of the character device
188 # @filename: the filename of the character device
190 # Notes: @filename is encoded using the QEMU command line character device
191 #        encoding.  See the QEMU man page for details.
193 # Since: 0.14.0
195 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
198 # @query-chardev:
200 # Returns information about current character devices.
202 # Returns: a list of @ChardevInfo
204 # Since: 0.14.0
206 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
209 # @CommandInfo:
211 # Information about a QMP command
213 # @name: The command name
215 # Since: 0.14.0
217 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
220 # @query-commands:
222 # Return a list of supported QMP commands by this server
224 # Returns: A list of @CommandInfo for all supported commands
226 # Since: 0.14.0
228 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
231 # @EventInfo:
233 # Information about a QMP event
235 # @name: The event name
237 # Since: 1.2.0
239 { 'type': 'EventInfo', 'data': {'name': 'str'} }
242 # @query-events:
244 # Return a list of supported QMP events by this server
246 # Returns: A list of @EventInfo for all supported events
248 # Since: 1.2.0
250 { 'command': 'query-events', 'returns': ['EventInfo'] }
253 # @MigrationStats
255 # Detailed migration status.
257 # @transferred: amount of bytes already transferred to the target VM
259 # @remaining: amount of bytes remaining to be transferred to the target VM
261 # @total: total amount of bytes involved in the migration process
263 # @total_time: tota0l amount of ms since migration started.  If
264 #        migration has ended, it returns the total migration
265 #        time. (since 1.2)
267 # Since: 0.14.0.
269 { 'type': 'MigrationStats',
270   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
271            'total_time': 'int' } }
274 # @MigrationInfo
276 # Information about current migration process.
278 # @status: #optional string describing the current migration status.
279 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
280 #          'cancelled'. If this field is not returned, no migration process
281 #          has been initiated
283 # @ram: #optional @MigrationStats containing detailed migration
284 #       status, only returned if status is 'active' or
285 #       'completed'. 'comppleted' (since 1.2)
287 # @disk: #optional @MigrationStats containing detailed disk migration
288 #        status, only returned if status is 'active' and it is a block
289 #        migration
291 # Since: 0.14.0
293 { 'type': 'MigrationInfo',
294   'data': {'*status': 'str', '*ram': 'MigrationStats',
295            '*disk': 'MigrationStats'} }
298 # @query-migrate
300 # Returns information about current migration process.
302 # Returns: @MigrationInfo
304 # Since: 0.14.0
306 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
309 # @MouseInfo:
311 # Information about a mouse device.
313 # @name: the name of the mouse device
315 # @index: the index of the mouse device
317 # @current: true if this device is currently receiving mouse events
319 # @absolute: true if this device supports absolute coordinates as input
321 # Since: 0.14.0
323 { 'type': 'MouseInfo',
324   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
325            'absolute': 'bool'} }
328 # @query-mice:
330 # Returns information about each active mouse device
332 # Returns: a list of @MouseInfo for each device
334 # Since: 0.14.0
336 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
339 # @CpuInfo:
341 # Information about a virtual CPU
343 # @CPU: the index of the virtual CPU
345 # @current: this only exists for backwards compatible and should be ignored
347 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
348 #          to a processor specific low power mode.
350 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
351 #                pointer.
352 #                If the target is Sparc, this is the PC component of the
353 #                instruction pointer.
355 # @nip: #optional If the target is PPC, the instruction pointer
357 # @npc: #optional If the target is Sparc, the NPC component of the instruction
358 #                 pointer
360 # @PC: #optional If the target is MIPS, the instruction pointer
362 # @thread_id: ID of the underlying host thread
364 # Since: 0.14.0
366 # Notes: @halted is a transient state that changes frequently.  By the time the
367 #        data is sent to the client, the guest may no longer be halted.
369 { 'type': 'CpuInfo',
370   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
371            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
374 # @query-cpus:
376 # Returns a list of information about each virtual CPU.
378 # Returns: a list of @CpuInfo for each virtual CPU
380 # Since: 0.14.0
382 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
385 # @BlockDeviceInfo:
387 # Information about the backing device for a block device.
389 # @file: the filename of the backing device
391 # @ro: true if the backing device was open read-only
393 # @drv: the name of the block format used to open the backing device. As of
394 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
395 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
396 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
397 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
399 # @backing_file: #optional the name of the backing file (for copy-on-write)
401 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
403 # @encrypted: true if the backing device is encrypted
405 # @encryption_key_missing: true if the backing device is encrypted but an
406 #                          valid encryption key is missing
408 # @bps: total throughput limit in bytes per second is specified
410 # @bps_rd: read throughput limit in bytes per second is specified
412 # @bps_wr: write throughput limit in bytes per second is specified
414 # @iops: total I/O operations per second is specified
416 # @iops_rd: read I/O operations per second is specified
418 # @iops_wr: write I/O operations per second is specified
420 # Since: 0.14.0
422 # Notes: This interface is only found in @BlockInfo.
424 { 'type': 'BlockDeviceInfo',
425   'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
426             '*backing_file': 'str', 'backing_file_depth': 'int',
427             'encrypted': 'bool', 'encryption_key_missing': 'bool',
428             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
429             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
432 # @BlockDeviceIoStatus:
434 # An enumeration of block device I/O status.
436 # @ok: The last I/O operation has succeeded
438 # @failed: The last I/O operation has failed
440 # @nospace: The last I/O operation has failed due to a no-space condition
442 # Since: 1.0
444 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
447 # @BlockInfo:
449 # Block device information.  This structure describes a virtual device and
450 # the backing device associated with it.
452 # @device: The device name associated with the virtual device.
454 # @type: This field is returned only for compatibility reasons, it should
455 #        not be used (always returns 'unknown')
457 # @removable: True if the device supports removable media.
459 # @locked: True if the guest has locked this device from having its media
460 #          removed
462 # @tray_open: #optional True if the device has a tray and it is open
463 #             (only present if removable is true)
465 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
466 #             supports it and the VM is configured to stop on errors
468 # @inserted: #optional @BlockDeviceInfo describing the device if media is
469 #            present
471 # Since:  0.14.0
473 { 'type': 'BlockInfo',
474   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
475            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
476            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus'} }
479 # @query-block:
481 # Get a list of BlockInfo for all virtual block devices.
483 # Returns: a list of @BlockInfo describing each virtual block device
485 # Since: 0.14.0
487 { 'command': 'query-block', 'returns': ['BlockInfo'] }
490 # @BlockDeviceStats:
492 # Statistics of a virtual block device or a block backing device.
494 # @rd_bytes:      The number of bytes read by the device.
496 # @wr_bytes:      The number of bytes written by the device.
498 # @rd_operations: The number of read operations performed by the device.
500 # @wr_operations: The number of write operations performed by the device.
502 # @flush_operations: The number of cache flush operations performed by the
503 #                    device (since 0.15.0)
505 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
506 #                       (since 0.15.0).
508 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
510 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
512 # @wr_highest_offset: The offset after the greatest byte written to the
513 #                     device.  The intended use of this information is for
514 #                     growable sparse files (like qcow2) that are used on top
515 #                     of a physical device.
517 # Since: 0.14.0
519 { 'type': 'BlockDeviceStats',
520   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
521            'wr_operations': 'int', 'flush_operations': 'int',
522            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
523            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
526 # @BlockStats:
528 # Statistics of a virtual block device or a block backing device.
530 # @device: #optional If the stats are for a virtual block device, the name
531 #          corresponding to the virtual block device.
533 # @stats:  A @BlockDeviceStats for the device.
535 # @parent: #optional This may point to the backing block device if this is a
536 #          a virtual block device.  If it's a backing block, this will point
537 #          to the backing file is one is present.
539 # Since: 0.14.0
541 { 'type': 'BlockStats',
542   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
543            '*parent': 'BlockStats'} }
546 # @query-blockstats:
548 # Query the @BlockStats for all virtual block devices.
550 # Returns: A list of @BlockStats for each virtual block devices.
552 # Since: 0.14.0
554 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
557 # @VncClientInfo:
559 # Information about a connected VNC client.
561 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
562 #        when possible.
564 # @family: 'ipv6' if the client is connected via IPv6 and TCP
565 #          'ipv4' if the client is connected via IPv4 and TCP
566 #          'unix' if the client is connected via a unix domain socket
567 #          'unknown' otherwise
569 # @service: The service name of the client's port.  This may depends on the
570 #           host system's service database so symbolic names should not be
571 #           relied on.
573 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
574 #              Name of the client.
576 # @sasl_username: #optional If SASL authentication is in use, the SASL username
577 #                 used for authentication.
579 # Since: 0.14.0
581 { 'type': 'VncClientInfo',
582   'data': {'host': 'str', 'family': 'str', 'service': 'str',
583            '*x509_dname': 'str', '*sasl_username': 'str'} }
586 # @VncInfo:
588 # Information about the VNC session.
590 # @enabled: true if the VNC server is enabled, false otherwise
592 # @host: #optional The hostname the VNC server is bound to.  This depends on
593 #        the name resolution on the host and may be an IP address.
595 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
596 #                    'ipv4' if the host is listening for IPv4 connections
597 #                    'unix' if the host is listening on a unix domain socket
598 #                    'unknown' otherwise
600 # @service: #optional The service name of the server's port.  This may depends
601 #           on the host system's service database so symbolic names should not
602 #           be relied on.
604 # @auth: #optional the current authentication type used by the server
605 #        'none' if no authentication is being used
606 #        'vnc' if VNC authentication is being used
607 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
608 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
609 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
610 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
611 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
612 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
613 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
614 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
615 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
617 # @clients: a list of @VncClientInfo of all currently connected clients
619 # Since: 0.14.0
621 { 'type': 'VncInfo',
622   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
623            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
626 # @query-vnc:
628 # Returns information about the current VNC server
630 # Returns: @VncInfo
631 #          If VNC support is not compiled in, FeatureDisabled
633 # Since: 0.14.0
635 { 'command': 'query-vnc', 'returns': 'VncInfo' }
638 # @SpiceChannel
640 # Information about a SPICE client channel.
642 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
643 #        when possible.
645 # @family: 'ipv6' if the client is connected via IPv6 and TCP
646 #          'ipv4' if the client is connected via IPv4 and TCP
647 #          'unix' if the client is connected via a unix domain socket
648 #          'unknown' otherwise
650 # @port: The client's port number.
652 # @connection-id: SPICE connection id number.  All channels with the same id
653 #                 belong to the same SPICE session.
655 # @connection-type: SPICE channel type number.  "1" is the main control
656 #                   channel, filter for this one if you want to track spice
657 #                   sessions only
659 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
660 #              multiple channels of the same type exist, such as multiple
661 #              display channels in a multihead setup
663 # @tls: true if the channel is encrypted, false otherwise.
665 # Since: 0.14.0
667 { 'type': 'SpiceChannel',
668   'data': {'host': 'str', 'family': 'str', 'port': 'str',
669            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
670            'tls': 'bool'} }
673 # @SpiceQueryMouseMode
675 # An enumation of Spice mouse states.
677 # @client: Mouse cursor position is determined by the client.
679 # @server: Mouse cursor position is determined by the server.
681 # @unknown: No information is available about mouse mode used by
682 #           the spice server.
684 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
686 # Since: 1.1
688 { 'enum': 'SpiceQueryMouseMode',
689   'data': [ 'client', 'server', 'unknown' ] }
692 # @SpiceInfo
694 # Information about the SPICE session.
696 # @enabled: true if the SPICE server is enabled, false otherwise
698 # @host: #optional The hostname the SPICE server is bound to.  This depends on
699 #        the name resolution on the host and may be an IP address.
701 # @port: #optional The SPICE server's port number.
703 # @compiled-version: #optional SPICE server version.
705 # @tls-port: #optional The SPICE server's TLS port number.
707 # @auth: #optional the current authentication type used by the server
708 #        'none'  if no authentication is being used
709 #        'spice' uses SASL or direct TLS authentication, depending on command
710 #                line options
712 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
713 #              be determined by the client or the server, or unknown if spice
714 #              server doesn't provide this information.
716 #              Since: 1.1
718 # @channels: a list of @SpiceChannel for each active spice channel
720 # Since: 0.14.0
722 { 'type': 'SpiceInfo',
723   'data': {'enabled': 'bool', '*host': 'str', '*port': 'int',
724            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
725            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
728 # @query-spice
730 # Returns information about the current SPICE server
732 # Returns: @SpiceInfo
734 # Since: 0.14.0
736 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
739 # @BalloonInfo:
741 # Information about the guest balloon device.
743 # @actual: the number of bytes the balloon currently contains
745 # @mem_swapped_in: #optional number of pages swapped in within the guest
747 # @mem_swapped_out: #optional number of pages swapped out within the guest
749 # @major_page_faults: #optional number of major page faults within the guest
751 # @minor_page_faults: #optional number of minor page faults within the guest
753 # @free_mem: #optional amount of memory (in bytes) free in the guest
755 # @total_mem: #optional amount of memory (in bytes) visible to the guest
757 # Since: 0.14.0
759 # Notes: all current versions of QEMU do not fill out optional information in
760 #        this structure.
762 { 'type': 'BalloonInfo',
763   'data': {'actual': 'int', '*mem_swapped_in': 'int',
764            '*mem_swapped_out': 'int', '*major_page_faults': 'int',
765            '*minor_page_faults': 'int', '*free_mem': 'int',
766            '*total_mem': 'int'} }
769 # @query-balloon:
771 # Return information about the balloon device.
773 # Returns: @BalloonInfo on success
774 #          If the balloon driver is enabled but not functional because the KVM
775 #          kernel module cannot support it, KvmMissingCap
776 #          If no balloon device is present, DeviceNotActive
778 # Since: 0.14.0
780 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
783 # @PciMemoryRange:
785 # A PCI device memory region
787 # @base: the starting address (guest physical)
789 # @limit: the ending address (guest physical)
791 # Since: 0.14.0
793 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
796 # @PciMemoryRegion
798 # Information about a PCI device I/O region.
800 # @bar: the index of the Base Address Register for this region
802 # @type: 'io' if the region is a PIO region
803 #        'memory' if the region is a MMIO region
805 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
807 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
809 # Since: 0.14.0
811 { 'type': 'PciMemoryRegion',
812   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
813            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
816 # @PciBridgeInfo:
818 # Information about a PCI Bridge device
820 # @bus.number: primary bus interface number.  This should be the number of the
821 #              bus the device resides on.
823 # @bus.secondary: secondary bus interface number.  This is the number of the
824 #                 main bus for the bridge
826 # @bus.subordinate: This is the highest number bus that resides below the
827 #                   bridge.
829 # @bus.io_range: The PIO range for all devices on this bridge
831 # @bus.memory_range: The MMIO range for all devices on this bridge
833 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
834 #                          this bridge
836 # @devices: a list of @PciDeviceInfo for each device on this bridge
838 # Since: 0.14.0
840 { 'type': 'PciBridgeInfo',
841   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
842                     'io_range': 'PciMemoryRange',
843                     'memory_range': 'PciMemoryRange',
844                     'prefetchable_range': 'PciMemoryRange' },
845            '*devices': ['PciDeviceInfo']} }
848 # @PciDeviceInfo:
850 # Information about a PCI device
852 # @bus: the bus number of the device
854 # @slot: the slot the device is located in
856 # @function: the function of the slot used by the device
858 # @class_info.desc: #optional a string description of the device's class
860 # @class_info.class: the class code of the device
862 # @id.device: the PCI device id
864 # @id.vendor: the PCI vendor id
866 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
868 # @qdev_id: the device name of the PCI device
870 # @pci_bridge: if the device is a PCI bridge, the bridge information
872 # @regions: a list of the PCI I/O regions associated with the device
874 # Notes: the contents of @class_info.desc are not stable and should only be
875 #        treated as informational.
877 # Since: 0.14.0
879 { 'type': 'PciDeviceInfo',
880   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
881            'class_info': {'*desc': 'str', 'class': 'int'},
882            'id': {'device': 'int', 'vendor': 'int'},
883            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
884            'regions': ['PciMemoryRegion']} }
887 # @PciInfo:
889 # Information about a PCI bus
891 # @bus: the bus index
893 # @devices: a list of devices on this bus
895 # Since: 0.14.0
897 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
900 # @query-pci:
902 # Return information about the PCI bus topology of the guest.
904 # Returns: a list of @PciInfo for each PCI bus
906 # Since: 0.14.0
908 { 'command': 'query-pci', 'returns': ['PciInfo'] }
911 # @BlockJobInfo:
913 # Information about a long-running block device operation.
915 # @type: the job type ('stream' for image streaming)
917 # @device: the block device name
919 # @len: the maximum progress value
921 # @offset: the current progress value
923 # @speed: the rate limit, bytes per second
925 # Since: 1.1
927 { 'type': 'BlockJobInfo',
928   'data': {'type': 'str', 'device': 'str', 'len': 'int',
929            'offset': 'int', 'speed': 'int'} }
932 # @query-block-jobs:
934 # Return information about long-running block device operations.
936 # Returns: a list of @BlockJobInfo for each active block job
938 # Since: 1.1
940 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
943 # @quit:
945 # This command will cause the QEMU process to exit gracefully.  While every
946 # attempt is made to send the QMP response before terminating, this is not
947 # guaranteed.  When using this interface, a premature EOF would not be
948 # unexpected.
950 # Since: 0.14.0
952 { 'command': 'quit' }
955 # @stop:
957 # Stop all guest VCPU execution.
959 # Since:  0.14.0
961 # Notes:  This function will succeed even if the guest is already in the stopped
962 #         state
964 { 'command': 'stop' }
967 # @system_reset:
969 # Performs a hard reset of a guest.
971 # Since: 0.14.0
973 { 'command': 'system_reset' }
976 # @system_powerdown:
978 # Requests that a guest perform a powerdown operation.
980 # Since: 0.14.0
982 # Notes: A guest may or may not respond to this command.  This command
983 #        returning does not indicate that a guest has accepted the request or
984 #        that it has shut down.  Many guests will respond to this command by
985 #        prompting the user in some way.
987 { 'command': 'system_powerdown' }
990 # @cpu:
992 # This command is a nop that is only provided for the purposes of compatibility.
994 # Since: 0.14.0
996 # Notes: Do not use this command.
998 { 'command': 'cpu', 'data': {'index': 'int'} }
1001 # @memsave:
1003 # Save a portion of guest memory to a file.
1005 # @val: the virtual address of the guest to start from
1007 # @size: the size of memory region to save
1009 # @filename: the file to save the memory to as binary data
1011 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1012 #                       virtual address (defaults to CPU 0)
1014 # Returns: Nothing on success
1015 #          If @cpu is not a valid VCPU, InvalidParameterValue
1016 #          If @filename cannot be opened, OpenFileFailed
1017 #          If an I/O error occurs while writing the file, IOError
1019 # Since: 0.14.0
1021 # Notes: Errors were not reliably returned until 1.1
1023 { 'command': 'memsave',
1024   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1027 # @pmemsave:
1029 # Save a portion of guest physical memory to a file.
1031 # @val: the physical address of the guest to start from
1033 # @size: the size of memory region to save
1035 # @filename: the file to save the memory to as binary data
1037 # Returns: Nothing on success
1038 #          If @filename cannot be opened, OpenFileFailed
1039 #          If an I/O error occurs while writing the file, IOError
1041 # Since: 0.14.0
1043 # Notes: Errors were not reliably returned until 1.1
1045 { 'command': 'pmemsave',
1046   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1049 # @cont:
1051 # Resume guest VCPU execution.
1053 # Since:  0.14.0
1055 # Returns:  If successful, nothing
1056 #           If the QEMU is waiting for an incoming migration, MigrationExpected
1057 #           If QEMU was started with an encrypted block device and a key has
1058 #              not yet been set, DeviceEncrypted.
1060 # Notes:  This command will succeed if the guest is currently running.
1062 { 'command': 'cont' }
1065 # @system_wakeup:
1067 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1069 # Since:  1.1
1071 # Returns:  nothing.
1073 { 'command': 'system_wakeup' }
1076 # @inject-nmi:
1078 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1080 # Returns:  If successful, nothing
1081 #           If the Virtual Machine doesn't support NMI injection, Unsupported
1083 # Since:  0.14.0
1085 # Notes: Only x86 Virtual Machines support this command.
1087 { 'command': 'inject-nmi' }
1090 # @set_link:
1092 # Sets the link status of a virtual network adapter.
1094 # @name: the device name of the virtual network adapter
1096 # @up: true to set the link status to be up
1098 # Returns: Nothing on success
1099 #          If @name is not a valid network device, DeviceNotFound
1101 # Since: 0.14.0
1103 # Notes: Not all network adapters support setting link status.  This command
1104 #        will succeed even if the network adapter does not support link status
1105 #        notification.
1107 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1110 # @block_passwd:
1112 # This command sets the password of a block device that has not been open
1113 # with a password and requires one.
1115 # The two cases where this can happen are a block device is created through
1116 # QEMU's initial command line or a block device is changed through the legacy
1117 # @change interface.
1119 # In the event that the block device is created through the initial command
1120 # line, the VM will start in the stopped state regardless of whether '-S' is
1121 # used.  The intention is for a management tool to query the block devices to
1122 # determine which ones are encrypted, set the passwords with this command, and
1123 # then start the guest with the @cont command.
1125 # @device:   the name of the device to set the password on
1127 # @password: the password to use for the device
1129 # Returns: nothing on success
1130 #          If @device is not a valid block device, DeviceNotFound
1131 #          If @device is not encrypted, DeviceNotEncrypted
1132 #          If @password is not valid for this device, InvalidPassword
1134 # Notes:  Not all block formats support encryption and some that do are not
1135 #         able to validate that a password is correct.  Disk corruption may
1136 #         occur if an invalid password is specified.
1138 # Since: 0.14.0
1140 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1143 # @balloon:
1145 # Request the balloon driver to change its balloon size.
1147 # @value: the target size of the balloon in bytes
1149 # Returns: Nothing on success
1150 #          If the balloon driver is enabled but not functional because the KVM
1151 #            kernel module cannot support it, KvmMissingCap
1152 #          If no balloon device is present, DeviceNotActive
1154 # Notes: This command just issues a request to the guest.  When it returns,
1155 #        the balloon size may not have changed.  A guest can change the balloon
1156 #        size independent of this command.
1158 # Since: 0.14.0
1160 { 'command': 'balloon', 'data': {'value': 'int'} }
1163 # @block_resize
1165 # Resize a block image while a guest is running.
1167 # @device:  the name of the device to get the image resized
1169 # @size:  new image size in bytes
1171 # Returns: nothing on success
1172 #          If @device is not a valid block device, DeviceNotFound
1173 #          If @size is negative, InvalidParameterValue
1174 #          If the block device has no medium inserted, DeviceHasNoMedium
1175 #          If the block device does not support resize, Unsupported
1176 #          If the block device is read-only, DeviceIsReadOnly
1177 #          If a long-running operation is using the device, DeviceInUse
1179 # Since: 0.14.0
1181 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1184 # @NewImageMode
1186 # An enumeration that tells QEMU how to set the backing file path in
1187 # a new image file.
1189 # @existing: QEMU should look for an existing image file.
1191 # @absolute-paths: QEMU should create a new image with absolute paths
1192 # for the backing file.
1194 # Since: 1.1
1196 { 'enum': 'NewImageMode'
1197   'data': [ 'existing', 'absolute-paths' ] }
1200 # @BlockdevSnapshot
1202 # @device:  the name of the device to generate the snapshot from.
1204 # @snapshot-file: the target of the new image. A new file will be created.
1206 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1208 # @mode: #optional whether and how QEMU should create a new image, default is
1209 # 'absolute-paths'.
1211 { 'type': 'BlockdevSnapshot',
1212   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1213             '*mode': 'NewImageMode' } }
1216 # @BlockdevAction
1218 # A discriminated record of operations that can be performed with
1219 # @transaction.
1221 { 'union': 'BlockdevAction',
1222   'data': {
1223        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1224    } }
1227 # @transaction
1229 # Atomically operate on a group of one or more block devices.  If
1230 # any operation fails, then the entire set of actions will be
1231 # abandoned and the appropriate error returned.  The only operation
1232 # supported is currently blockdev-snapshot-sync.
1234 #  List of:
1235 #  @BlockdevAction: information needed for the device snapshot
1237 # Returns: nothing on success
1238 #          If @device is not a valid block device, DeviceNotFound
1239 #          If @device is busy, DeviceInUse will be returned
1240 #          If @snapshot-file can't be created, OpenFileFailed
1241 #          If @snapshot-file can't be opened, OpenFileFailed
1242 #          If @format is invalid, InvalidBlockFormat
1244 # Note: The transaction aborts on the first failure.  Therefore, there will
1245 # be only one device or snapshot file returned in an error condition, and
1246 # subsequent actions will not have been attempted.
1248 # Since 1.1
1250 { 'command': 'transaction',
1251   'data': { 'actions': [ 'BlockdevAction' ] } }
1254 # @blockdev-snapshot-sync
1256 # Generates a synchronous snapshot of a block device.
1258 # @device:  the name of the device to generate the snapshot from.
1260 # @snapshot-file: the target of the new image. If the file exists, or if it
1261 #                 is a device, the snapshot will be created in the existing
1262 #                 file/device. If does not exist, a new file will be created.
1264 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1266 # @mode: #optional whether and how QEMU should create a new image, default is
1267 # 'absolute-paths'.
1269 # Returns: nothing on success
1270 #          If @device is not a valid block device, DeviceNotFound
1271 #          If @snapshot-file can't be opened, OpenFileFailed
1272 #          If @format is invalid, InvalidBlockFormat
1274 # Since 0.14.0
1276 { 'command': 'blockdev-snapshot-sync',
1277   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1278             '*mode': 'NewImageMode'} }
1281 # @human-monitor-command:
1283 # Execute a command on the human monitor and return the output.
1285 # @command-line: the command to execute in the human monitor
1287 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1289 # Returns: the output of the command as a string
1291 # Since: 0.14.0
1293 # Notes: This command only exists as a stop-gap.  It's use is highly
1294 #        discouraged.  The semantics of this command are not guaranteed.
1296 #        Known limitations:
1298 #        o This command is stateless, this means that commands that depend
1299 #          on state information (such as getfd) might not work
1301 #       o Commands that prompt the user for data (eg. 'cont' when the block
1302 #         device is encrypted) don't currently work
1304 { 'command': 'human-monitor-command',
1305   'data': {'command-line': 'str', '*cpu-index': 'int'},
1306   'returns': 'str' }
1309 # @migrate_cancel
1311 # Cancel the current executing migration process.
1313 # Returns: nothing on success
1315 # Notes: This command succeeds even if there is no migration process running.
1317 # Since: 0.14.0
1319 { 'command': 'migrate_cancel' }
1322 # @migrate_set_downtime
1324 # Set maximum tolerated downtime for migration.
1326 # @value: maximum downtime in seconds
1328 # Returns: nothing on success
1330 # Since: 0.14.0
1332 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1335 # @migrate_set_speed
1337 # Set maximum speed for migration.
1339 # @value: maximum speed in bytes.
1341 # Returns: nothing on success
1343 # Notes: A value lesser than zero will be automatically round up to zero.
1345 # Since: 0.14.0
1347 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1350 # @ObjectPropertyInfo:
1352 # @name: the name of the property
1354 # @type: the type of the property.  This will typically come in one of four
1355 #        forms:
1357 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1358 #           These types are mapped to the appropriate JSON type.
1360 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
1361 #           legacy qdev typename.  These types are always treated as strings.
1363 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
1364 #           device type name.  Child properties create the composition tree.
1366 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
1367 #           device type name.  Link properties form the device model graph.
1369 # Since: 1.1
1371 # Notes: This type is experimental.  Its syntax may change in future releases.
1373 { 'type': 'ObjectPropertyInfo',
1374   'data': { 'name': 'str', 'type': 'str' } }
1377 # @qom-list:
1379 # This command will list any properties of a object given a path in the object
1380 # model.
1382 # @path: the path within the object model.  See @qom-get for a description of
1383 #        this parameter.
1385 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1386 #          object.
1388 # Since: 1.1
1390 # Notes: This command is experimental.  It's syntax may change in future
1391 #        releases.
1393 { 'command': 'qom-list',
1394   'data': { 'path': 'str' },
1395   'returns': [ 'ObjectPropertyInfo' ] }
1398 # @qom-get:
1400 # This command will get a property from a object model path and return the
1401 # value.
1403 # @path: The path within the object model.  There are two forms of supported
1404 #        paths--absolute and partial paths.
1406 #        Absolute paths are derived from the root object and can follow child<>
1407 #        or link<> properties.  Since they can follow link<> properties, they
1408 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1409 #        and are prefixed  with a leading slash.
1411 #        Partial paths look like relative filenames.  They do not begin
1412 #        with a prefix.  The matching rules for partial paths are subtle but
1413 #        designed to make specifying objects easy.  At each level of the
1414 #        composition tree, the partial path is matched as an absolute path.
1415 #        The first match is not returned.  At least two matches are searched
1416 #        for.  A successful result is only returned if only one match is
1417 #        found.  If more than one match is found, a flag is return to
1418 #        indicate that the match was ambiguous.
1420 # @property: The property name to read
1422 # Returns: The property value.  The type depends on the property type.  legacy<>
1423 #          properties are returned as #str.  child<> and link<> properties are
1424 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
1425 #          are returned as #int.
1427 # Since: 1.1
1429 # Notes: This command is experimental and may change syntax in future releases.
1431 { 'command': 'qom-get',
1432   'data': { 'path': 'str', 'property': 'str' },
1433   'returns': 'visitor',
1434   'gen': 'no' }
1437 # @qom-set:
1439 # This command will set a property from a object model path.
1441 # @path: see @qom-get for a description of this parameter
1443 # @property: the property name to set
1445 # @value: a value who's type is appropriate for the property type.  See @qom-get
1446 #         for a description of type mapping.
1448 # Since: 1.1
1450 # Notes: This command is experimental and may change syntax in future releases.
1452 { 'command': 'qom-set',
1453   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1454   'gen': 'no' }
1457 # @set_password:
1459 # Sets the password of a remote display session.
1461 # @protocol: `vnc' to modify the VNC server password
1462 #            `spice' to modify the Spice server password
1464 # @password: the new password
1466 # @connected: #optional how to handle existing clients when changing the
1467 #                       password.  If nothing is specified, defaults to `keep'
1468 #                       `fail' to fail the command if clients are connected
1469 #                       `disconnect' to disconnect existing clients
1470 #                       `keep' to maintain existing clients
1472 # Returns: Nothing on success
1473 #          If Spice is not enabled, DeviceNotFound
1474 #          If @protocol does not support connected, InvalidParameter
1475 #          If @protocol is invalid, InvalidParameter
1476 #          If any other error occurs, SetPasswdFailed
1478 # Notes: If VNC is not enabled, SetPasswdFailed is returned.
1480 # Since: 0.14.0
1482 { 'command': 'set_password',
1483   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
1486 # @expire_password:
1488 # Expire the password of a remote display server.
1490 # @protocol: the name of the remote display protocol `vnc' or `spice'
1492 # @time: when to expire the password.
1493 #        `now' to expire the password immediately
1494 #        `never' to cancel password expiration
1495 #        `+INT' where INT is the number of seconds from now (integer)
1496 #        `INT' where INT is the absolute time in seconds
1498 # Returns: Nothing on success
1499 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
1500 #          If an error occurs setting password expiration, SetPasswdFailed
1501 #          If @protocol is not `spice' or 'vnc', InvalidParameter
1503 # Since: 0.14.0
1505 # Notes: Time is relative to the server and currently there is no way to
1506 #        coordinate server time with client time.  It is not recommended to
1507 #        use the absolute time version of the @time parameter unless you're
1508 #        sure you are on the same machine as the QEMU instance.
1510 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
1513 # @eject:
1515 # Ejects a device from a removable drive.
1517 # @device:  The name of the device
1519 # @force:   @optional If true, eject regardless of whether the drive is locked.
1520 #           If not specified, the default value is false.
1522 # Returns:  Nothing on success
1523 #           If @device is not a valid block device, DeviceNotFound
1524 #           If @device is not removable and @force is false, DeviceNotRemovable
1525 #           If @force is false and @device is locked, DeviceLocked
1527 # Notes:    Ejecting a device will no media results in success
1529 # Since: 0.14.0
1531 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
1534 # @change-vnc-password:
1536 # Change the VNC server password.
1538 # @target:  the new password to use with VNC authentication
1540 # Since: 1.1
1542 # Notes:  An empty password in this command will set the password to the empty
1543 #         string.  Existing clients are unaffected by executing this command.
1545 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
1548 # @change:
1550 # This command is multiple commands multiplexed together.
1552 # @device: This is normally the name of a block device but it may also be 'vnc'.
1553 #          when it's 'vnc', then sub command depends on @target
1555 # @target: If @device is a block device, then this is the new filename.
1556 #          If @device is 'vnc', then if the value 'password' selects the vnc
1557 #          change password command.   Otherwise, this specifies a new server URI
1558 #          address to listen to for VNC connections.
1560 # @arg:    If @device is a block device, then this is an optional format to open
1561 #          the device with.
1562 #          If @device is 'vnc' and @target is 'password', this is the new VNC
1563 #          password to set.  If this argument is an empty string, then no future
1564 #          logins will be allowed.
1566 # Returns: Nothing on success.
1567 #          If @device is not a valid block device, DeviceNotFound
1568 #          If @format is not a valid block format, InvalidBlockFormat
1569 #          If the new block device is encrypted, DeviceEncrypted.  Note that
1570 #          if this error is returned, the device has been opened successfully
1571 #          and an additional call to @block_passwd is required to set the
1572 #          device's password.  The behavior of reads and writes to the block
1573 #          device between when these calls are executed is undefined.
1575 # Notes:  It is strongly recommended that this interface is not used especially
1576 #         for changing block devices.
1578 # Since: 0.14.0
1580 { 'command': 'change',
1581   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1584 # @block_set_io_throttle:
1586 # Change I/O throttle limits for a block drive.
1588 # @device: The name of the device
1590 # @bps: total throughput limit in bytes per second
1592 # @bps_rd: read throughput limit in bytes per second
1594 # @bps_wr: write throughput limit in bytes per second
1596 # @iops: total I/O operations per second
1598 # @ops_rd: read I/O operations per second
1600 # @iops_wr: write I/O operations per second
1602 # Returns: Nothing on success
1603 #          If @device is not a valid block device, DeviceNotFound
1604 #          If the argument combination is invalid, InvalidParameterCombination
1606 # Since: 1.1
1608 { 'command': 'block_set_io_throttle',
1609   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
1610             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
1613 # @block-stream:
1615 # Copy data from a backing file into a block device.
1617 # The block streaming operation is performed in the background until the entire
1618 # backing file has been copied.  This command returns immediately once streaming
1619 # has started.  The status of ongoing block streaming operations can be checked
1620 # with query-block-jobs.  The operation can be stopped before it has completed
1621 # using the block-job-cancel command.
1623 # If a base file is specified then sectors are not copied from that base file and
1624 # its backing chain.  When streaming completes the image file will have the base
1625 # file as its backing file.  This can be used to stream a subset of the backing
1626 # file chain instead of flattening the entire image.
1628 # On successful completion the image file is updated to drop the backing file
1629 # and the BLOCK_JOB_COMPLETED event is emitted.
1631 # @device: the device name
1633 # @base:   #optional the common backing file name
1635 # @speed:  #optional the maximum speed, in bytes per second
1637 # Returns: Nothing on success
1638 #          If streaming is already active on this device, DeviceInUse
1639 #          If @device does not exist, DeviceNotFound
1640 #          If image streaming is not supported by this device, NotSupported
1641 #          If @base does not exist, BaseNotFound
1642 #          If @speed is invalid, InvalidParameter
1644 # Since: 1.1
1646 { 'command': 'block-stream', 'data': { 'device': 'str', '*base': 'str',
1647                                        '*speed': 'int' } }
1650 # @block-job-set-speed:
1652 # Set maximum speed for a background block operation.
1654 # This command can only be issued when there is an active block job.
1656 # Throttling can be disabled by setting the speed to 0.
1658 # @device: the device name
1660 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
1661 #          Defaults to 0.
1663 # Returns: Nothing on success
1664 #          If the job type does not support throttling, NotSupported
1665 #          If the speed value is invalid, InvalidParameter
1666 #          If no background operation is active on this device, DeviceNotActive
1668 # Since: 1.1
1670 { 'command': 'block-job-set-speed',
1671   'data': { 'device': 'str', 'speed': 'int' } }
1674 # @block-job-cancel:
1676 # Stop an active background block operation.
1678 # This command returns immediately after marking the active background block
1679 # operation for cancellation.  It is an error to call this command if no
1680 # operation is in progress.
1682 # The operation will cancel as soon as possible and then emit the
1683 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
1684 # enumerated using query-block-jobs.
1686 # For streaming, the image file retains its backing file unless the streaming
1687 # operation happens to complete just as it is being cancelled.  A new streaming
1688 # operation can be started at a later time to finish copying all data from the
1689 # backing file.
1691 # @device: the device name
1693 # Returns: Nothing on success
1694 #          If no background operation is active on this device, DeviceNotActive
1695 #          If cancellation already in progress, DeviceInUse
1697 # Since: 1.1
1699 { 'command': 'block-job-cancel', 'data': { 'device': 'str' } }
1702 # @ObjectTypeInfo:
1704 # This structure describes a search result from @qom-list-types
1706 # @name: the type name found in the search
1708 # Since: 1.1
1710 # Notes: This command is experimental and may change syntax in future releases.
1712 { 'type': 'ObjectTypeInfo',
1713   'data': { 'name': 'str' } }
1716 # @qom-list-types:
1718 # This command will return a list of types given search parameters
1720 # @implements: if specified, only return types that implement this type name
1722 # @abstract: if true, include abstract types in the results
1724 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1726 # Since: 1.1
1728 # Notes: This command is experimental and may change syntax in future releases.
1730 { 'command': 'qom-list-types',
1731   'data': { '*implements': 'str', '*abstract': 'bool' },
1732   'returns': [ 'ObjectTypeInfo' ] }
1735 # @migrate
1737 # Migrates the current running guest to another Virtual Machine.
1739 # @uri: the Uniform Resource Identifier of the destination VM
1741 # @blk: #optional do block migration (full disk copy)
1743 # @inc: #optional incremental disk copy migration
1745 # @detach: this argument exists only for compatibility reasons and
1746 #          is ignored by QEMU
1748 # Returns: nothing on success
1750 # Since: 0.14.0
1752 { 'command': 'migrate',
1753   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
1755 # @xen-save-devices-state:
1757 # Save the state of all devices to file. The RAM and the block devices
1758 # of the VM are not saved by this command.
1760 # @filename: the file to save the state of the devices to as binary
1761 # data. See xen-save-devices-state.txt for a description of the binary
1762 # format.
1764 # Returns: Nothing on success
1765 #          If @filename cannot be opened, OpenFileFailed
1766 #          If an I/O error occurs while writing the file, IOError
1768 # Since: 1.1
1770 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
1773 # @device_del:
1775 # Remove a device from a guest
1777 # @id: the name of the device
1779 # Returns: Nothing on success
1780 #          If @id is not a valid device, DeviceNotFound
1781 #          If the device does not support unplug, BusNoHotplug
1783 # Notes: When this command completes, the device may not be removed from the
1784 #        guest.  Hot removal is an operation that requires guest cooperation.
1785 #        This command merely requests that the guest begin the hot removal
1786 #        process.
1788 # Since: 0.14.0
1790 { 'command': 'device_del', 'data': {'id': 'str'} }
1793 # @dump-guest-memory
1795 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1796 # very long depending on the amount of guest memory. This command is only
1797 # supported on i386 and x86_64.
1799 # @paging: if true, do paging to get guest's memory mapping. This allows
1800 # using gdb to process the core file. However, setting @paging to false
1801 # may be desirable because of two reasons:
1803 #   1. The guest may be in a catastrophic state or can have corrupted
1804 #      memory, which cannot be trusted
1805 #   2. The guest can be in real-mode even if paging is enabled. For example,
1806 #      the guest uses ACPI to sleep, and ACPI sleep state goes in real-mode
1808 # @protocol: the filename or file descriptor of the vmcore. The supported
1809 # protocols are:
1811 #   1. file: the protocol starts with "file:", and the following string is
1812 #      the file's path.
1813 #   2. fd: the protocol starts with "fd:", and the following string is the
1814 #      fd's name.
1816 # @begin: #optional if specified, the starting physical address.
1818 # @length: #optional if specified, the memory size, in bytes. If you don't
1819 # want to dump all guest's memory, please specify the start @begin and @length
1821 # Returns: nothing on success
1822 #          If @begin contains an invalid address, InvalidParameter
1823 #          If only one of @begin and @length is specified, MissingParameter
1824 #          If @protocol stats with "fd:", and the fd cannot be found, FdNotFound
1825 #          If @protocol starts with "file:", and the file cannot be
1826 #             opened, OpenFileFailed
1827 #          If @protocol does not start with "fd:" or "file:", InvalidParameter
1828 #          If an I/O error occurs while writing the file, IOError
1829 #          If the target does not support this command, Unsupported
1831 # Since: 1.2
1833 { 'command': 'dump-guest-memory',
1834   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
1835             '*length': 'int' } }
1837 # @netdev_add:
1839 # Add a network backend.
1841 # @type: the type of network backend.  Current valid values are 'user', 'tap',
1842 #        'vde', 'socket', 'dump' and 'bridge'
1844 # @id: the name of the new network backend
1846 # @props: #optional a list of properties to be passed to the backend in
1847 #         the format 'name=value', like 'ifname=tap0,script=no'
1849 # Notes: The semantics of @props is not well defined.  Future commands will be
1850 #        introduced that provide stronger typing for backend creation.
1852 # Since: 0.14.0
1854 # Returns: Nothing on success
1855 #          If @type is not a valid network backend, DeviceNotFound
1856 #          If @id is not a valid identifier, InvalidParameterValue
1857 #          if @id already exists, DuplicateId
1858 #          If @props contains an invalid parameter for this backend,
1859 #            InvalidParameter
1861 { 'command': 'netdev_add',
1862   'data': {'type': 'str', 'id': 'str', '*props': '**'},
1863   'gen': 'no' }
1866 # @netdev_del:
1868 # Remove a network backend.
1870 # @id: the name of the network backend to remove
1872 # Returns: Nothing on success
1873 #          If @id is not a valid network backend, DeviceNotFound
1875 # Since: 0.14.0
1877 { 'command': 'netdev_del', 'data': {'id': 'str'} }
1880 # @NetdevNoneOptions
1882 # Use it alone to have zero network devices.
1884 # Since 1.2
1886 { 'type': 'NetdevNoneOptions',
1887   'data': { } }
1890 # @NetLegacyNicOptions
1892 # Create a new Network Interface Card.
1894 # @netdev: #optional id of -netdev to connect to
1896 # @macaddr: #optional MAC address
1898 # @model: #optional device model (e1000, rtl8139, virtio etc.)
1900 # @addr: #optional PCI device address
1902 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
1904 # Since 1.2
1906 { 'type': 'NetLegacyNicOptions',
1907   'data': {
1908     '*netdev':  'str',
1909     '*macaddr': 'str',
1910     '*model':   'str',
1911     '*addr':    'str',
1912     '*vectors': 'uint32' } }
1915 # @String
1917 # A fat type wrapping 'str', to be embedded in lists.
1919 # Since 1.2
1921 { 'type': 'String',
1922   'data': {
1923     'str': 'str' } }
1926 # @NetdevUserOptions
1928 # Use the user mode network stack which requires no administrator privilege to
1929 # run.
1931 # @hostname: #optional client hostname reported by the builtin DHCP server
1933 # @restrict: #optional isolate the guest from the host
1935 # @ip: #optional legacy parameter, use net= instead
1937 # @net: #optional IP address and optional netmask
1939 # @host: #optional guest-visible address of the host
1941 # @tftp: #optional root directory of the built-in TFTP server
1943 # @bootfile: #optional BOOTP filename, for use with tftp=
1945 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
1946 #             assign
1948 # @dns: #optional guest-visible address of the virtual nameserver
1950 # @smb: #optional root directory of the built-in SMB server
1952 # @smbserver: #optional IP address of the built-in SMB server
1954 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
1955 #           endpoints
1957 # @guestfwd: #optional forward guest TCP connections
1959 # Since 1.2
1961 { 'type': 'NetdevUserOptions',
1962   'data': {
1963     '*hostname':  'str',
1964     '*restrict':  'bool',
1965     '*ip':        'str',
1966     '*net':       'str',
1967     '*host':      'str',
1968     '*tftp':      'str',
1969     '*bootfile':  'str',
1970     '*dhcpstart': 'str',
1971     '*dns':       'str',
1972     '*smb':       'str',
1973     '*smbserver': 'str',
1974     '*hostfwd':   ['String'],
1975     '*guestfwd':  ['String'] } }
1978 # @NetdevTapOptions
1980 # Connect the host TAP network interface name to the VLAN.
1982 # @ifname: #optional interface name
1984 # @fd: #optional file descriptor of an already opened tap
1986 # @script: #optional script to initialize the interface
1988 # @downscript: #optional script to shut down the interface
1990 # @helper: #optional command to execute to configure bridge
1992 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
1994 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
1996 # @vhost: #optional enable vhost-net network accelerator
1998 # @vhostfd: #optional file descriptor of an already opened vhost net device
2000 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2002 # Since 1.2
2004 { 'type': 'NetdevTapOptions',
2005   'data': {
2006     '*ifname':     'str',
2007     '*fd':         'str',
2008     '*script':     'str',
2009     '*downscript': 'str',
2010     '*helper':     'str',
2011     '*sndbuf':     'size',
2012     '*vnet_hdr':   'bool',
2013     '*vhost':      'bool',
2014     '*vhostfd':    'str',
2015     '*vhostforce': 'bool' } }
2018 # @NetdevSocketOptions
2020 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2021 # socket connection.
2023 # @fd: #optional file descriptor of an already opened socket
2025 # @listen: #optional port number, and optional hostname, to listen on
2027 # @connect: #optional port number, and optional hostname, to connect to
2029 # @mcast: #optional UDP multicast address and port number
2031 # @localaddr: #optional source address and port for multicast and udp packets
2033 # @udp: #optional UDP unicast address and port number
2035 # Since 1.2
2037 { 'type': 'NetdevSocketOptions',
2038   'data': {
2039     '*fd':        'str',
2040     '*listen':    'str',
2041     '*connect':   'str',
2042     '*mcast':     'str',
2043     '*localaddr': 'str',
2044     '*udp':       'str' } }
2047 # @NetdevVdeOptions
2049 # Connect the VLAN to a vde switch running on the host.
2051 # @sock: #optional socket path
2053 # @port: #optional port number
2055 # @group: #optional group owner of socket
2057 # @mode: #optional permissions for socket
2059 # Since 1.2
2061 { 'type': 'NetdevVdeOptions',
2062   'data': {
2063     '*sock':  'str',
2064     '*port':  'uint16',
2065     '*group': 'str',
2066     '*mode':  'uint16' } }
2069 # @NetdevDumpOptions
2071 # Dump VLAN network traffic to a file.
2073 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2074 # suffixes.
2076 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2078 # Since 1.2
2080 { 'type': 'NetdevDumpOptions',
2081   'data': {
2082     '*len':  'size',
2083     '*file': 'str' } }
2086 # @NetdevBridgeOptions
2088 # Connect a host TAP network interface to a host bridge device.
2090 # @br: #optional bridge name
2092 # @helper: #optional command to execute to configure bridge
2094 # Since 1.2
2096 { 'type': 'NetdevBridgeOptions',
2097   'data': {
2098     '*br':     'str',
2099     '*helper': 'str' } }
2102 # @NetdevHubPortOptions
2104 # Connect two or more net clients through a software hub.
2106 # @hubid: hub identifier number
2108 # Since 1.2
2110 { 'type': 'NetdevHubPortOptions',
2111   'data': {
2112     'hubid':     'int32' } }
2115 # @NetClientOptions
2117 # A discriminated record of network device traits.
2119 # Since 1.2
2121 { 'union': 'NetClientOptions',
2122   'data': {
2123     'none':     'NetdevNoneOptions',
2124     'nic':      'NetLegacyNicOptions',
2125     'user':     'NetdevUserOptions',
2126     'tap':      'NetdevTapOptions',
2127     'socket':   'NetdevSocketOptions',
2128     'vde':      'NetdevVdeOptions',
2129     'dump':     'NetdevDumpOptions',
2130     'bridge':   'NetdevBridgeOptions',
2131     'hubport':  'NetdevHubPortOptions' } }
2134 # @NetLegacy
2136 # Captures the configuration of a network device; legacy.
2138 # @vlan: #optional vlan number
2140 # @id: #optional identifier for monitor commands
2142 # @name: #optional identifier for monitor commands, ignored if @id is present
2144 # @opts: device type specific properties (legacy)
2146 # Since 1.2
2148 { 'type': 'NetLegacy',
2149   'data': {
2150     '*vlan': 'int32',
2151     '*id':   'str',
2152     '*name': 'str',
2153     'opts':  'NetClientOptions' } }
2156 # @Netdev
2158 # Captures the configuration of a network device.
2160 # @id: identifier for monitor commands.
2162 # @opts: device type specific properties
2164 # Since 1.2
2166 { 'type': 'Netdev',
2167   'data': {
2168     'id':   'str',
2169     'opts': 'NetClientOptions' } }
2172 # @getfd:
2174 # Receive a file descriptor via SCM rights and assign it a name
2176 # @fdname: file descriptor name
2178 # Returns: Nothing on success
2179 #          If file descriptor was not received, FdNotSupplied
2180 #          If @fdname is not valid, InvalidParameterType
2182 # Since: 0.14.0
2184 # Notes: If @fdname already exists, the file descriptor assigned to
2185 #        it will be closed and replaced by the received file
2186 #        descriptor.
2187 #        The 'closefd' command can be used to explicitly close the
2188 #        file descriptor when it is no longer needed.
2190 { 'command': 'getfd', 'data': {'fdname': 'str'} }
2193 # @closefd:
2195 # Close a file descriptor previously passed via SCM rights
2197 # @fdname: file descriptor name
2199 # Returns: Nothing on success
2200 #          If @fdname is not found, FdNotFound
2202 # Since: 0.14.0
2204 { 'command': 'closefd', 'data': {'fdname': 'str'} }