qmp: add SUSPEND_DISK event
[qemu/ar7.git] / qapi-schema.json
blobec8d91908c73c3e0b8c9874c29e54d2d984554ef
1 # -*- Mode: Python -*-
3 # QAPI Schema
5 ##
6 # @ErrorClass
8 # QEMU error classes
10 # @GenericError: this is used for errors that don't require a specific error
11 #                class. This should be the default case for most errors
13 # @CommandNotFound: the requested command has not been found
15 # @DeviceEncrypted: the requested operation can't be fulfilled because the
16 #                   selected device is encrypted
18 # @DeviceNotActive: a device has failed to be become active
20 # @DeviceNotFound: the requested device has not been found
22 # @KVMMissingCap: the requested operation can't be fulfilled because a
23 #                 required KVM capability is missing
25 # @MigrationExpected: the requested operation can't be fulfilled because a
26 #                     migration process is expected
28 # Since: 1.2
30 { 'enum': 'ErrorClass',
31   'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
32             'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap',
33             'MigrationExpected' ] }
36 # @NameInfo:
38 # Guest name information.
40 # @name: #optional The name of the guest
42 # Since 0.14.0
44 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
47 # @query-name:
49 # Return the name information of a guest.
51 # Returns: @NameInfo of the guest
53 # Since 0.14.0
55 { 'command': 'query-name', 'returns': 'NameInfo' }
58 # @VersionInfo:
60 # A description of QEMU's version.
62 # @qemu.major:  The major version of QEMU
64 # @qemu.minor:  The minor version of QEMU
66 # @qemu.micro:  The micro version of QEMU.  By current convention, a micro
67 #               version of 50 signifies a development branch.  A micro version
68 #               greater than or equal to 90 signifies a release candidate for
69 #               the next minor version.  A micro version of less than 50
70 #               signifies a stable release.
72 # @package:     QEMU will always set this field to an empty string.  Downstream
73 #               versions of QEMU should set this to a non-empty string.  The
74 #               exact format depends on the downstream however it highly
75 #               recommended that a unique name is used.
77 # Since: 0.14.0
79 { 'type': 'VersionInfo',
80   'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
81            'package': 'str'} }
84 # @query-version:
86 # Returns the current version of QEMU.
88 # Returns:  A @VersionInfo object describing the current version of QEMU.
90 # Since: 0.14.0
92 { 'command': 'query-version', 'returns': 'VersionInfo' }
95 # @KvmInfo:
97 # Information about support for KVM acceleration
99 # @enabled: true if KVM acceleration is active
101 # @present: true if KVM acceleration is built into this executable
103 # Since: 0.14.0
105 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
108 # @query-kvm:
110 # Returns information about KVM acceleration
112 # Returns: @KvmInfo
114 # Since: 0.14.0
116 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
119 # @RunState
121 # An enumation of VM run states.
123 # @debug: QEMU is running on a debugger
125 # @finish-migrate: guest is paused to finish the migration process
127 # @inmigrate: guest is paused waiting for an incoming migration
129 # @internal-error: An internal error that prevents further guest execution
130 # has occurred
132 # @io-error: the last IOP has failed and the device is configured to pause
133 # on I/O errors
135 # @paused: guest has been paused via the 'stop' command
137 # @postmigrate: guest is paused following a successful 'migrate'
139 # @prelaunch: QEMU was started with -S and guest has not started
141 # @restore-vm: guest is paused to restore VM state
143 # @running: guest is actively running
145 # @save-vm: guest is paused to save the VM state
147 # @shutdown: guest is shut down (and -no-shutdown is in use)
149 # @suspended: guest is suspended (ACPI S3)
151 # @watchdog: the watchdog action is configured to pause and has been triggered
153 { 'enum': 'RunState',
154   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
155             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
156             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
159 # @StatusInfo:
161 # Information about VCPU run state
163 # @running: true if all VCPUs are runnable, false if not runnable
165 # @singlestep: true if VCPUs are in single-step mode
167 # @status: the virtual machine @RunState
169 # Since:  0.14.0
171 # Notes: @singlestep is enabled through the GDB stub
173 { 'type': 'StatusInfo',
174   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
177 # @query-status:
179 # Query the run status of all VCPUs
181 # Returns: @StatusInfo reflecting all VCPUs
183 # Since:  0.14.0
185 { 'command': 'query-status', 'returns': 'StatusInfo' }
188 # @UuidInfo:
190 # Guest UUID information.
192 # @UUID: the UUID of the guest
194 # Since: 0.14.0
196 # Notes: If no UUID was specified for the guest, a null UUID is returned.
198 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
201 # @query-uuid:
203 # Query the guest UUID information.
205 # Returns: The @UuidInfo for the guest
207 # Since 0.14.0
209 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
212 # @ChardevInfo:
214 # Information about a character device.
216 # @label: the label of the character device
218 # @filename: the filename of the character device
220 # Notes: @filename is encoded using the QEMU command line character device
221 #        encoding.  See the QEMU man page for details.
223 # Since: 0.14.0
225 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
228 # @query-chardev:
230 # Returns information about current character devices.
232 # Returns: a list of @ChardevInfo
234 # Since: 0.14.0
236 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
239 # @CommandInfo:
241 # Information about a QMP command
243 # @name: The command name
245 # Since: 0.14.0
247 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
250 # @query-commands:
252 # Return a list of supported QMP commands by this server
254 # Returns: A list of @CommandInfo for all supported commands
256 # Since: 0.14.0
258 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
261 # @EventInfo:
263 # Information about a QMP event
265 # @name: The event name
267 # Since: 1.2.0
269 { 'type': 'EventInfo', 'data': {'name': 'str'} }
272 # @query-events:
274 # Return a list of supported QMP events by this server
276 # Returns: A list of @EventInfo for all supported events
278 # Since: 1.2.0
280 { 'command': 'query-events', 'returns': ['EventInfo'] }
283 # @MigrationStats
285 # Detailed migration status.
287 # @transferred: amount of bytes already transferred to the target VM
289 # @remaining: amount of bytes remaining to be transferred to the target VM
291 # @total: total amount of bytes involved in the migration process
293 # @total_time: tota0l amount of ms since migration started.  If
294 #        migration has ended, it returns the total migration
295 #        time. (since 1.2)
297 # Since: 0.14.0.
299 { 'type': 'MigrationStats',
300   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
301            'total_time': 'int' } }
304 # @MigrationInfo
306 # Information about current migration process.
308 # @status: #optional string describing the current migration status.
309 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
310 #          'cancelled'. If this field is not returned, no migration process
311 #          has been initiated
313 # @ram: #optional @MigrationStats containing detailed migration
314 #       status, only returned if status is 'active' or
315 #       'completed'. 'comppleted' (since 1.2)
317 # @disk: #optional @MigrationStats containing detailed disk migration
318 #        status, only returned if status is 'active' and it is a block
319 #        migration
321 # Since: 0.14.0
323 { 'type': 'MigrationInfo',
324   'data': {'*status': 'str', '*ram': 'MigrationStats',
325            '*disk': 'MigrationStats'} }
328 # @query-migrate
330 # Returns information about current migration process.
332 # Returns: @MigrationInfo
334 # Since: 0.14.0
336 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
339 # @MouseInfo:
341 # Information about a mouse device.
343 # @name: the name of the mouse device
345 # @index: the index of the mouse device
347 # @current: true if this device is currently receiving mouse events
349 # @absolute: true if this device supports absolute coordinates as input
351 # Since: 0.14.0
353 { 'type': 'MouseInfo',
354   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
355            'absolute': 'bool'} }
358 # @query-mice:
360 # Returns information about each active mouse device
362 # Returns: a list of @MouseInfo for each device
364 # Since: 0.14.0
366 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
369 # @CpuInfo:
371 # Information about a virtual CPU
373 # @CPU: the index of the virtual CPU
375 # @current: this only exists for backwards compatible and should be ignored
377 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
378 #          to a processor specific low power mode.
380 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
381 #                pointer.
382 #                If the target is Sparc, this is the PC component of the
383 #                instruction pointer.
385 # @nip: #optional If the target is PPC, the instruction pointer
387 # @npc: #optional If the target is Sparc, the NPC component of the instruction
388 #                 pointer
390 # @PC: #optional If the target is MIPS, the instruction pointer
392 # @thread_id: ID of the underlying host thread
394 # Since: 0.14.0
396 # Notes: @halted is a transient state that changes frequently.  By the time the
397 #        data is sent to the client, the guest may no longer be halted.
399 { 'type': 'CpuInfo',
400   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
401            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
404 # @query-cpus:
406 # Returns a list of information about each virtual CPU.
408 # Returns: a list of @CpuInfo for each virtual CPU
410 # Since: 0.14.0
412 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
415 # @BlockDeviceInfo:
417 # Information about the backing device for a block device.
419 # @file: the filename of the backing device
421 # @ro: true if the backing device was open read-only
423 # @drv: the name of the block format used to open the backing device. As of
424 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
425 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
426 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
427 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
429 # @backing_file: #optional the name of the backing file (for copy-on-write)
431 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
433 # @encrypted: true if the backing device is encrypted
435 # @encryption_key_missing: true if the backing device is encrypted but an
436 #                          valid encryption key is missing
438 # @bps: total throughput limit in bytes per second is specified
440 # @bps_rd: read throughput limit in bytes per second is specified
442 # @bps_wr: write throughput limit in bytes per second is specified
444 # @iops: total I/O operations per second is specified
446 # @iops_rd: read I/O operations per second is specified
448 # @iops_wr: write I/O operations per second is specified
450 # Since: 0.14.0
452 # Notes: This interface is only found in @BlockInfo.
454 { 'type': 'BlockDeviceInfo',
455   'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
456             '*backing_file': 'str', 'backing_file_depth': 'int',
457             'encrypted': 'bool', 'encryption_key_missing': 'bool',
458             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
459             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
462 # @BlockDeviceIoStatus:
464 # An enumeration of block device I/O status.
466 # @ok: The last I/O operation has succeeded
468 # @failed: The last I/O operation has failed
470 # @nospace: The last I/O operation has failed due to a no-space condition
472 # Since: 1.0
474 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
477 # @BlockInfo:
479 # Block device information.  This structure describes a virtual device and
480 # the backing device associated with it.
482 # @device: The device name associated with the virtual device.
484 # @type: This field is returned only for compatibility reasons, it should
485 #        not be used (always returns 'unknown')
487 # @removable: True if the device supports removable media.
489 # @locked: True if the guest has locked this device from having its media
490 #          removed
492 # @tray_open: #optional True if the device has a tray and it is open
493 #             (only present if removable is true)
495 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
496 #             supports it and the VM is configured to stop on errors
498 # @inserted: #optional @BlockDeviceInfo describing the device if media is
499 #            present
501 # Since:  0.14.0
503 { 'type': 'BlockInfo',
504   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
505            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
506            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus'} }
509 # @query-block:
511 # Get a list of BlockInfo for all virtual block devices.
513 # Returns: a list of @BlockInfo describing each virtual block device
515 # Since: 0.14.0
517 { 'command': 'query-block', 'returns': ['BlockInfo'] }
520 # @BlockDeviceStats:
522 # Statistics of a virtual block device or a block backing device.
524 # @rd_bytes:      The number of bytes read by the device.
526 # @wr_bytes:      The number of bytes written by the device.
528 # @rd_operations: The number of read operations performed by the device.
530 # @wr_operations: The number of write operations performed by the device.
532 # @flush_operations: The number of cache flush operations performed by the
533 #                    device (since 0.15.0)
535 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
536 #                       (since 0.15.0).
538 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
540 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
542 # @wr_highest_offset: The offset after the greatest byte written to the
543 #                     device.  The intended use of this information is for
544 #                     growable sparse files (like qcow2) that are used on top
545 #                     of a physical device.
547 # Since: 0.14.0
549 { 'type': 'BlockDeviceStats',
550   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
551            'wr_operations': 'int', 'flush_operations': 'int',
552            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
553            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
556 # @BlockStats:
558 # Statistics of a virtual block device or a block backing device.
560 # @device: #optional If the stats are for a virtual block device, the name
561 #          corresponding to the virtual block device.
563 # @stats:  A @BlockDeviceStats for the device.
565 # @parent: #optional This may point to the backing block device if this is a
566 #          a virtual block device.  If it's a backing block, this will point
567 #          to the backing file is one is present.
569 # Since: 0.14.0
571 { 'type': 'BlockStats',
572   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
573            '*parent': 'BlockStats'} }
576 # @query-blockstats:
578 # Query the @BlockStats for all virtual block devices.
580 # Returns: A list of @BlockStats for each virtual block devices.
582 # Since: 0.14.0
584 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
587 # @VncClientInfo:
589 # Information about a connected VNC client.
591 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
592 #        when possible.
594 # @family: 'ipv6' if the client is connected via IPv6 and TCP
595 #          'ipv4' if the client is connected via IPv4 and TCP
596 #          'unix' if the client is connected via a unix domain socket
597 #          'unknown' otherwise
599 # @service: The service name of the client's port.  This may depends on the
600 #           host system's service database so symbolic names should not be
601 #           relied on.
603 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
604 #              Name of the client.
606 # @sasl_username: #optional If SASL authentication is in use, the SASL username
607 #                 used for authentication.
609 # Since: 0.14.0
611 { 'type': 'VncClientInfo',
612   'data': {'host': 'str', 'family': 'str', 'service': 'str',
613            '*x509_dname': 'str', '*sasl_username': 'str'} }
616 # @VncInfo:
618 # Information about the VNC session.
620 # @enabled: true if the VNC server is enabled, false otherwise
622 # @host: #optional The hostname the VNC server is bound to.  This depends on
623 #        the name resolution on the host and may be an IP address.
625 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
626 #                    'ipv4' if the host is listening for IPv4 connections
627 #                    'unix' if the host is listening on a unix domain socket
628 #                    'unknown' otherwise
630 # @service: #optional The service name of the server's port.  This may depends
631 #           on the host system's service database so symbolic names should not
632 #           be relied on.
634 # @auth: #optional the current authentication type used by the server
635 #        'none' if no authentication is being used
636 #        'vnc' if VNC authentication is being used
637 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
638 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
639 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
640 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
641 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
642 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
643 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
644 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
645 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
647 # @clients: a list of @VncClientInfo of all currently connected clients
649 # Since: 0.14.0
651 { 'type': 'VncInfo',
652   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
653            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
656 # @query-vnc:
658 # Returns information about the current VNC server
660 # Returns: @VncInfo
662 # Since: 0.14.0
664 { 'command': 'query-vnc', 'returns': 'VncInfo' }
667 # @SpiceChannel
669 # Information about a SPICE client channel.
671 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
672 #        when possible.
674 # @family: 'ipv6' if the client is connected via IPv6 and TCP
675 #          'ipv4' if the client is connected via IPv4 and TCP
676 #          'unix' if the client is connected via a unix domain socket
677 #          'unknown' otherwise
679 # @port: The client's port number.
681 # @connection-id: SPICE connection id number.  All channels with the same id
682 #                 belong to the same SPICE session.
684 # @connection-type: SPICE channel type number.  "1" is the main control
685 #                   channel, filter for this one if you want to track spice
686 #                   sessions only
688 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
689 #              multiple channels of the same type exist, such as multiple
690 #              display channels in a multihead setup
692 # @tls: true if the channel is encrypted, false otherwise.
694 # Since: 0.14.0
696 { 'type': 'SpiceChannel',
697   'data': {'host': 'str', 'family': 'str', 'port': 'str',
698            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
699            'tls': 'bool'} }
702 # @SpiceQueryMouseMode
704 # An enumation of Spice mouse states.
706 # @client: Mouse cursor position is determined by the client.
708 # @server: Mouse cursor position is determined by the server.
710 # @unknown: No information is available about mouse mode used by
711 #           the spice server.
713 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
715 # Since: 1.1
717 { 'enum': 'SpiceQueryMouseMode',
718   'data': [ 'client', 'server', 'unknown' ] }
721 # @SpiceInfo
723 # Information about the SPICE session.
725 # @enabled: true if the SPICE server is enabled, false otherwise
727 # @host: #optional The hostname the SPICE server is bound to.  This depends on
728 #        the name resolution on the host and may be an IP address.
730 # @port: #optional The SPICE server's port number.
732 # @compiled-version: #optional SPICE server version.
734 # @tls-port: #optional The SPICE server's TLS port number.
736 # @auth: #optional the current authentication type used by the server
737 #        'none'  if no authentication is being used
738 #        'spice' uses SASL or direct TLS authentication, depending on command
739 #                line options
741 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
742 #              be determined by the client or the server, or unknown if spice
743 #              server doesn't provide this information.
745 #              Since: 1.1
747 # @channels: a list of @SpiceChannel for each active spice channel
749 # Since: 0.14.0
751 { 'type': 'SpiceInfo',
752   'data': {'enabled': 'bool', '*host': 'str', '*port': 'int',
753            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
754            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
757 # @query-spice
759 # Returns information about the current SPICE server
761 # Returns: @SpiceInfo
763 # Since: 0.14.0
765 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
768 # @BalloonInfo:
770 # Information about the guest balloon device.
772 # @actual: the number of bytes the balloon currently contains
774 # @mem_swapped_in: #optional number of pages swapped in within the guest
776 # @mem_swapped_out: #optional number of pages swapped out within the guest
778 # @major_page_faults: #optional number of major page faults within the guest
780 # @minor_page_faults: #optional number of minor page faults within the guest
782 # @free_mem: #optional amount of memory (in bytes) free in the guest
784 # @total_mem: #optional amount of memory (in bytes) visible to the guest
786 # Since: 0.14.0
788 # Notes: all current versions of QEMU do not fill out optional information in
789 #        this structure.
791 { 'type': 'BalloonInfo',
792   'data': {'actual': 'int', '*mem_swapped_in': 'int',
793            '*mem_swapped_out': 'int', '*major_page_faults': 'int',
794            '*minor_page_faults': 'int', '*free_mem': 'int',
795            '*total_mem': 'int'} }
798 # @query-balloon:
800 # Return information about the balloon device.
802 # Returns: @BalloonInfo on success
803 #          If the balloon driver is enabled but not functional because the KVM
804 #          kernel module cannot support it, KvmMissingCap
805 #          If no balloon device is present, DeviceNotActive
807 # Since: 0.14.0
809 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
812 # @PciMemoryRange:
814 # A PCI device memory region
816 # @base: the starting address (guest physical)
818 # @limit: the ending address (guest physical)
820 # Since: 0.14.0
822 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
825 # @PciMemoryRegion
827 # Information about a PCI device I/O region.
829 # @bar: the index of the Base Address Register for this region
831 # @type: 'io' if the region is a PIO region
832 #        'memory' if the region is a MMIO region
834 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
836 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
838 # Since: 0.14.0
840 { 'type': 'PciMemoryRegion',
841   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
842            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
845 # @PciBridgeInfo:
847 # Information about a PCI Bridge device
849 # @bus.number: primary bus interface number.  This should be the number of the
850 #              bus the device resides on.
852 # @bus.secondary: secondary bus interface number.  This is the number of the
853 #                 main bus for the bridge
855 # @bus.subordinate: This is the highest number bus that resides below the
856 #                   bridge.
858 # @bus.io_range: The PIO range for all devices on this bridge
860 # @bus.memory_range: The MMIO range for all devices on this bridge
862 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
863 #                          this bridge
865 # @devices: a list of @PciDeviceInfo for each device on this bridge
867 # Since: 0.14.0
869 { 'type': 'PciBridgeInfo',
870   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
871                     'io_range': 'PciMemoryRange',
872                     'memory_range': 'PciMemoryRange',
873                     'prefetchable_range': 'PciMemoryRange' },
874            '*devices': ['PciDeviceInfo']} }
877 # @PciDeviceInfo:
879 # Information about a PCI device
881 # @bus: the bus number of the device
883 # @slot: the slot the device is located in
885 # @function: the function of the slot used by the device
887 # @class_info.desc: #optional a string description of the device's class
889 # @class_info.class: the class code of the device
891 # @id.device: the PCI device id
893 # @id.vendor: the PCI vendor id
895 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
897 # @qdev_id: the device name of the PCI device
899 # @pci_bridge: if the device is a PCI bridge, the bridge information
901 # @regions: a list of the PCI I/O regions associated with the device
903 # Notes: the contents of @class_info.desc are not stable and should only be
904 #        treated as informational.
906 # Since: 0.14.0
908 { 'type': 'PciDeviceInfo',
909   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
910            'class_info': {'*desc': 'str', 'class': 'int'},
911            'id': {'device': 'int', 'vendor': 'int'},
912            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
913            'regions': ['PciMemoryRegion']} }
916 # @PciInfo:
918 # Information about a PCI bus
920 # @bus: the bus index
922 # @devices: a list of devices on this bus
924 # Since: 0.14.0
926 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
929 # @query-pci:
931 # Return information about the PCI bus topology of the guest.
933 # Returns: a list of @PciInfo for each PCI bus
935 # Since: 0.14.0
937 { 'command': 'query-pci', 'returns': ['PciInfo'] }
940 # @BlockJobInfo:
942 # Information about a long-running block device operation.
944 # @type: the job type ('stream' for image streaming)
946 # @device: the block device name
948 # @len: the maximum progress value
950 # @offset: the current progress value
952 # @speed: the rate limit, bytes per second
954 # Since: 1.1
956 { 'type': 'BlockJobInfo',
957   'data': {'type': 'str', 'device': 'str', 'len': 'int',
958            'offset': 'int', 'speed': 'int'} }
961 # @query-block-jobs:
963 # Return information about long-running block device operations.
965 # Returns: a list of @BlockJobInfo for each active block job
967 # Since: 1.1
969 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
972 # @quit:
974 # This command will cause the QEMU process to exit gracefully.  While every
975 # attempt is made to send the QMP response before terminating, this is not
976 # guaranteed.  When using this interface, a premature EOF would not be
977 # unexpected.
979 # Since: 0.14.0
981 { 'command': 'quit' }
984 # @stop:
986 # Stop all guest VCPU execution.
988 # Since:  0.14.0
990 # Notes:  This function will succeed even if the guest is already in the stopped
991 #         state
993 { 'command': 'stop' }
996 # @system_reset:
998 # Performs a hard reset of a guest.
1000 # Since: 0.14.0
1002 { 'command': 'system_reset' }
1005 # @system_powerdown:
1007 # Requests that a guest perform a powerdown operation.
1009 # Since: 0.14.0
1011 # Notes: A guest may or may not respond to this command.  This command
1012 #        returning does not indicate that a guest has accepted the request or
1013 #        that it has shut down.  Many guests will respond to this command by
1014 #        prompting the user in some way.
1016 { 'command': 'system_powerdown' }
1019 # @cpu:
1021 # This command is a nop that is only provided for the purposes of compatibility.
1023 # Since: 0.14.0
1025 # Notes: Do not use this command.
1027 { 'command': 'cpu', 'data': {'index': 'int'} }
1030 # @memsave:
1032 # Save a portion of guest memory to a file.
1034 # @val: the virtual address of the guest to start from
1036 # @size: the size of memory region to save
1038 # @filename: the file to save the memory to as binary data
1040 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1041 #                       virtual address (defaults to CPU 0)
1043 # Returns: Nothing on success
1045 # Since: 0.14.0
1047 # Notes: Errors were not reliably returned until 1.1
1049 { 'command': 'memsave',
1050   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1053 # @pmemsave:
1055 # Save a portion of guest physical memory to a file.
1057 # @val: the physical address of the guest to start from
1059 # @size: the size of memory region to save
1061 # @filename: the file to save the memory to as binary data
1063 # Returns: Nothing on success
1065 # Since: 0.14.0
1067 # Notes: Errors were not reliably returned until 1.1
1069 { 'command': 'pmemsave',
1070   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1073 # @cont:
1075 # Resume guest VCPU execution.
1077 # Since:  0.14.0
1079 # Returns:  If successful, nothing
1080 #           If the QEMU is waiting for an incoming migration, MigrationExpected
1081 #           If QEMU was started with an encrypted block device and a key has
1082 #              not yet been set, DeviceEncrypted.
1084 # Notes:  This command will succeed if the guest is currently running.
1086 { 'command': 'cont' }
1089 # @system_wakeup:
1091 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1093 # Since:  1.1
1095 # Returns:  nothing.
1097 { 'command': 'system_wakeup' }
1100 # @inject-nmi:
1102 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1104 # Returns:  If successful, nothing
1106 # Since:  0.14.0
1108 # Notes: Only x86 Virtual Machines support this command.
1110 { 'command': 'inject-nmi' }
1113 # @set_link:
1115 # Sets the link status of a virtual network adapter.
1117 # @name: the device name of the virtual network adapter
1119 # @up: true to set the link status to be up
1121 # Returns: Nothing on success
1122 #          If @name is not a valid network device, DeviceNotFound
1124 # Since: 0.14.0
1126 # Notes: Not all network adapters support setting link status.  This command
1127 #        will succeed even if the network adapter does not support link status
1128 #        notification.
1130 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1133 # @block_passwd:
1135 # This command sets the password of a block device that has not been open
1136 # with a password and requires one.
1138 # The two cases where this can happen are a block device is created through
1139 # QEMU's initial command line or a block device is changed through the legacy
1140 # @change interface.
1142 # In the event that the block device is created through the initial command
1143 # line, the VM will start in the stopped state regardless of whether '-S' is
1144 # used.  The intention is for a management tool to query the block devices to
1145 # determine which ones are encrypted, set the passwords with this command, and
1146 # then start the guest with the @cont command.
1148 # @device:   the name of the device to set the password on
1150 # @password: the password to use for the device
1152 # Returns: nothing on success
1153 #          If @device is not a valid block device, DeviceNotFound
1154 #          If @device is not encrypted, DeviceNotEncrypted
1156 # Notes:  Not all block formats support encryption and some that do are not
1157 #         able to validate that a password is correct.  Disk corruption may
1158 #         occur if an invalid password is specified.
1160 # Since: 0.14.0
1162 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1165 # @balloon:
1167 # Request the balloon driver to change its balloon size.
1169 # @value: the target size of the balloon in bytes
1171 # Returns: Nothing on success
1172 #          If the balloon driver is enabled but not functional because the KVM
1173 #            kernel module cannot support it, KvmMissingCap
1174 #          If no balloon device is present, DeviceNotActive
1176 # Notes: This command just issues a request to the guest.  When it returns,
1177 #        the balloon size may not have changed.  A guest can change the balloon
1178 #        size independent of this command.
1180 # Since: 0.14.0
1182 { 'command': 'balloon', 'data': {'value': 'int'} }
1185 # @block_resize
1187 # Resize a block image while a guest is running.
1189 # @device:  the name of the device to get the image resized
1191 # @size:  new image size in bytes
1193 # Returns: nothing on success
1194 #          If @device is not a valid block device, DeviceNotFound
1196 # Since: 0.14.0
1198 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1201 # @NewImageMode
1203 # An enumeration that tells QEMU how to set the backing file path in
1204 # a new image file.
1206 # @existing: QEMU should look for an existing image file.
1208 # @absolute-paths: QEMU should create a new image with absolute paths
1209 # for the backing file.
1211 # Since: 1.1
1213 { 'enum': 'NewImageMode'
1214   'data': [ 'existing', 'absolute-paths' ] }
1217 # @BlockdevSnapshot
1219 # @device:  the name of the device to generate the snapshot from.
1221 # @snapshot-file: the target of the new image. A new file will be created.
1223 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1225 # @mode: #optional whether and how QEMU should create a new image, default is
1226 # 'absolute-paths'.
1228 { 'type': 'BlockdevSnapshot',
1229   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1230             '*mode': 'NewImageMode' } }
1233 # @BlockdevAction
1235 # A discriminated record of operations that can be performed with
1236 # @transaction.
1238 { 'union': 'BlockdevAction',
1239   'data': {
1240        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1241    } }
1244 # @transaction
1246 # Atomically operate on a group of one or more block devices.  If
1247 # any operation fails, then the entire set of actions will be
1248 # abandoned and the appropriate error returned.  The only operation
1249 # supported is currently blockdev-snapshot-sync.
1251 #  List of:
1252 #  @BlockdevAction: information needed for the device snapshot
1254 # Returns: nothing on success
1255 #          If @device is not a valid block device, DeviceNotFound
1257 # Note: The transaction aborts on the first failure.  Therefore, there will
1258 # be only one device or snapshot file returned in an error condition, and
1259 # subsequent actions will not have been attempted.
1261 # Since 1.1
1263 { 'command': 'transaction',
1264   'data': { 'actions': [ 'BlockdevAction' ] } }
1267 # @blockdev-snapshot-sync
1269 # Generates a synchronous snapshot of a block device.
1271 # @device:  the name of the device to generate the snapshot from.
1273 # @snapshot-file: the target of the new image. If the file exists, or if it
1274 #                 is a device, the snapshot will be created in the existing
1275 #                 file/device. If does not exist, a new file will be created.
1277 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1279 # @mode: #optional whether and how QEMU should create a new image, default is
1280 # 'absolute-paths'.
1282 # Returns: nothing on success
1283 #          If @device is not a valid block device, DeviceNotFound
1285 # Since 0.14.0
1287 { 'command': 'blockdev-snapshot-sync',
1288   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1289             '*mode': 'NewImageMode'} }
1292 # @human-monitor-command:
1294 # Execute a command on the human monitor and return the output.
1296 # @command-line: the command to execute in the human monitor
1298 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1300 # Returns: the output of the command as a string
1302 # Since: 0.14.0
1304 # Notes: This command only exists as a stop-gap.  It's use is highly
1305 #        discouraged.  The semantics of this command are not guaranteed.
1307 #        Known limitations:
1309 #        o This command is stateless, this means that commands that depend
1310 #          on state information (such as getfd) might not work
1312 #       o Commands that prompt the user for data (eg. 'cont' when the block
1313 #         device is encrypted) don't currently work
1315 { 'command': 'human-monitor-command',
1316   'data': {'command-line': 'str', '*cpu-index': 'int'},
1317   'returns': 'str' }
1320 # @migrate_cancel
1322 # Cancel the current executing migration process.
1324 # Returns: nothing on success
1326 # Notes: This command succeeds even if there is no migration process running.
1328 # Since: 0.14.0
1330 { 'command': 'migrate_cancel' }
1333 # @migrate_set_downtime
1335 # Set maximum tolerated downtime for migration.
1337 # @value: maximum downtime in seconds
1339 # Returns: nothing on success
1341 # Since: 0.14.0
1343 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1346 # @migrate_set_speed
1348 # Set maximum speed for migration.
1350 # @value: maximum speed in bytes.
1352 # Returns: nothing on success
1354 # Notes: A value lesser than zero will be automatically round up to zero.
1356 # Since: 0.14.0
1358 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1361 # @ObjectPropertyInfo:
1363 # @name: the name of the property
1365 # @type: the type of the property.  This will typically come in one of four
1366 #        forms:
1368 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1369 #           These types are mapped to the appropriate JSON type.
1371 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
1372 #           legacy qdev typename.  These types are always treated as strings.
1374 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
1375 #           device type name.  Child properties create the composition tree.
1377 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
1378 #           device type name.  Link properties form the device model graph.
1380 # Since: 1.1
1382 # Notes: This type is experimental.  Its syntax may change in future releases.
1384 { 'type': 'ObjectPropertyInfo',
1385   'data': { 'name': 'str', 'type': 'str' } }
1388 # @qom-list:
1390 # This command will list any properties of a object given a path in the object
1391 # model.
1393 # @path: the path within the object model.  See @qom-get for a description of
1394 #        this parameter.
1396 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1397 #          object.
1399 # Since: 1.1
1401 # Notes: This command is experimental.  It's syntax may change in future
1402 #        releases.
1404 { 'command': 'qom-list',
1405   'data': { 'path': 'str' },
1406   'returns': [ 'ObjectPropertyInfo' ] }
1409 # @qom-get:
1411 # This command will get a property from a object model path and return the
1412 # value.
1414 # @path: The path within the object model.  There are two forms of supported
1415 #        paths--absolute and partial paths.
1417 #        Absolute paths are derived from the root object and can follow child<>
1418 #        or link<> properties.  Since they can follow link<> properties, they
1419 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1420 #        and are prefixed  with a leading slash.
1422 #        Partial paths look like relative filenames.  They do not begin
1423 #        with a prefix.  The matching rules for partial paths are subtle but
1424 #        designed to make specifying objects easy.  At each level of the
1425 #        composition tree, the partial path is matched as an absolute path.
1426 #        The first match is not returned.  At least two matches are searched
1427 #        for.  A successful result is only returned if only one match is
1428 #        found.  If more than one match is found, a flag is return to
1429 #        indicate that the match was ambiguous.
1431 # @property: The property name to read
1433 # Returns: The property value.  The type depends on the property type.  legacy<>
1434 #          properties are returned as #str.  child<> and link<> properties are
1435 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
1436 #          are returned as #int.
1438 # Since: 1.1
1440 # Notes: This command is experimental and may change syntax in future releases.
1442 { 'command': 'qom-get',
1443   'data': { 'path': 'str', 'property': 'str' },
1444   'returns': 'visitor',
1445   'gen': 'no' }
1448 # @qom-set:
1450 # This command will set a property from a object model path.
1452 # @path: see @qom-get for a description of this parameter
1454 # @property: the property name to set
1456 # @value: a value who's type is appropriate for the property type.  See @qom-get
1457 #         for a description of type mapping.
1459 # Since: 1.1
1461 # Notes: This command is experimental and may change syntax in future releases.
1463 { 'command': 'qom-set',
1464   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1465   'gen': 'no' }
1468 # @set_password:
1470 # Sets the password of a remote display session.
1472 # @protocol: `vnc' to modify the VNC server password
1473 #            `spice' to modify the Spice server password
1475 # @password: the new password
1477 # @connected: #optional how to handle existing clients when changing the
1478 #                       password.  If nothing is specified, defaults to `keep'
1479 #                       `fail' to fail the command if clients are connected
1480 #                       `disconnect' to disconnect existing clients
1481 #                       `keep' to maintain existing clients
1483 # Returns: Nothing on success
1484 #          If Spice is not enabled, DeviceNotFound
1486 # Since: 0.14.0
1488 { 'command': 'set_password',
1489   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
1492 # @expire_password:
1494 # Expire the password of a remote display server.
1496 # @protocol: the name of the remote display protocol `vnc' or `spice'
1498 # @time: when to expire the password.
1499 #        `now' to expire the password immediately
1500 #        `never' to cancel password expiration
1501 #        `+INT' where INT is the number of seconds from now (integer)
1502 #        `INT' where INT is the absolute time in seconds
1504 # Returns: Nothing on success
1505 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
1507 # Since: 0.14.0
1509 # Notes: Time is relative to the server and currently there is no way to
1510 #        coordinate server time with client time.  It is not recommended to
1511 #        use the absolute time version of the @time parameter unless you're
1512 #        sure you are on the same machine as the QEMU instance.
1514 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
1517 # @eject:
1519 # Ejects a device from a removable drive.
1521 # @device:  The name of the device
1523 # @force:   @optional If true, eject regardless of whether the drive is locked.
1524 #           If not specified, the default value is false.
1526 # Returns:  Nothing on success
1527 #           If @device is not a valid block device, DeviceNotFound
1529 # Notes:    Ejecting a device will no media results in success
1531 # Since: 0.14.0
1533 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
1536 # @change-vnc-password:
1538 # Change the VNC server password.
1540 # @target:  the new password to use with VNC authentication
1542 # Since: 1.1
1544 # Notes:  An empty password in this command will set the password to the empty
1545 #         string.  Existing clients are unaffected by executing this command.
1547 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
1550 # @change:
1552 # This command is multiple commands multiplexed together.
1554 # @device: This is normally the name of a block device but it may also be 'vnc'.
1555 #          when it's 'vnc', then sub command depends on @target
1557 # @target: If @device is a block device, then this is the new filename.
1558 #          If @device is 'vnc', then if the value 'password' selects the vnc
1559 #          change password command.   Otherwise, this specifies a new server URI
1560 #          address to listen to for VNC connections.
1562 # @arg:    If @device is a block device, then this is an optional format to open
1563 #          the device with.
1564 #          If @device is 'vnc' and @target is 'password', this is the new VNC
1565 #          password to set.  If this argument is an empty string, then no future
1566 #          logins will be allowed.
1568 # Returns: Nothing on success.
1569 #          If @device is not a valid block device, DeviceNotFound
1570 #          If the new block device is encrypted, DeviceEncrypted.  Note that
1571 #          if this error is returned, the device has been opened successfully
1572 #          and an additional call to @block_passwd is required to set the
1573 #          device's password.  The behavior of reads and writes to the block
1574 #          device between when these calls are executed is undefined.
1576 # Notes:  It is strongly recommended that this interface is not used especially
1577 #         for changing block devices.
1579 # Since: 0.14.0
1581 { 'command': 'change',
1582   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1585 # @block_set_io_throttle:
1587 # Change I/O throttle limits for a block drive.
1589 # @device: The name of the device
1591 # @bps: total throughput limit in bytes per second
1593 # @bps_rd: read throughput limit in bytes per second
1595 # @bps_wr: write throughput limit in bytes per second
1597 # @iops: total I/O operations per second
1599 # @ops_rd: read I/O operations per second
1601 # @iops_wr: write I/O operations per second
1603 # Returns: Nothing on success
1604 #          If @device is not a valid block device, DeviceNotFound
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 @device does not exist, DeviceNotFound
1640 # Since: 1.1
1642 { 'command': 'block-stream', 'data': { 'device': 'str', '*base': 'str',
1643                                        '*speed': 'int' } }
1646 # @block-job-set-speed:
1648 # Set maximum speed for a background block operation.
1650 # This command can only be issued when there is an active block job.
1652 # Throttling can be disabled by setting the speed to 0.
1654 # @device: the device name
1656 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
1657 #          Defaults to 0.
1659 # Returns: Nothing on success
1660 #          If no background operation is active on this device, DeviceNotActive
1662 # Since: 1.1
1664 { 'command': 'block-job-set-speed',
1665   'data': { 'device': 'str', 'speed': 'int' } }
1668 # @block-job-cancel:
1670 # Stop an active background block operation.
1672 # This command returns immediately after marking the active background block
1673 # operation for cancellation.  It is an error to call this command if no
1674 # operation is in progress.
1676 # The operation will cancel as soon as possible and then emit the
1677 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
1678 # enumerated using query-block-jobs.
1680 # For streaming, the image file retains its backing file unless the streaming
1681 # operation happens to complete just as it is being cancelled.  A new streaming
1682 # operation can be started at a later time to finish copying all data from the
1683 # backing file.
1685 # @device: the device name
1687 # Returns: Nothing on success
1688 #          If no background operation is active on this device, DeviceNotActive
1690 # Since: 1.1
1692 { 'command': 'block-job-cancel', 'data': { 'device': 'str' } }
1695 # @ObjectTypeInfo:
1697 # This structure describes a search result from @qom-list-types
1699 # @name: the type name found in the search
1701 # Since: 1.1
1703 # Notes: This command is experimental and may change syntax in future releases.
1705 { 'type': 'ObjectTypeInfo',
1706   'data': { 'name': 'str' } }
1709 # @qom-list-types:
1711 # This command will return a list of types given search parameters
1713 # @implements: if specified, only return types that implement this type name
1715 # @abstract: if true, include abstract types in the results
1717 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1719 # Since: 1.1
1721 # Notes: This command is experimental and may change syntax in future releases.
1723 { 'command': 'qom-list-types',
1724   'data': { '*implements': 'str', '*abstract': 'bool' },
1725   'returns': [ 'ObjectTypeInfo' ] }
1728 # @migrate
1730 # Migrates the current running guest to another Virtual Machine.
1732 # @uri: the Uniform Resource Identifier of the destination VM
1734 # @blk: #optional do block migration (full disk copy)
1736 # @inc: #optional incremental disk copy migration
1738 # @detach: this argument exists only for compatibility reasons and
1739 #          is ignored by QEMU
1741 # Returns: nothing on success
1743 # Since: 0.14.0
1745 { 'command': 'migrate',
1746   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
1748 # @xen-save-devices-state:
1750 # Save the state of all devices to file. The RAM and the block devices
1751 # of the VM are not saved by this command.
1753 # @filename: the file to save the state of the devices to as binary
1754 # data. See xen-save-devices-state.txt for a description of the binary
1755 # format.
1757 # Returns: Nothing on success
1759 # Since: 1.1
1761 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
1764 # @device_del:
1766 # Remove a device from a guest
1768 # @id: the name of the device
1770 # Returns: Nothing on success
1771 #          If @id is not a valid device, DeviceNotFound
1773 # Notes: When this command completes, the device may not be removed from the
1774 #        guest.  Hot removal is an operation that requires guest cooperation.
1775 #        This command merely requests that the guest begin the hot removal
1776 #        process.
1778 # Since: 0.14.0
1780 { 'command': 'device_del', 'data': {'id': 'str'} }
1783 # @dump-guest-memory
1785 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1786 # very long depending on the amount of guest memory. This command is only
1787 # supported on i386 and x86_64.
1789 # @paging: if true, do paging to get guest's memory mapping. This allows
1790 # using gdb to process the core file. However, setting @paging to false
1791 # may be desirable because of two reasons:
1793 #   1. The guest may be in a catastrophic state or can have corrupted
1794 #      memory, which cannot be trusted
1795 #   2. The guest can be in real-mode even if paging is enabled. For example,
1796 #      the guest uses ACPI to sleep, and ACPI sleep state goes in real-mode
1798 # @protocol: the filename or file descriptor of the vmcore. The supported
1799 # protocols are:
1801 #   1. file: the protocol starts with "file:", and the following string is
1802 #      the file's path.
1803 #   2. fd: the protocol starts with "fd:", and the following string is the
1804 #      fd's name.
1806 # @begin: #optional if specified, the starting physical address.
1808 # @length: #optional if specified, the memory size, in bytes. If you don't
1809 # want to dump all guest's memory, please specify the start @begin and @length
1811 # Returns: nothing on success
1813 # Since: 1.2
1815 { 'command': 'dump-guest-memory',
1816   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
1817             '*length': 'int' } }
1819 # @netdev_add:
1821 # Add a network backend.
1823 # @type: the type of network backend.  Current valid values are 'user', 'tap',
1824 #        'vde', 'socket', 'dump' and 'bridge'
1826 # @id: the name of the new network backend
1828 # @props: #optional a list of properties to be passed to the backend in
1829 #         the format 'name=value', like 'ifname=tap0,script=no'
1831 # Notes: The semantics of @props is not well defined.  Future commands will be
1832 #        introduced that provide stronger typing for backend creation.
1834 # Since: 0.14.0
1836 # Returns: Nothing on success
1837 #          If @type is not a valid network backend, DeviceNotFound
1839 { 'command': 'netdev_add',
1840   'data': {'type': 'str', 'id': 'str', '*props': '**'},
1841   'gen': 'no' }
1844 # @netdev_del:
1846 # Remove a network backend.
1848 # @id: the name of the network backend to remove
1850 # Returns: Nothing on success
1851 #          If @id is not a valid network backend, DeviceNotFound
1853 # Since: 0.14.0
1855 { 'command': 'netdev_del', 'data': {'id': 'str'} }
1858 # @NetdevNoneOptions
1860 # Use it alone to have zero network devices.
1862 # Since 1.2
1864 { 'type': 'NetdevNoneOptions',
1865   'data': { } }
1868 # @NetLegacyNicOptions
1870 # Create a new Network Interface Card.
1872 # @netdev: #optional id of -netdev to connect to
1874 # @macaddr: #optional MAC address
1876 # @model: #optional device model (e1000, rtl8139, virtio etc.)
1878 # @addr: #optional PCI device address
1880 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
1882 # Since 1.2
1884 { 'type': 'NetLegacyNicOptions',
1885   'data': {
1886     '*netdev':  'str',
1887     '*macaddr': 'str',
1888     '*model':   'str',
1889     '*addr':    'str',
1890     '*vectors': 'uint32' } }
1893 # @String
1895 # A fat type wrapping 'str', to be embedded in lists.
1897 # Since 1.2
1899 { 'type': 'String',
1900   'data': {
1901     'str': 'str' } }
1904 # @NetdevUserOptions
1906 # Use the user mode network stack which requires no administrator privilege to
1907 # run.
1909 # @hostname: #optional client hostname reported by the builtin DHCP server
1911 # @restrict: #optional isolate the guest from the host
1913 # @ip: #optional legacy parameter, use net= instead
1915 # @net: #optional IP address and optional netmask
1917 # @host: #optional guest-visible address of the host
1919 # @tftp: #optional root directory of the built-in TFTP server
1921 # @bootfile: #optional BOOTP filename, for use with tftp=
1923 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
1924 #             assign
1926 # @dns: #optional guest-visible address of the virtual nameserver
1928 # @smb: #optional root directory of the built-in SMB server
1930 # @smbserver: #optional IP address of the built-in SMB server
1932 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
1933 #           endpoints
1935 # @guestfwd: #optional forward guest TCP connections
1937 # Since 1.2
1939 { 'type': 'NetdevUserOptions',
1940   'data': {
1941     '*hostname':  'str',
1942     '*restrict':  'bool',
1943     '*ip':        'str',
1944     '*net':       'str',
1945     '*host':      'str',
1946     '*tftp':      'str',
1947     '*bootfile':  'str',
1948     '*dhcpstart': 'str',
1949     '*dns':       'str',
1950     '*smb':       'str',
1951     '*smbserver': 'str',
1952     '*hostfwd':   ['String'],
1953     '*guestfwd':  ['String'] } }
1956 # @NetdevTapOptions
1958 # Connect the host TAP network interface name to the VLAN.
1960 # @ifname: #optional interface name
1962 # @fd: #optional file descriptor of an already opened tap
1964 # @script: #optional script to initialize the interface
1966 # @downscript: #optional script to shut down the interface
1968 # @helper: #optional command to execute to configure bridge
1970 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
1972 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
1974 # @vhost: #optional enable vhost-net network accelerator
1976 # @vhostfd: #optional file descriptor of an already opened vhost net device
1978 # @vhostforce: #optional vhost on for non-MSIX virtio guests
1980 # Since 1.2
1982 { 'type': 'NetdevTapOptions',
1983   'data': {
1984     '*ifname':     'str',
1985     '*fd':         'str',
1986     '*script':     'str',
1987     '*downscript': 'str',
1988     '*helper':     'str',
1989     '*sndbuf':     'size',
1990     '*vnet_hdr':   'bool',
1991     '*vhost':      'bool',
1992     '*vhostfd':    'str',
1993     '*vhostforce': 'bool' } }
1996 # @NetdevSocketOptions
1998 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
1999 # socket connection.
2001 # @fd: #optional file descriptor of an already opened socket
2003 # @listen: #optional port number, and optional hostname, to listen on
2005 # @connect: #optional port number, and optional hostname, to connect to
2007 # @mcast: #optional UDP multicast address and port number
2009 # @localaddr: #optional source address and port for multicast and udp packets
2011 # @udp: #optional UDP unicast address and port number
2013 # Since 1.2
2015 { 'type': 'NetdevSocketOptions',
2016   'data': {
2017     '*fd':        'str',
2018     '*listen':    'str',
2019     '*connect':   'str',
2020     '*mcast':     'str',
2021     '*localaddr': 'str',
2022     '*udp':       'str' } }
2025 # @NetdevVdeOptions
2027 # Connect the VLAN to a vde switch running on the host.
2029 # @sock: #optional socket path
2031 # @port: #optional port number
2033 # @group: #optional group owner of socket
2035 # @mode: #optional permissions for socket
2037 # Since 1.2
2039 { 'type': 'NetdevVdeOptions',
2040   'data': {
2041     '*sock':  'str',
2042     '*port':  'uint16',
2043     '*group': 'str',
2044     '*mode':  'uint16' } }
2047 # @NetdevDumpOptions
2049 # Dump VLAN network traffic to a file.
2051 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2052 # suffixes.
2054 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2056 # Since 1.2
2058 { 'type': 'NetdevDumpOptions',
2059   'data': {
2060     '*len':  'size',
2061     '*file': 'str' } }
2064 # @NetdevBridgeOptions
2066 # Connect a host TAP network interface to a host bridge device.
2068 # @br: #optional bridge name
2070 # @helper: #optional command to execute to configure bridge
2072 # Since 1.2
2074 { 'type': 'NetdevBridgeOptions',
2075   'data': {
2076     '*br':     'str',
2077     '*helper': 'str' } }
2080 # @NetdevHubPortOptions
2082 # Connect two or more net clients through a software hub.
2084 # @hubid: hub identifier number
2086 # Since 1.2
2088 { 'type': 'NetdevHubPortOptions',
2089   'data': {
2090     'hubid':     'int32' } }
2093 # @NetClientOptions
2095 # A discriminated record of network device traits.
2097 # Since 1.2
2099 { 'union': 'NetClientOptions',
2100   'data': {
2101     'none':     'NetdevNoneOptions',
2102     'nic':      'NetLegacyNicOptions',
2103     'user':     'NetdevUserOptions',
2104     'tap':      'NetdevTapOptions',
2105     'socket':   'NetdevSocketOptions',
2106     'vde':      'NetdevVdeOptions',
2107     'dump':     'NetdevDumpOptions',
2108     'bridge':   'NetdevBridgeOptions',
2109     'hubport':  'NetdevHubPortOptions' } }
2112 # @NetLegacy
2114 # Captures the configuration of a network device; legacy.
2116 # @vlan: #optional vlan number
2118 # @id: #optional identifier for monitor commands
2120 # @name: #optional identifier for monitor commands, ignored if @id is present
2122 # @opts: device type specific properties (legacy)
2124 # Since 1.2
2126 { 'type': 'NetLegacy',
2127   'data': {
2128     '*vlan': 'int32',
2129     '*id':   'str',
2130     '*name': 'str',
2131     'opts':  'NetClientOptions' } }
2134 # @Netdev
2136 # Captures the configuration of a network device.
2138 # @id: identifier for monitor commands.
2140 # @opts: device type specific properties
2142 # Since 1.2
2144 { 'type': 'Netdev',
2145   'data': {
2146     'id':   'str',
2147     'opts': 'NetClientOptions' } }
2150 # @getfd:
2152 # Receive a file descriptor via SCM rights and assign it a name
2154 # @fdname: file descriptor name
2156 # Returns: Nothing on success
2158 # Since: 0.14.0
2160 # Notes: If @fdname already exists, the file descriptor assigned to
2161 #        it will be closed and replaced by the received file
2162 #        descriptor.
2163 #        The 'closefd' command can be used to explicitly close the
2164 #        file descriptor when it is no longer needed.
2166 { 'command': 'getfd', 'data': {'fdname': 'str'} }
2169 # @closefd:
2171 # Close a file descriptor previously passed via SCM rights
2173 # @fdname: file descriptor name
2175 # Returns: Nothing on success
2177 # Since: 0.14.0
2179 { 'command': 'closefd', 'data': {'fdname': 'str'} }