8 # Guest name information.
10 # @name: #optional The name of the guest
14 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
19 # Return the name information of a guest.
21 # Returns: @NameInfo of the guest
25 { 'command': 'query-name', 'returns': 'NameInfo' }
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.
49 { 'type': 'VersionInfo',
50 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
56 # Returns the current version of QEMU.
58 # Returns: A @VersionInfo object describing the current version of QEMU.
62 { 'command': 'query-version', 'returns': 'VersionInfo' }
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
75 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
80 # Returns information about KVM acceleration
86 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
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
102 # @io-error: the last IOP has failed and the device is configured to pause
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' ] }
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
141 # Notes: @singlestep is enabled through the GDB stub
143 { 'type': 'StatusInfo',
144 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
149 # Query the run status of all VCPUs
151 # Returns: @StatusInfo reflecting all VCPUs
155 { 'command': 'query-status', 'returns': 'StatusInfo' }
160 # Guest UUID information.
162 # @UUID: the UUID of the guest
166 # Notes: If no UUID was specified for the guest, a null UUID is returned.
168 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
173 # Query the guest UUID information.
175 # Returns: The @UuidInfo for the guest
179 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
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.
195 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
200 # Returns information about current character devices.
202 # Returns: a list of @ChardevInfo
206 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
211 # Information about a QMP command
213 # @name: The command name
217 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
222 # Return a list of supported QMP commands by this server
224 # Returns: A list of @CommandInfo for all supported commands
228 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
233 # Information about a QMP event
235 # @name: The event name
239 { 'type': 'EventInfo', 'data': {'name': 'str'} }
244 # Return a list of supported QMP events by this server
246 # Returns: A list of @EventInfo for all supported events
250 { 'command': 'query-events', 'returns': ['EventInfo'] }
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
265 { 'type': 'MigrationStats',
266 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' } }
271 # Information about current migration process.
273 # @status: #optional string describing the current migration status.
274 # As of 0.14.0 this can be 'active', 'completed', 'failed' or
275 # 'cancelled'. If this field is not returned, no migration process
278 # @ram: #optional @MigrationStats containing detailed migration status,
279 # only returned if status is 'active'
281 # @disk: #optional @MigrationStats containing detailed disk migration
282 # status, only returned if status is 'active' and it is a block
287 { 'type': 'MigrationInfo',
288 'data': {'*status': 'str', '*ram': 'MigrationStats',
289 '*disk': 'MigrationStats'} }
294 # Returns information about current migration process.
296 # Returns: @MigrationInfo
300 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
305 # Information about a mouse device.
307 # @name: the name of the mouse device
309 # @index: the index of the mouse device
311 # @current: true if this device is currently receiving mouse events
313 # @absolute: true if this device supports absolute coordinates as input
317 { 'type': 'MouseInfo',
318 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
319 'absolute': 'bool'} }
324 # Returns information about each active mouse device
326 # Returns: a list of @MouseInfo for each device
330 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
335 # Information about a virtual CPU
337 # @CPU: the index of the virtual CPU
339 # @current: this only exists for backwards compatible and should be ignored
341 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
342 # to a processor specific low power mode.
344 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
346 # If the target is Sparc, this is the PC component of the
347 # instruction pointer.
349 # @nip: #optional If the target is PPC, the instruction pointer
351 # @npc: #optional If the target is Sparc, the NPC component of the instruction
354 # @PC: #optional If the target is MIPS, the instruction pointer
356 # @thread_id: ID of the underlying host thread
360 # Notes: @halted is a transient state that changes frequently. By the time the
361 # data is sent to the client, the guest may no longer be halted.
364 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
365 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
370 # Returns a list of information about each virtual CPU.
372 # Returns: a list of @CpuInfo for each virtual CPU
376 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
381 # Information about the backing device for a block device.
383 # @file: the filename of the backing device
385 # @ro: true if the backing device was open read-only
387 # @drv: the name of the block format used to open the backing device. As of
388 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
389 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
390 # 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
391 # 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
393 # @backing_file: #optional the name of the backing file (for copy-on-write)
395 # @encrypted: true if the backing device is encrypted
397 # @bps: total throughput limit in bytes per second is specified
399 # @bps_rd: read throughput limit in bytes per second is specified
401 # @bps_wr: write throughput limit in bytes per second is specified
403 # @iops: total I/O operations per second is specified
405 # @iops_rd: read I/O operations per second is specified
407 # @iops_wr: write I/O operations per second is specified
411 # Notes: This interface is only found in @BlockInfo.
413 { 'type': 'BlockDeviceInfo',
414 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
415 '*backing_file': 'str', 'encrypted': 'bool',
416 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
417 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
420 # @BlockDeviceIoStatus:
422 # An enumeration of block device I/O status.
424 # @ok: The last I/O operation has succeeded
426 # @failed: The last I/O operation has failed
428 # @nospace: The last I/O operation has failed due to a no-space condition
432 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
437 # Block device information. This structure describes a virtual device and
438 # the backing device associated with it.
440 # @device: The device name associated with the virtual device.
442 # @type: This field is returned only for compatibility reasons, it should
443 # not be used (always returns 'unknown')
445 # @removable: True if the device supports removable media.
447 # @locked: True if the guest has locked this device from having its media
450 # @tray_open: #optional True if the device has a tray and it is open
451 # (only present if removable is true)
453 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
454 # supports it and the VM is configured to stop on errors
456 # @inserted: #optional @BlockDeviceInfo describing the device if media is
461 { 'type': 'BlockInfo',
462 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
463 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
464 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus'} }
469 # Get a list of BlockInfo for all virtual block devices.
471 # Returns: a list of @BlockInfo describing each virtual block device
475 { 'command': 'query-block', 'returns': ['BlockInfo'] }
480 # Statistics of a virtual block device or a block backing device.
482 # @rd_bytes: The number of bytes read by the device.
484 # @wr_bytes: The number of bytes written by the device.
486 # @rd_operations: The number of read operations performed by the device.
488 # @wr_operations: The number of write operations performed by the device.
490 # @flush_operations: The number of cache flush operations performed by the
491 # device (since 0.15.0)
493 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
496 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
498 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
500 # @wr_highest_offset: The offset after the greatest byte written to the
501 # device. The intended use of this information is for
502 # growable sparse files (like qcow2) that are used on top
503 # of a physical device.
507 { 'type': 'BlockDeviceStats',
508 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
509 'wr_operations': 'int', 'flush_operations': 'int',
510 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
511 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
516 # Statistics of a virtual block device or a block backing device.
518 # @device: #optional If the stats are for a virtual block device, the name
519 # corresponding to the virtual block device.
521 # @stats: A @BlockDeviceStats for the device.
523 # @parent: #optional This may point to the backing block device if this is a
524 # a virtual block device. If it's a backing block, this will point
525 # to the backing file is one is present.
529 { 'type': 'BlockStats',
530 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
531 '*parent': 'BlockStats'} }
536 # Query the @BlockStats for all virtual block devices.
538 # Returns: A list of @BlockStats for each virtual block devices.
542 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
547 # Information about a connected VNC client.
549 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
552 # @family: 'ipv6' if the client is connected via IPv6 and TCP
553 # 'ipv4' if the client is connected via IPv4 and TCP
554 # 'unix' if the client is connected via a unix domain socket
555 # 'unknown' otherwise
557 # @service: The service name of the client's port. This may depends on the
558 # host system's service database so symbolic names should not be
561 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
562 # Name of the client.
564 # @sasl_username: #optional If SASL authentication is in use, the SASL username
565 # used for authentication.
569 { 'type': 'VncClientInfo',
570 'data': {'host': 'str', 'family': 'str', 'service': 'str',
571 '*x509_dname': 'str', '*sasl_username': 'str'} }
576 # Information about the VNC session.
578 # @enabled: true if the VNC server is enabled, false otherwise
580 # @host: #optional The hostname the VNC server is bound to. This depends on
581 # the name resolution on the host and may be an IP address.
583 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
584 # 'ipv4' if the host is listening for IPv4 connections
585 # 'unix' if the host is listening on a unix domain socket
586 # 'unknown' otherwise
588 # @service: #optional The service name of the server's port. This may depends
589 # on the host system's service database so symbolic names should not
592 # @auth: #optional the current authentication type used by the server
593 # 'none' if no authentication is being used
594 # 'vnc' if VNC authentication is being used
595 # 'vencrypt+plain' if VEncrypt is used with plain text authentication
596 # 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
597 # 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
598 # 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
599 # 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
600 # 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
601 # 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
602 # 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
603 # 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
605 # @clients: a list of @VncClientInfo of all currently connected clients
610 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
611 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
616 # Returns information about the current VNC server
619 # If VNC support is not compiled in, FeatureDisabled
623 { 'command': 'query-vnc', 'returns': 'VncInfo' }
628 # Information about a SPICE client channel.
630 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
633 # @family: 'ipv6' if the client is connected via IPv6 and TCP
634 # 'ipv4' if the client is connected via IPv4 and TCP
635 # 'unix' if the client is connected via a unix domain socket
636 # 'unknown' otherwise
638 # @port: The client's port number.
640 # @connection-id: SPICE connection id number. All channels with the same id
641 # belong to the same SPICE session.
643 # @connection-type: SPICE channel type number. "1" is the main control
644 # channel, filter for this one if you want to track spice
647 # @channel-id: SPICE channel ID number. Usually "0", might be different when
648 # multiple channels of the same type exist, such as multiple
649 # display channels in a multihead setup
651 # @tls: true if the channel is encrypted, false otherwise.
655 { 'type': 'SpiceChannel',
656 'data': {'host': 'str', 'family': 'str', 'port': 'str',
657 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
661 # @SpiceQueryMouseMode
663 # An enumation of Spice mouse states.
665 # @client: Mouse cursor position is determined by the client.
667 # @server: Mouse cursor position is determined by the server.
669 # @unknown: No information is available about mouse mode used by
672 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
676 { 'enum': 'SpiceQueryMouseMode',
677 'data': [ 'client', 'server', 'unknown' ] }
682 # Information about the SPICE session.
684 # @enabled: true if the SPICE server is enabled, false otherwise
686 # @host: #optional The hostname the SPICE server is bound to. This depends on
687 # the name resolution on the host and may be an IP address.
689 # @port: #optional The SPICE server's port number.
691 # @compiled-version: #optional SPICE server version.
693 # @tls-port: #optional The SPICE server's TLS port number.
695 # @auth: #optional the current authentication type used by the server
696 # 'none' if no authentication is being used
697 # 'spice' uses SASL or direct TLS authentication, depending on command
700 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
701 # be determined by the client or the server, or unknown if spice
702 # server doesn't provide this information.
706 # @channels: a list of @SpiceChannel for each active spice channel
710 { 'type': 'SpiceInfo',
711 'data': {'enabled': 'bool', '*host': 'str', '*port': 'int',
712 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
713 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
718 # Returns information about the current SPICE server
720 # Returns: @SpiceInfo
724 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
729 # Information about the guest balloon device.
731 # @actual: the number of bytes the balloon currently contains
733 # @mem_swapped_in: #optional number of pages swapped in within the guest
735 # @mem_swapped_out: #optional number of pages swapped out within the guest
737 # @major_page_faults: #optional number of major page faults within the guest
739 # @minor_page_faults: #optional number of minor page faults within the guest
741 # @free_mem: #optional amount of memory (in bytes) free in the guest
743 # @total_mem: #optional amount of memory (in bytes) visible to the guest
747 # Notes: all current versions of QEMU do not fill out optional information in
750 { 'type': 'BalloonInfo',
751 'data': {'actual': 'int', '*mem_swapped_in': 'int',
752 '*mem_swapped_out': 'int', '*major_page_faults': 'int',
753 '*minor_page_faults': 'int', '*free_mem': 'int',
754 '*total_mem': 'int'} }
759 # Return information about the balloon device.
761 # Returns: @BalloonInfo on success
762 # If the balloon driver is enabled but not functional because the KVM
763 # kernel module cannot support it, KvmMissingCap
764 # If no balloon device is present, DeviceNotActive
768 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
773 # A PCI device memory region
775 # @base: the starting address (guest physical)
777 # @limit: the ending address (guest physical)
781 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
786 # Information about a PCI device I/O region.
788 # @bar: the index of the Base Address Register for this region
790 # @type: 'io' if the region is a PIO region
791 # 'memory' if the region is a MMIO region
793 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
795 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
799 { 'type': 'PciMemoryRegion',
800 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
801 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
806 # Information about a PCI Bridge device
808 # @bus.number: primary bus interface number. This should be the number of the
809 # bus the device resides on.
811 # @bus.secondary: secondary bus interface number. This is the number of the
812 # main bus for the bridge
814 # @bus.subordinate: This is the highest number bus that resides below the
817 # @bus.io_range: The PIO range for all devices on this bridge
819 # @bus.memory_range: The MMIO range for all devices on this bridge
821 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
824 # @devices: a list of @PciDeviceInfo for each device on this bridge
828 { 'type': 'PciBridgeInfo',
829 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
830 'io_range': 'PciMemoryRange',
831 'memory_range': 'PciMemoryRange',
832 'prefetchable_range': 'PciMemoryRange' },
833 '*devices': ['PciDeviceInfo']} }
838 # Information about a PCI device
840 # @bus: the bus number of the device
842 # @slot: the slot the device is located in
844 # @function: the function of the slot used by the device
846 # @class_info.desc: #optional a string description of the device's class
848 # @class_info.class: the class code of the device
850 # @id.device: the PCI device id
852 # @id.vendor: the PCI vendor id
854 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
856 # @qdev_id: the device name of the PCI device
858 # @pci_bridge: if the device is a PCI bridge, the bridge information
860 # @regions: a list of the PCI I/O regions associated with the device
862 # Notes: the contents of @class_info.desc are not stable and should only be
863 # treated as informational.
867 { 'type': 'PciDeviceInfo',
868 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
869 'class_info': {'*desc': 'str', 'class': 'int'},
870 'id': {'device': 'int', 'vendor': 'int'},
871 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
872 'regions': ['PciMemoryRegion']} }
877 # Information about a PCI bus
879 # @bus: the bus index
881 # @devices: a list of devices on this bus
885 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
890 # Return information about the PCI bus topology of the guest.
892 # Returns: a list of @PciInfo for each PCI bus
896 { 'command': 'query-pci', 'returns': ['PciInfo'] }
901 # Information about a long-running block device operation.
903 # @type: the job type ('stream' for image streaming)
905 # @device: the block device name
907 # @len: the maximum progress value
909 # @offset: the current progress value
911 # @speed: the rate limit, bytes per second
915 { 'type': 'BlockJobInfo',
916 'data': {'type': 'str', 'device': 'str', 'len': 'int',
917 'offset': 'int', 'speed': 'int'} }
922 # Return information about long-running block device operations.
924 # Returns: a list of @BlockJobInfo for each active block job
928 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
933 # This command will cause the QEMU process to exit gracefully. While every
934 # attempt is made to send the QMP response before terminating, this is not
935 # guaranteed. When using this interface, a premature EOF would not be
940 { 'command': 'quit' }
945 # Stop all guest VCPU execution.
949 # Notes: This function will succeed even if the guest is already in the stopped
952 { 'command': 'stop' }
957 # Performs a hard reset of a guest.
961 { 'command': 'system_reset' }
966 # Requests that a guest perform a powerdown operation.
970 # Notes: A guest may or may not respond to this command. This command
971 # returning does not indicate that a guest has accepted the request or
972 # that it has shut down. Many guests will respond to this command by
973 # prompting the user in some way.
975 { 'command': 'system_powerdown' }
980 # This command is a nop that is only provided for the purposes of compatibility.
984 # Notes: Do not use this command.
986 { 'command': 'cpu', 'data': {'index': 'int'} }
991 # Save a portion of guest memory to a file.
993 # @val: the virtual address of the guest to start from
995 # @size: the size of memory region to save
997 # @filename: the file to save the memory to as binary data
999 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1000 # virtual address (defaults to CPU 0)
1002 # Returns: Nothing on success
1003 # If @cpu is not a valid VCPU, InvalidParameterValue
1004 # If @filename cannot be opened, OpenFileFailed
1005 # If an I/O error occurs while writing the file, IOError
1009 # Notes: Errors were not reliably returned until 1.1
1011 { 'command': 'memsave',
1012 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1017 # Save a portion of guest physical memory to a file.
1019 # @val: the physical address of the guest to start from
1021 # @size: the size of memory region to save
1023 # @filename: the file to save the memory to as binary data
1025 # Returns: Nothing on success
1026 # If @filename cannot be opened, OpenFileFailed
1027 # If an I/O error occurs while writing the file, IOError
1031 # Notes: Errors were not reliably returned until 1.1
1033 { 'command': 'pmemsave',
1034 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1039 # Resume guest VCPU execution.
1043 # Returns: If successful, nothing
1044 # If the QEMU is waiting for an incoming migration, MigrationExpected
1045 # If QEMU was started with an encrypted block device and a key has
1046 # not yet been set, DeviceEncrypted.
1048 # Notes: This command will succeed if the guest is currently running.
1050 { 'command': 'cont' }
1055 # Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1061 { 'command': 'system_wakeup' }
1066 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1068 # Returns: If successful, nothing
1069 # If the Virtual Machine doesn't support NMI injection, Unsupported
1073 # Notes: Only x86 Virtual Machines support this command.
1075 { 'command': 'inject-nmi' }
1080 # Sets the link status of a virtual network adapter.
1082 # @name: the device name of the virtual network adapter
1084 # @up: true to set the link status to be up
1086 # Returns: Nothing on success
1087 # If @name is not a valid network device, DeviceNotFound
1091 # Notes: Not all network adapters support setting link status. This command
1092 # will succeed even if the network adapter does not support link status
1095 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1100 # This command sets the password of a block device that has not been open
1101 # with a password and requires one.
1103 # The two cases where this can happen are a block device is created through
1104 # QEMU's initial command line or a block device is changed through the legacy
1105 # @change interface.
1107 # In the event that the block device is created through the initial command
1108 # line, the VM will start in the stopped state regardless of whether '-S' is
1109 # used. The intention is for a management tool to query the block devices to
1110 # determine which ones are encrypted, set the passwords with this command, and
1111 # then start the guest with the @cont command.
1113 # @device: the name of the device to set the password on
1115 # @password: the password to use for the device
1117 # Returns: nothing on success
1118 # If @device is not a valid block device, DeviceNotFound
1119 # If @device is not encrypted, DeviceNotEncrypted
1120 # If @password is not valid for this device, InvalidPassword
1122 # Notes: Not all block formats support encryption and some that do are not
1123 # able to validate that a password is correct. Disk corruption may
1124 # occur if an invalid password is specified.
1128 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1133 # Request the balloon driver to change its balloon size.
1135 # @value: the target size of the balloon in bytes
1137 # Returns: Nothing on success
1138 # If the balloon driver is enabled but not functional because the KVM
1139 # kernel module cannot support it, KvmMissingCap
1140 # If no balloon device is present, DeviceNotActive
1142 # Notes: This command just issues a request to the guest. When it returns,
1143 # the balloon size may not have changed. A guest can change the balloon
1144 # size independent of this command.
1148 { 'command': 'balloon', 'data': {'value': 'int'} }
1153 # Resize a block image while a guest is running.
1155 # @device: the name of the device to get the image resized
1157 # @size: new image size in bytes
1159 # Returns: nothing on success
1160 # If @device is not a valid block device, DeviceNotFound
1161 # If @size is negative, InvalidParameterValue
1162 # If the block device has no medium inserted, DeviceHasNoMedium
1163 # If the block device does not support resize, Unsupported
1164 # If the block device is read-only, DeviceIsReadOnly
1165 # If a long-running operation is using the device, DeviceInUse
1169 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1174 # An enumeration that tells QEMU how to set the backing file path in
1177 # @existing: QEMU should look for an existing image file.
1179 # @absolute-paths: QEMU should create a new image with absolute paths
1180 # for the backing file.
1184 { 'enum': 'NewImageMode'
1185 'data': [ 'existing', 'absolute-paths' ] }
1190 # @device: the name of the device to generate the snapshot from.
1192 # @snapshot-file: the target of the new image. A new file will be created.
1194 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1196 # @mode: #optional whether and how QEMU should create a new image, default is
1199 { 'type': 'BlockdevSnapshot',
1200 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1201 '*mode': 'NewImageMode' } }
1206 # A discriminated record of operations that can be performed with
1209 { 'union': 'BlockdevAction',
1211 'blockdev-snapshot-sync': 'BlockdevSnapshot',
1217 # Atomically operate on a group of one or more block devices. If
1218 # any operation fails, then the entire set of actions will be
1219 # abandoned and the appropriate error returned. The only operation
1220 # supported is currently blockdev-snapshot-sync.
1223 # @BlockdevAction: information needed for the device snapshot
1225 # Returns: nothing on success
1226 # If @device is not a valid block device, DeviceNotFound
1227 # If @device is busy, DeviceInUse will be returned
1228 # If @snapshot-file can't be created, OpenFileFailed
1229 # If @snapshot-file can't be opened, OpenFileFailed
1230 # If @format is invalid, InvalidBlockFormat
1232 # Note: The transaction aborts on the first failure. Therefore, there will
1233 # be only one device or snapshot file returned in an error condition, and
1234 # subsequent actions will not have been attempted.
1238 { 'command': 'transaction',
1239 'data': { 'actions': [ 'BlockdevAction' ] } }
1242 # @blockdev-snapshot-sync
1244 # Generates a synchronous snapshot of a block device.
1246 # @device: the name of the device to generate the snapshot from.
1248 # @snapshot-file: the target of the new image. If the file exists, or if it
1249 # is a device, the snapshot will be created in the existing
1250 # file/device. If does not exist, a new file will be created.
1252 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1254 # @mode: #optional whether and how QEMU should create a new image, default is
1257 # Returns: nothing on success
1258 # If @device is not a valid block device, DeviceNotFound
1259 # If @snapshot-file can't be opened, OpenFileFailed
1260 # If @format is invalid, InvalidBlockFormat
1264 { 'command': 'blockdev-snapshot-sync',
1265 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1266 '*mode': 'NewImageMode'} }
1269 # @human-monitor-command:
1271 # Execute a command on the human monitor and return the output.
1273 # @command-line: the command to execute in the human monitor
1275 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1277 # Returns: the output of the command as a string
1281 # Notes: This command only exists as a stop-gap. It's use is highly
1282 # discouraged. The semantics of this command are not guaranteed.
1284 # Known limitations:
1286 # o This command is stateless, this means that commands that depend
1287 # on state information (such as getfd) might not work
1289 # o Commands that prompt the user for data (eg. 'cont' when the block
1290 # device is encrypted) don't currently work
1292 { 'command': 'human-monitor-command',
1293 'data': {'command-line': 'str', '*cpu-index': 'int'},
1299 # Cancel the current executing migration process.
1301 # Returns: nothing on success
1303 # Notes: This command succeeds even if there is no migration process running.
1307 { 'command': 'migrate_cancel' }
1310 # @migrate_set_downtime
1312 # Set maximum tolerated downtime for migration.
1314 # @value: maximum downtime in seconds
1316 # Returns: nothing on success
1320 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1323 # @migrate_set_speed
1325 # Set maximum speed for migration.
1327 # @value: maximum speed in bytes.
1329 # Returns: nothing on success
1331 # Notes: A value lesser than zero will be automatically round up to zero.
1335 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1338 # @ObjectPropertyInfo:
1340 # @name: the name of the property
1342 # @type: the type of the property. This will typically come in one of four
1345 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1346 # These types are mapped to the appropriate JSON type.
1348 # 2) A legacy type in the form 'legacy<subtype>' where subtype is the
1349 # legacy qdev typename. These types are always treated as strings.
1351 # 3) A child type in the form 'child<subtype>' where subtype is a qdev
1352 # device type name. Child properties create the composition tree.
1354 # 4) A link type in the form 'link<subtype>' where subtype is a qdev
1355 # device type name. Link properties form the device model graph.
1359 # Notes: This type is experimental. Its syntax may change in future releases.
1361 { 'type': 'ObjectPropertyInfo',
1362 'data': { 'name': 'str', 'type': 'str' } }
1367 # This command will list any properties of a object given a path in the object
1370 # @path: the path within the object model. See @qom-get for a description of
1373 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1378 # Notes: This command is experimental. It's syntax may change in future
1381 { 'command': 'qom-list',
1382 'data': { 'path': 'str' },
1383 'returns': [ 'ObjectPropertyInfo' ] }
1388 # This command will get a property from a object model path and return the
1391 # @path: The path within the object model. There are two forms of supported
1392 # paths--absolute and partial paths.
1394 # Absolute paths are derived from the root object and can follow child<>
1395 # or link<> properties. Since they can follow link<> properties, they
1396 # can be arbitrarily long. Absolute paths look like absolute filenames
1397 # and are prefixed with a leading slash.
1399 # Partial paths look like relative filenames. They do not begin
1400 # with a prefix. The matching rules for partial paths are subtle but
1401 # designed to make specifying objects easy. At each level of the
1402 # composition tree, the partial path is matched as an absolute path.
1403 # The first match is not returned. At least two matches are searched
1404 # for. A successful result is only returned if only one match is
1405 # found. If more than one match is found, a flag is return to
1406 # indicate that the match was ambiguous.
1408 # @property: The property name to read
1410 # Returns: The property value. The type depends on the property type. legacy<>
1411 # properties are returned as #str. child<> and link<> properties are
1412 # returns as #str pathnames. All integer property types (u8, u16, etc)
1413 # are returned as #int.
1417 # Notes: This command is experimental and may change syntax in future releases.
1419 { 'command': 'qom-get',
1420 'data': { 'path': 'str', 'property': 'str' },
1421 'returns': 'visitor',
1427 # This command will set a property from a object model path.
1429 # @path: see @qom-get for a description of this parameter
1431 # @property: the property name to set
1433 # @value: a value who's type is appropriate for the property type. See @qom-get
1434 # for a description of type mapping.
1438 # Notes: This command is experimental and may change syntax in future releases.
1440 { 'command': 'qom-set',
1441 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1447 # Sets the password of a remote display session.
1449 # @protocol: `vnc' to modify the VNC server password
1450 # `spice' to modify the Spice server password
1452 # @password: the new password
1454 # @connected: #optional how to handle existing clients when changing the
1455 # password. If nothing is specified, defaults to `keep'
1456 # `fail' to fail the command if clients are connected
1457 # `disconnect' to disconnect existing clients
1458 # `keep' to maintain existing clients
1460 # Returns: Nothing on success
1461 # If Spice is not enabled, DeviceNotFound
1462 # If @protocol does not support connected, InvalidParameter
1463 # If @protocol is invalid, InvalidParameter
1464 # If any other error occurs, SetPasswdFailed
1466 # Notes: If VNC is not enabled, SetPasswdFailed is returned.
1470 { 'command': 'set_password',
1471 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
1476 # Expire the password of a remote display server.
1478 # @protocol: the name of the remote display protocol `vnc' or `spice'
1480 # @time: when to expire the password.
1481 # `now' to expire the password immediately
1482 # `never' to cancel password expiration
1483 # `+INT' where INT is the number of seconds from now (integer)
1484 # `INT' where INT is the absolute time in seconds
1486 # Returns: Nothing on success
1487 # If @protocol is `spice' and Spice is not active, DeviceNotFound
1488 # If an error occurs setting password expiration, SetPasswdFailed
1489 # If @protocol is not `spice' or 'vnc', InvalidParameter
1493 # Notes: Time is relative to the server and currently there is no way to
1494 # coordinate server time with client time. It is not recommended to
1495 # use the absolute time version of the @time parameter unless you're
1496 # sure you are on the same machine as the QEMU instance.
1498 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
1503 # Ejects a device from a removable drive.
1505 # @device: The name of the device
1507 # @force: @optional If true, eject regardless of whether the drive is locked.
1508 # If not specified, the default value is false.
1510 # Returns: Nothing on success
1511 # If @device is not a valid block device, DeviceNotFound
1512 # If @device is not removable and @force is false, DeviceNotRemovable
1513 # If @force is false and @device is locked, DeviceLocked
1515 # Notes: Ejecting a device will no media results in success
1519 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
1522 # @change-vnc-password:
1524 # Change the VNC server password.
1526 # @target: the new password to use with VNC authentication
1530 # Notes: An empty password in this command will set the password to the empty
1531 # string. Existing clients are unaffected by executing this command.
1533 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
1538 # This command is multiple commands multiplexed together.
1540 # @device: This is normally the name of a block device but it may also be 'vnc'.
1541 # when it's 'vnc', then sub command depends on @target
1543 # @target: If @device is a block device, then this is the new filename.
1544 # If @device is 'vnc', then if the value 'password' selects the vnc
1545 # change password command. Otherwise, this specifies a new server URI
1546 # address to listen to for VNC connections.
1548 # @arg: If @device is a block device, then this is an optional format to open
1550 # If @device is 'vnc' and @target is 'password', this is the new VNC
1551 # password to set. If this argument is an empty string, then no future
1552 # logins will be allowed.
1554 # Returns: Nothing on success.
1555 # If @device is not a valid block device, DeviceNotFound
1556 # If @format is not a valid block format, InvalidBlockFormat
1557 # If the new block device is encrypted, DeviceEncrypted. Note that
1558 # if this error is returned, the device has been opened successfully
1559 # and an additional call to @block_passwd is required to set the
1560 # device's password. The behavior of reads and writes to the block
1561 # device between when these calls are executed is undefined.
1563 # Notes: It is strongly recommended that this interface is not used especially
1564 # for changing block devices.
1568 { 'command': 'change',
1569 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
1572 # @block_set_io_throttle:
1574 # Change I/O throttle limits for a block drive.
1576 # @device: The name of the device
1578 # @bps: total throughput limit in bytes per second
1580 # @bps_rd: read throughput limit in bytes per second
1582 # @bps_wr: write throughput limit in bytes per second
1584 # @iops: total I/O operations per second
1586 # @ops_rd: read I/O operations per second
1588 # @iops_wr: write I/O operations per second
1590 # Returns: Nothing on success
1591 # If @device is not a valid block device, DeviceNotFound
1592 # If the argument combination is invalid, InvalidParameterCombination
1596 { 'command': 'block_set_io_throttle',
1597 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
1598 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
1603 # Copy data from a backing file into a block device.
1605 # The block streaming operation is performed in the background until the entire
1606 # backing file has been copied. This command returns immediately once streaming
1607 # has started. The status of ongoing block streaming operations can be checked
1608 # with query-block-jobs. The operation can be stopped before it has completed
1609 # using the block-job-cancel command.
1611 # If a base file is specified then sectors are not copied from that base file and
1612 # its backing chain. When streaming completes the image file will have the base
1613 # file as its backing file. This can be used to stream a subset of the backing
1614 # file chain instead of flattening the entire image.
1616 # On successful completion the image file is updated to drop the backing file
1617 # and the BLOCK_JOB_COMPLETED event is emitted.
1619 # @device: the device name
1621 # @base: #optional the common backing file name
1623 # @speed: #optional the maximum speed, in bytes per second
1625 # Returns: Nothing on success
1626 # If streaming is already active on this device, DeviceInUse
1627 # If @device does not exist, DeviceNotFound
1628 # If image streaming is not supported by this device, NotSupported
1629 # If @base does not exist, BaseNotFound
1630 # If @speed is invalid, InvalidParameter
1634 { 'command': 'block-stream', 'data': { 'device': 'str', '*base': 'str',
1638 # @block-job-set-speed:
1640 # Set maximum speed for a background block operation.
1642 # This command can only be issued when there is an active block job.
1644 # Throttling can be disabled by setting the speed to 0.
1646 # @device: the device name
1648 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1651 # Returns: Nothing on success
1652 # If the job type does not support throttling, NotSupported
1653 # If the speed value is invalid, InvalidParameter
1654 # If streaming is not active on this device, DeviceNotActive
1658 { 'command': 'block-job-set-speed',
1659 'data': { 'device': 'str', 'speed': 'int' } }
1662 # @block-job-cancel:
1664 # Stop an active block streaming operation.
1666 # This command returns immediately after marking the active block streaming
1667 # operation for cancellation. It is an error to call this command if no
1668 # operation is in progress.
1670 # The operation will cancel as soon as possible and then emit the
1671 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
1672 # enumerated using query-block-jobs.
1674 # The image file retains its backing file unless the streaming operation happens
1675 # to complete just as it is being cancelled.
1677 # A new block streaming operation can be started at a later time to finish
1678 # copying all data from the backing file.
1680 # @device: the device name
1682 # Returns: Nothing on success
1683 # If streaming is not active on this device, DeviceNotActive
1684 # If cancellation already in progress, DeviceInUse
1688 { 'command': 'block-job-cancel', 'data': { 'device': 'str' } }
1693 # This structure describes a search result from @qom-list-types
1695 # @name: the type name found in the search
1699 # Notes: This command is experimental and may change syntax in future releases.
1701 { 'type': 'ObjectTypeInfo',
1702 'data': { 'name': 'str' } }
1707 # This command will return a list of types given search parameters
1709 # @implements: if specified, only return types that implement this type name
1711 # @abstract: if true, include abstract types in the results
1713 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1717 # Notes: This command is experimental and may change syntax in future releases.
1719 { 'command': 'qom-list-types',
1720 'data': { '*implements': 'str', '*abstract': 'bool' },
1721 'returns': [ 'ObjectTypeInfo' ] }
1726 # Migrates the current running guest to another Virtual Machine.
1728 # @uri: the Uniform Resource Identifier of the destination VM
1730 # @blk: #optional do block migration (full disk copy)
1732 # @inc: #optional incremental disk copy migration
1734 # @detach: this argument exists only for compatibility reasons and
1735 # is ignored by QEMU
1737 # Returns: nothing on success
1741 { 'command': 'migrate',
1742 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
1744 # @xen-save-devices-state:
1746 # Save the state of all devices to file. The RAM and the block devices
1747 # of the VM are not saved by this command.
1749 # @filename: the file to save the state of the devices to as binary
1750 # data. See xen-save-devices-state.txt for a description of the binary
1753 # Returns: Nothing on success
1754 # If @filename cannot be opened, OpenFileFailed
1755 # If an I/O error occurs while writing the file, IOError
1759 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
1764 # Remove a device from a guest
1766 # @id: the name of the device
1768 # Returns: Nothing on success
1769 # If @id is not a valid device, DeviceNotFound
1770 # If the device does not support unplug, BusNoHotplug
1772 # Notes: When this command completes, the device may not be removed from the
1773 # guest. Hot removal is an operation that requires guest cooperation.
1774 # This command merely requests that the guest begin the hot removal
1779 { 'command': 'device_del', 'data': {'id': 'str'} }
1782 # @dump-guest-memory
1784 # Dump guest's memory to vmcore. It is a synchronous operation that can take
1785 # very long depending on the amount of guest memory. This command is only
1786 # supported only on i386 and x86_64
1788 # @paging: if true, do paging to get guest's memory mapping. The @paging's
1789 # default value of @paging is false, If you want to use gdb to process the
1790 # core, please set @paging to true. The reason why the @paging's value is
1792 # 1. guest machine in a catastrophic state can have corrupted memory,
1793 # which we cannot trust.
1794 # 2. The guest machine can be in read-mode even if paging is enabled.
1795 # For example: the guest machine uses ACPI to sleep, and ACPI sleep
1796 # state goes in real-mode
1797 # @protocol: the filename or file descriptor of the vmcore. The supported
1798 # protocol can be file or fd:
1799 # 1. file: the protocol starts with "file:", and the following string is
1801 # 2. fd: the protocol starts with "fd:", and the following string is the
1803 # @begin: #optional if specified, the starting physical address.
1804 # @length: #optional if specified, the memory size, in bytes. If you don't
1805 # want to dump all guest's memory, please specify the start @begin and
1808 # Returns: nothing on success
1809 # If @begin contains an invalid address, InvalidParameter
1810 # If only one of @begin and @length is specified, MissingParameter
1811 # If @protocol stats with "fd:", and the fd cannot be found, FdNotFound
1812 # If @protocol starts with "file:", and the file cannot be
1813 # opened, OpenFileFailed
1814 # If @protocol does not start with "fd:" or "file:", InvalidParameter
1815 # If an I/O error occurs while writing the file, IOError
1816 # If the target does not support this command, Unsupported
1820 { 'command': 'dump-guest-memory',
1821 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
1822 '*length': 'int' } }
1826 # Add a network backend.
1828 # @type: the type of network backend. Current valid values are 'user', 'tap',
1829 # 'vde', 'socket', 'dump' and 'bridge'
1831 # @id: the name of the new network backend
1833 # @props: #optional a list of properties to be passed to the backend in
1834 # the format 'name=value', like 'ifname=tap0,script=no'
1836 # Notes: The semantics of @props is not well defined. Future commands will be
1837 # introduced that provide stronger typing for backend creation.
1841 # Returns: Nothing on success
1842 # If @type is not a valid network backend, DeviceNotFound
1843 # If @id is not a valid identifier, InvalidParameterValue
1844 # if @id already exists, DuplicateId
1845 # If @props contains an invalid parameter for this backend,
1848 { 'command': 'netdev_add',
1849 'data': {'type': 'str', 'id': 'str', '*props': '**'},
1855 # Remove a network backend.
1857 # @id: the name of the network backend to remove
1859 # Returns: Nothing on success
1860 # If @id is not a valid network backend, DeviceNotFound
1864 { 'command': 'netdev_del', 'data': {'id': 'str'} }