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
27 { 'enum': 'ErrorClass',
28 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
29 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
34 # Allow client connections for VNC, Spice and socket based
35 # character devices to be passed in to QEMU via SCM_RIGHTS.
37 # @protocol: protocol name. Valid names are "vnc", "spice" or the
38 # name of a character device (eg. from -chardev id=XXXX)
40 # @fdname: file descriptor name previously passed via 'getfd' command
42 # @skipauth: #optional whether to skip authentication. Only applies
43 # to "vnc" and "spice" protocols
45 # @tls: #optional whether to perform TLS. Only applies to the "spice"
48 # Returns: nothing on success.
52 { 'command': 'add_client',
53 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
59 # Guest name information.
61 # @name: #optional The name of the guest
65 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
70 # Return the name information of a guest.
72 # Returns: @NameInfo of the guest
76 { 'command': 'query-name', 'returns': 'NameInfo' }
81 # A description of QEMU's version.
83 # @qemu.major: The major version of QEMU
85 # @qemu.minor: The minor version of QEMU
87 # @qemu.micro: The micro version of QEMU. By current convention, a micro
88 # version of 50 signifies a development branch. A micro version
89 # greater than or equal to 90 signifies a release candidate for
90 # the next minor version. A micro version of less than 50
91 # signifies a stable release.
93 # @package: QEMU will always set this field to an empty string. Downstream
94 # versions of QEMU should set this to a non-empty string. The
95 # exact format depends on the downstream however it highly
96 # recommended that a unique name is used.
100 { 'type': 'VersionInfo',
101 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
107 # Returns the current version of QEMU.
109 # Returns: A @VersionInfo object describing the current version of QEMU.
113 { 'command': 'query-version', 'returns': 'VersionInfo' }
118 # Information about support for KVM acceleration
120 # @enabled: true if KVM acceleration is active
122 # @present: true if KVM acceleration is built into this executable
126 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
131 # Returns information about KVM acceleration
137 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
142 # An enumeration of VM run states.
144 # @debug: QEMU is running on a debugger
146 # @finish-migrate: guest is paused to finish the migration process
148 # @inmigrate: guest is paused waiting for an incoming migration. Note
149 # that this state does not tell whether the machine will start at the
150 # end of the migration. This depends on the command-line -S option and
151 # any invocation of 'stop' or 'cont' that has happened since QEMU was
154 # @internal-error: An internal error that prevents further guest execution
157 # @io-error: the last IOP has failed and the device is configured to pause
160 # @paused: guest has been paused via the 'stop' command
162 # @postmigrate: guest is paused following a successful 'migrate'
164 # @prelaunch: QEMU was started with -S and guest has not started
166 # @restore-vm: guest is paused to restore VM state
168 # @running: guest is actively running
170 # @save-vm: guest is paused to save the VM state
172 # @shutdown: guest is shut down (and -no-shutdown is in use)
174 # @suspended: guest is suspended (ACPI S3)
176 # @watchdog: the watchdog action is configured to pause and has been triggered
178 # @guest-panicked: guest has been panicked as a result of guest OS panic
180 { 'enum': 'RunState',
181 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
182 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
183 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
189 # @id: unique snapshot id
191 # @name: user chosen name
193 # @vm-state-size: size of the VM state
195 # @date-sec: UTC date of the snapshot in seconds
197 # @date-nsec: fractional part in nano seconds to be used with date-sec
199 # @vm-clock-sec: VM clock relative to boot in seconds
201 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
207 { 'type': 'SnapshotInfo',
208 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
209 'date-sec': 'int', 'date-nsec': 'int',
210 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
213 # @ImageInfoSpecificQCow2:
215 # @compat: compatibility level
217 # @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
221 { 'type': 'ImageInfoSpecificQCow2',
224 '*lazy-refcounts': 'bool'
228 # @ImageInfoSpecificVmdk:
230 # @create-type: The create type of VMDK image
232 # @cid: Content id of image
234 # @parent-cid: Parent VMDK image's cid
236 # @extents: List of extent files
240 { 'type': 'ImageInfoSpecificVmdk',
242 'create-type': 'str',
245 'extents': ['ImageInfo']
249 # @ImageInfoSpecific:
251 # A discriminated record of image format specific information structures.
256 { 'union': 'ImageInfoSpecific',
258 'qcow2': 'ImageInfoSpecificQCow2',
259 'vmdk': 'ImageInfoSpecificVmdk'
265 # Information about a QEMU image file
267 # @filename: name of the image file
269 # @format: format of the image file
271 # @virtual-size: maximum capacity in bytes of the image
273 # @actual-size: #optional actual size on disk in bytes of the image
275 # @dirty-flag: #optional true if image is not cleanly closed
277 # @cluster-size: #optional size of a cluster in bytes
279 # @encrypted: #optional true if the image is encrypted
281 # @compressed: #optional true if the image is compressed (Since 1.7)
283 # @backing-filename: #optional name of the backing file
285 # @full-backing-filename: #optional full path of the backing file
287 # @backing-filename-format: #optional the format of the backing file
289 # @snapshots: #optional list of VM snapshots
291 # @backing-image: #optional info of the backing image (since 1.6)
293 # @format-specific: #optional structure supplying additional format-specific
294 # information (since 1.7)
300 { 'type': 'ImageInfo',
301 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
302 '*actual-size': 'int', 'virtual-size': 'int',
303 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
304 '*backing-filename': 'str', '*full-backing-filename': 'str',
305 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
306 '*backing-image': 'ImageInfo',
307 '*format-specific': 'ImageInfoSpecific' } }
312 # Information about a QEMU image file check
314 # @filename: name of the image file checked
316 # @format: format of the image file checked
318 # @check-errors: number of unexpected errors occurred during check
320 # @image-end-offset: #optional offset (in bytes) where the image ends, this
321 # field is present if the driver for the image format
324 # @corruptions: #optional number of corruptions found during the check if any
326 # @leaks: #optional number of leaks found during the check if any
328 # @corruptions-fixed: #optional number of corruptions fixed during the check
331 # @leaks-fixed: #optional number of leaks fixed during the check if any
333 # @total-clusters: #optional total number of clusters, this field is present
334 # if the driver for the image format supports it
336 # @allocated-clusters: #optional total number of allocated clusters, this
337 # field is present if the driver for the image format
340 # @fragmented-clusters: #optional total number of fragmented clusters, this
341 # field is present if the driver for the image format
344 # @compressed-clusters: #optional total number of compressed clusters, this
345 # field is present if the driver for the image format
352 { 'type': 'ImageCheck',
353 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
354 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
355 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
356 '*total-clusters': 'int', '*allocated-clusters': 'int',
357 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
362 # Information about VCPU run state
364 # @running: true if all VCPUs are runnable, false if not runnable
366 # @singlestep: true if VCPUs are in single-step mode
368 # @status: the virtual machine @RunState
372 # Notes: @singlestep is enabled through the GDB stub
374 { 'type': 'StatusInfo',
375 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
380 # Query the run status of all VCPUs
382 # Returns: @StatusInfo reflecting all VCPUs
386 { 'command': 'query-status', 'returns': 'StatusInfo' }
391 # Guest UUID information.
393 # @UUID: the UUID of the guest
397 # Notes: If no UUID was specified for the guest, a null UUID is returned.
399 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
404 # Query the guest UUID information.
406 # Returns: The @UuidInfo for the guest
410 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
415 # Information about a character device.
417 # @label: the label of the character device
419 # @filename: the filename of the character device
421 # Notes: @filename is encoded using the QEMU command line character device
422 # encoding. See the QEMU man page for details.
426 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
431 # Returns information about current character devices.
433 # Returns: a list of @ChardevInfo
437 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
442 # An enumeration of data format.
444 # @utf8: Data is a UTF-8 string (RFC 3629)
446 # @base64: Data is Base64 encoded binary (RFC 3548)
450 { 'enum': 'DataFormat',
451 'data': [ 'utf8', 'base64' ] }
456 # Write to a ring buffer character device.
458 # @device: the ring buffer character device name
460 # @data: data to write
462 # @format: #optional data encoding (default 'utf8').
463 # - base64: data must be base64 encoded text. Its binary
464 # decoding gets written.
465 # Bug: invalid base64 is currently not rejected.
466 # Whitespace *is* invalid.
467 # - utf8: data's UTF-8 encoding is written
468 # - data itself is always Unicode regardless of format, like
471 # Returns: Nothing on success
475 { 'command': 'ringbuf-write',
476 'data': {'device': 'str', 'data': 'str',
477 '*format': 'DataFormat'} }
482 # Read from a ring buffer character device.
484 # @device: the ring buffer character device name
486 # @size: how many bytes to read at most
488 # @format: #optional data encoding (default 'utf8').
489 # - base64: the data read is returned in base64 encoding.
490 # - utf8: the data read is interpreted as UTF-8.
491 # Bug: can screw up when the buffer contains invalid UTF-8
492 # sequences, NUL characters, after the ring buffer lost
493 # data, and when reading stops because the size limit is
495 # - The return value is always Unicode regardless of format,
496 # like any other string.
498 # Returns: data read from the device
502 { 'command': 'ringbuf-read',
503 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
509 # Information about a QMP command
511 # @name: The command name
515 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
520 # Return a list of supported QMP commands by this server
522 # Returns: A list of @CommandInfo for all supported commands
526 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
531 # Information about a QMP event
533 # @name: The event name
537 { 'type': 'EventInfo', 'data': {'name': 'str'} }
542 # Return a list of supported QMP events by this server
544 # Returns: A list of @EventInfo for all supported events
548 { 'command': 'query-events', 'returns': ['EventInfo'] }
553 # Detailed migration status.
555 # @transferred: amount of bytes already transferred to the target VM
557 # @remaining: amount of bytes remaining to be transferred to the target VM
559 # @total: total amount of bytes involved in the migration process
561 # @duplicate: number of duplicate (zero) pages (since 1.2)
563 # @skipped: number of skipped zero pages (since 1.5)
565 # @normal : number of normal pages (since 1.2)
567 # @normal-bytes: number of normal bytes sent (since 1.2)
569 # @dirty-pages-rate: number of pages dirtied by second by the
572 # @mbps: throughput in megabits/sec. (since 1.6)
576 { 'type': 'MigrationStats',
577 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
578 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
579 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
580 'mbps' : 'number' } }
585 # Detailed XBZRLE migration cache statistics
587 # @cache-size: XBZRLE cache size
589 # @bytes: amount of bytes already transferred to the target VM
591 # @pages: amount of pages transferred to the target VM
593 # @cache-miss: number of cache miss
595 # @overflow: number of overflows
599 { 'type': 'XBZRLECacheStats',
600 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
601 'cache-miss': 'int', 'overflow': 'int' } }
606 # Information about current migration process.
608 # @status: #optional string describing the current migration status.
609 # As of 0.14.0 this can be 'active', 'completed', 'failed' or
610 # 'cancelled'. If this field is not returned, no migration process
613 # @ram: #optional @MigrationStats containing detailed migration
614 # status, only returned if status is 'active' or
615 # 'completed'. 'comppleted' (since 1.2)
617 # @disk: #optional @MigrationStats containing detailed disk migration
618 # status, only returned if status is 'active' and it is a block
621 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
622 # migration statistics, only returned if XBZRLE feature is on and
623 # status is 'active' or 'completed' (since 1.2)
625 # @total-time: #optional total amount of milliseconds since migration started.
626 # If migration has ended, it returns the total migration
629 # @downtime: #optional only present when migration finishes correctly
630 # total downtime in milliseconds for the guest.
633 # @expected-downtime: #optional only present while migration is active
634 # expected downtime in milliseconds for the guest in last walk
635 # of the dirty bitmap. (since 1.3)
637 # @setup-time: #optional amount of setup time in milliseconds _before_ the
638 # iterations begin but _after_ the QMP command is issued. This is designed
639 # to provide an accounting of any activities (such as RDMA pinning) which
640 # may be expensive, but do not actually occur during the iterative
641 # migration rounds themselves. (since 1.6)
645 { 'type': 'MigrationInfo',
646 'data': {'*status': 'str', '*ram': 'MigrationStats',
647 '*disk': 'MigrationStats',
648 '*xbzrle-cache': 'XBZRLECacheStats',
649 '*total-time': 'int',
650 '*expected-downtime': 'int',
652 '*setup-time': 'int'} }
657 # Returns information about current migration process.
659 # Returns: @MigrationInfo
663 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
666 # @MigrationCapability
668 # Migration capabilities enumeration
670 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
671 # This feature allows us to minimize migration traffic for certain work
672 # loads, by sending compressed difference of the pages
674 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
675 # mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
676 # Disabled by default. Experimental: may (or may not) be renamed after
677 # further testing is complete. (since 1.6)
679 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
680 # essentially saves 1MB of zeroes per block on the wire. Enabling requires
681 # source and target VM to support this feature. To enable it is sufficient
682 # to enable the capability on the source VM. The feature is disabled by
683 # default. (since 1.6)
685 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
686 # to speed up convergence of RAM migration. (since 1.6)
690 { 'enum': 'MigrationCapability',
691 'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
694 # @MigrationCapabilityStatus
696 # Migration capability information
698 # @capability: capability enum
700 # @state: capability state bool
704 { 'type': 'MigrationCapabilityStatus',
705 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
708 # @migrate-set-capabilities
710 # Enable/Disable the following migration capabilities (like xbzrle)
712 # @capabilities: json array of capability modifications to make
716 { 'command': 'migrate-set-capabilities',
717 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
720 # @query-migrate-capabilities
722 # Returns information about the current migration capabilities status
724 # Returns: @MigrationCapabilitiesStatus
728 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
733 # Information about a mouse device.
735 # @name: the name of the mouse device
737 # @index: the index of the mouse device
739 # @current: true if this device is currently receiving mouse events
741 # @absolute: true if this device supports absolute coordinates as input
745 { 'type': 'MouseInfo',
746 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
747 'absolute': 'bool'} }
752 # Returns information about each active mouse device
754 # Returns: a list of @MouseInfo for each device
758 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
763 # Information about a virtual CPU
765 # @CPU: the index of the virtual CPU
767 # @current: this only exists for backwards compatible and should be ignored
769 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
770 # to a processor specific low power mode.
772 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
774 # If the target is Sparc, this is the PC component of the
775 # instruction pointer.
777 # @nip: #optional If the target is PPC, the instruction pointer
779 # @npc: #optional If the target is Sparc, the NPC component of the instruction
782 # @PC: #optional If the target is MIPS, the instruction pointer
784 # @thread_id: ID of the underlying host thread
788 # Notes: @halted is a transient state that changes frequently. By the time the
789 # data is sent to the client, the guest may no longer be halted.
792 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
793 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
798 # Returns a list of information about each virtual CPU.
800 # Returns: a list of @CpuInfo for each virtual CPU
804 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
809 # Information about the backing device for a block device.
811 # @file: the filename of the backing device
813 # @node-name: #optional the name of the block driver node (Since 2.0)
815 # @ro: true if the backing device was open read-only
817 # @drv: the name of the block format used to open the backing device. As of
818 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
819 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
820 # 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
821 # 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
823 # @backing_file: #optional the name of the backing file (for copy-on-write)
825 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
827 # @encrypted: true if the backing device is encrypted
829 # @encryption_key_missing: true if the backing device is encrypted but an
830 # valid encryption key is missing
832 # @bps: total throughput limit in bytes per second is specified
834 # @bps_rd: read throughput limit in bytes per second is specified
836 # @bps_wr: write throughput limit in bytes per second is specified
838 # @iops: total I/O operations per second is specified
840 # @iops_rd: read I/O operations per second is specified
842 # @iops_wr: write I/O operations per second is specified
844 # @image: the info of image used (since: 1.6)
846 # @bps_max: #optional total max in bytes (Since 1.7)
848 # @bps_rd_max: #optional read max in bytes (Since 1.7)
850 # @bps_wr_max: #optional write max in bytes (Since 1.7)
852 # @iops_max: #optional total I/O operations max (Since 1.7)
854 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
856 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
858 # @iops_size: #optional an I/O size in bytes (Since 1.7)
863 { 'type': 'BlockDeviceInfo',
864 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
865 '*backing_file': 'str', 'backing_file_depth': 'int',
866 'encrypted': 'bool', 'encryption_key_missing': 'bool',
867 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
868 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
869 'image': 'ImageInfo',
870 '*bps_max': 'int', '*bps_rd_max': 'int',
871 '*bps_wr_max': 'int', '*iops_max': 'int',
872 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
873 '*iops_size': 'int' } }
876 # @BlockDeviceIoStatus:
878 # An enumeration of block device I/O status.
880 # @ok: The last I/O operation has succeeded
882 # @failed: The last I/O operation has failed
884 # @nospace: The last I/O operation has failed due to a no-space condition
888 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
891 # @BlockDeviceMapEntry:
893 # Entry in the metadata map of the device (returned by "qemu-img map")
895 # @start: Offset in the image of the first byte described by this entry
898 # @length: Length of the range described by this entry (in bytes)
900 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
901 # before reaching one for which the range is allocated. The value is
902 # in the range 0 to the depth of the image chain - 1.
904 # @zero: the sectors in this range read as zeros
906 # @data: reading the image will actually read data from a file (in particular,
907 # if @offset is present this means that the sectors are not simply
908 # preallocated, but contain actual data in raw format)
910 # @offset: if present, the image file stores the data for this range in
911 # raw format at the given offset.
915 { 'type': 'BlockDeviceMapEntry',
916 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
917 'data': 'bool', '*offset': 'int' } }
922 # Block dirty bitmap information.
924 # @count: number of dirty bytes according to the dirty bitmap
926 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
930 { 'type': 'BlockDirtyInfo',
931 'data': {'count': 'int', 'granularity': 'int'} }
936 # Block device information. This structure describes a virtual device and
937 # the backing device associated with it.
939 # @device: The device name associated with the virtual device.
941 # @type: This field is returned only for compatibility reasons, it should
942 # not be used (always returns 'unknown')
944 # @removable: True if the device supports removable media.
946 # @locked: True if the guest has locked this device from having its media
949 # @tray_open: #optional True if the device has a tray and it is open
950 # (only present if removable is true)
952 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
953 # driver has one or more dirty bitmaps) (Since 2.0)
955 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
956 # supports it and the VM is configured to stop on errors
958 # @inserted: #optional @BlockDeviceInfo describing the device if media is
963 { 'type': 'BlockInfo',
964 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
965 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
966 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
967 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
972 # Get a list of BlockInfo for all virtual block devices.
974 # Returns: a list of @BlockInfo describing each virtual block device
978 { 'command': 'query-block', 'returns': ['BlockInfo'] }
983 # Statistics of a virtual block device or a block backing device.
985 # @rd_bytes: The number of bytes read by the device.
987 # @wr_bytes: The number of bytes written by the device.
989 # @rd_operations: The number of read operations performed by the device.
991 # @wr_operations: The number of write operations performed by the device.
993 # @flush_operations: The number of cache flush operations performed by the
994 # device (since 0.15.0)
996 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
999 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1001 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1003 # @wr_highest_offset: The offset after the greatest byte written to the
1004 # device. The intended use of this information is for
1005 # growable sparse files (like qcow2) that are used on top
1006 # of a physical device.
1010 { 'type': 'BlockDeviceStats',
1011 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1012 'wr_operations': 'int', 'flush_operations': 'int',
1013 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1014 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1019 # Statistics of a virtual block device or a block backing device.
1021 # @device: #optional If the stats are for a virtual block device, the name
1022 # corresponding to the virtual block device.
1024 # @stats: A @BlockDeviceStats for the device.
1026 # @parent: #optional This describes the file block device if it has one.
1028 # @backing: #optional This describes the backing block device if it has one.
1033 { 'type': 'BlockStats',
1034 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1035 '*parent': 'BlockStats',
1036 '*backing': 'BlockStats'} }
1039 # @query-blockstats:
1041 # Query the @BlockStats for all virtual block devices.
1043 # Returns: A list of @BlockStats for each virtual block devices.
1047 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1052 # Information about a connected VNC client.
1054 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
1057 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1058 # 'ipv4' if the client is connected via IPv4 and TCP
1059 # 'unix' if the client is connected via a unix domain socket
1060 # 'unknown' otherwise
1062 # @service: The service name of the client's port. This may depends on the
1063 # host system's service database so symbolic names should not be
1066 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1067 # Name of the client.
1069 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1070 # used for authentication.
1074 { 'type': 'VncClientInfo',
1075 'data': {'host': 'str', 'family': 'str', 'service': 'str',
1076 '*x509_dname': 'str', '*sasl_username': 'str'} }
1081 # Information about the VNC session.
1083 # @enabled: true if the VNC server is enabled, false otherwise
1085 # @host: #optional The hostname the VNC server is bound to. This depends on
1086 # the name resolution on the host and may be an IP address.
1088 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1089 # 'ipv4' if the host is listening for IPv4 connections
1090 # 'unix' if the host is listening on a unix domain socket
1091 # 'unknown' otherwise
1093 # @service: #optional The service name of the server's port. This may depends
1094 # on the host system's service database so symbolic names should not
1097 # @auth: #optional the current authentication type used by the server
1098 # 'none' if no authentication is being used
1099 # 'vnc' if VNC authentication is being used
1100 # 'vencrypt+plain' if VEncrypt is used with plain text authentication
1101 # 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1102 # 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1103 # 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1104 # 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1105 # 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1106 # 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1107 # 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1108 # 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1110 # @clients: a list of @VncClientInfo of all currently connected clients
1114 { 'type': 'VncInfo',
1115 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1116 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1121 # Returns information about the current VNC server
1127 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1132 # Information about a SPICE client channel.
1134 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
1137 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1138 # 'ipv4' if the client is connected via IPv4 and TCP
1139 # 'unix' if the client is connected via a unix domain socket
1140 # 'unknown' otherwise
1142 # @port: The client's port number.
1144 # @connection-id: SPICE connection id number. All channels with the same id
1145 # belong to the same SPICE session.
1147 # @connection-type: SPICE channel type number. "1" is the main control
1148 # channel, filter for this one if you want to track spice
1151 # @channel-id: SPICE channel ID number. Usually "0", might be different when
1152 # multiple channels of the same type exist, such as multiple
1153 # display channels in a multihead setup
1155 # @tls: true if the channel is encrypted, false otherwise.
1159 { 'type': 'SpiceChannel',
1160 'data': {'host': 'str', 'family': 'str', 'port': 'str',
1161 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1165 # @SpiceQueryMouseMode
1167 # An enumeration of Spice mouse states.
1169 # @client: Mouse cursor position is determined by the client.
1171 # @server: Mouse cursor position is determined by the server.
1173 # @unknown: No information is available about mouse mode used by
1176 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1180 { 'enum': 'SpiceQueryMouseMode',
1181 'data': [ 'client', 'server', 'unknown' ] }
1186 # Information about the SPICE session.
1188 # @enabled: true if the SPICE server is enabled, false otherwise
1190 # @migrated: true if the last guest migration completed and spice
1191 # migration had completed as well. false otherwise.
1193 # @host: #optional The hostname the SPICE server is bound to. This depends on
1194 # the name resolution on the host and may be an IP address.
1196 # @port: #optional The SPICE server's port number.
1198 # @compiled-version: #optional SPICE server version.
1200 # @tls-port: #optional The SPICE server's TLS port number.
1202 # @auth: #optional the current authentication type used by the server
1203 # 'none' if no authentication is being used
1204 # 'spice' uses SASL or direct TLS authentication, depending on command
1207 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1208 # be determined by the client or the server, or unknown if spice
1209 # server doesn't provide this information.
1213 # @channels: a list of @SpiceChannel for each active spice channel
1217 { 'type': 'SpiceInfo',
1218 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1219 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1220 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1225 # Returns information about the current SPICE server
1227 # Returns: @SpiceInfo
1231 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1236 # Information about the guest balloon device.
1238 # @actual: the number of bytes the balloon currently contains
1243 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1248 # Return information about the balloon device.
1250 # Returns: @BalloonInfo on success
1251 # If the balloon driver is enabled but not functional because the KVM
1252 # kernel module cannot support it, KvmMissingCap
1253 # If no balloon device is present, DeviceNotActive
1257 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1262 # A PCI device memory region
1264 # @base: the starting address (guest physical)
1266 # @limit: the ending address (guest physical)
1270 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1275 # Information about a PCI device I/O region.
1277 # @bar: the index of the Base Address Register for this region
1279 # @type: 'io' if the region is a PIO region
1280 # 'memory' if the region is a MMIO region
1282 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1284 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1288 { 'type': 'PciMemoryRegion',
1289 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1290 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1295 # Information about a PCI Bridge device
1297 # @bus.number: primary bus interface number. This should be the number of the
1298 # bus the device resides on.
1300 # @bus.secondary: secondary bus interface number. This is the number of the
1301 # main bus for the bridge
1303 # @bus.subordinate: This is the highest number bus that resides below the
1306 # @bus.io_range: The PIO range for all devices on this bridge
1308 # @bus.memory_range: The MMIO range for all devices on this bridge
1310 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1313 # @devices: a list of @PciDeviceInfo for each device on this bridge
1317 { 'type': 'PciBridgeInfo',
1318 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1319 'io_range': 'PciMemoryRange',
1320 'memory_range': 'PciMemoryRange',
1321 'prefetchable_range': 'PciMemoryRange' },
1322 '*devices': ['PciDeviceInfo']} }
1327 # Information about a PCI device
1329 # @bus: the bus number of the device
1331 # @slot: the slot the device is located in
1333 # @function: the function of the slot used by the device
1335 # @class_info.desc: #optional a string description of the device's class
1337 # @class_info.class: the class code of the device
1339 # @id.device: the PCI device id
1341 # @id.vendor: the PCI vendor id
1343 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1345 # @qdev_id: the device name of the PCI device
1347 # @pci_bridge: if the device is a PCI bridge, the bridge information
1349 # @regions: a list of the PCI I/O regions associated with the device
1351 # Notes: the contents of @class_info.desc are not stable and should only be
1352 # treated as informational.
1356 { 'type': 'PciDeviceInfo',
1357 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1358 'class_info': {'*desc': 'str', 'class': 'int'},
1359 'id': {'device': 'int', 'vendor': 'int'},
1360 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1361 'regions': ['PciMemoryRegion']} }
1366 # Information about a PCI bus
1368 # @bus: the bus index
1370 # @devices: a list of devices on this bus
1374 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1379 # Return information about the PCI bus topology of the guest.
1381 # Returns: a list of @PciInfo for each PCI bus
1385 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1390 # An enumeration of possible behaviors for errors on I/O operations.
1391 # The exact meaning depends on whether the I/O was initiated by a guest
1394 # @report: for guest operations, report the error to the guest;
1395 # for jobs, cancel the job
1397 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1398 # or BLOCK_JOB_ERROR)
1400 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1402 # @stop: for guest operations, stop the virtual machine;
1403 # for jobs, pause the job
1407 { 'enum': 'BlockdevOnError',
1408 'data': ['report', 'ignore', 'enospc', 'stop'] }
1413 # An enumeration of possible behaviors for the initial synchronization
1414 # phase of storage mirroring.
1416 # @top: copies data in the topmost image to the destination
1418 # @full: copies data from all images to the destination
1420 # @none: only copy data written from now on
1424 { 'enum': 'MirrorSyncMode',
1425 'data': ['top', 'full', 'none'] }
1430 # Type of a block job.
1432 # @commit: block commit job type, see "block-commit"
1434 # @stream: block stream job type, see "block-stream"
1436 # @mirror: drive mirror job type, see "drive-mirror"
1438 # @backup: drive backup job type, see "drive-backup"
1442 { 'enum': 'BlockJobType',
1443 'data': ['commit', 'stream', 'mirror', 'backup'] }
1448 # Information about a long-running block device operation.
1450 # @type: the job type ('stream' for image streaming)
1452 # @device: the block device name
1454 # @len: the maximum progress value
1456 # @busy: false if the job is known to be in a quiescent state, with
1457 # no pending I/O. Since 1.3.
1459 # @paused: whether the job is paused or, if @busy is true, will
1460 # pause itself as soon as possible. Since 1.3.
1462 # @offset: the current progress value
1464 # @speed: the rate limit, bytes per second
1466 # @io-status: the status of the job (since 1.3)
1470 { 'type': 'BlockJobInfo',
1471 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1472 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1473 'io-status': 'BlockDeviceIoStatus'} }
1476 # @query-block-jobs:
1478 # Return information about long-running block device operations.
1480 # Returns: a list of @BlockJobInfo for each active block job
1484 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1489 # This command will cause the QEMU process to exit gracefully. While every
1490 # attempt is made to send the QMP response before terminating, this is not
1491 # guaranteed. When using this interface, a premature EOF would not be
1496 { 'command': 'quit' }
1501 # Stop all guest VCPU execution.
1505 # Notes: This function will succeed even if the guest is already in the stopped
1506 # state. In "inmigrate" state, it will ensure that the guest
1507 # remains paused once migration finishes, as if the -S option was
1508 # passed on the command line.
1510 { 'command': 'stop' }
1515 # Performs a hard reset of a guest.
1519 { 'command': 'system_reset' }
1522 # @system_powerdown:
1524 # Requests that a guest perform a powerdown operation.
1528 # Notes: A guest may or may not respond to this command. This command
1529 # returning does not indicate that a guest has accepted the request or
1530 # that it has shut down. Many guests will respond to this command by
1531 # prompting the user in some way.
1533 { 'command': 'system_powerdown' }
1538 # This command is a nop that is only provided for the purposes of compatibility.
1542 # Notes: Do not use this command.
1544 { 'command': 'cpu', 'data': {'index': 'int'} }
1549 # Adds CPU with specified ID
1551 # @id: ID of CPU to be created, valid values [0..max_cpus)
1553 # Returns: Nothing on success
1557 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1562 # Save a portion of guest memory to a file.
1564 # @val: the virtual address of the guest to start from
1566 # @size: the size of memory region to save
1568 # @filename: the file to save the memory to as binary data
1570 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1571 # virtual address (defaults to CPU 0)
1573 # Returns: Nothing on success
1577 # Notes: Errors were not reliably returned until 1.1
1579 { 'command': 'memsave',
1580 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1585 # Save a portion of guest physical memory to a file.
1587 # @val: the physical address of the guest to start from
1589 # @size: the size of memory region to save
1591 # @filename: the file to save the memory to as binary data
1593 # Returns: Nothing on success
1597 # Notes: Errors were not reliably returned until 1.1
1599 { 'command': 'pmemsave',
1600 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1605 # Resume guest VCPU execution.
1609 # Returns: If successful, nothing
1610 # If QEMU was started with an encrypted block device and a key has
1611 # not yet been set, DeviceEncrypted.
1613 # Notes: This command will succeed if the guest is currently running. It
1614 # will also succeed if the guest is in the "inmigrate" state; in
1615 # this case, the effect of the command is to make sure the guest
1616 # starts once migration finishes, removing the effect of the -S
1617 # command line option if it was passed.
1619 { 'command': 'cont' }
1624 # Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1630 { 'command': 'system_wakeup' }
1635 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1637 # Returns: If successful, nothing
1641 # Notes: Only x86 Virtual Machines support this command.
1643 { 'command': 'inject-nmi' }
1648 # Sets the link status of a virtual network adapter.
1650 # @name: the device name of the virtual network adapter
1652 # @up: true to set the link status to be up
1654 # Returns: Nothing on success
1655 # If @name is not a valid network device, DeviceNotFound
1659 # Notes: Not all network adapters support setting link status. This command
1660 # will succeed even if the network adapter does not support link status
1663 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1668 # This command sets the password of a block device that has not been open
1669 # with a password and requires one.
1671 # The two cases where this can happen are a block device is created through
1672 # QEMU's initial command line or a block device is changed through the legacy
1673 # @change interface.
1675 # In the event that the block device is created through the initial command
1676 # line, the VM will start in the stopped state regardless of whether '-S' is
1677 # used. The intention is for a management tool to query the block devices to
1678 # determine which ones are encrypted, set the passwords with this command, and
1679 # then start the guest with the @cont command.
1681 # Either @device or @node-name must be set but not both.
1683 # @device: #optional the name of the block backend device to set the password on
1685 # @node-name: #optional graph node name to set the password on (Since 2.0)
1687 # @password: the password to use for the device
1689 # Returns: nothing on success
1690 # If @device is not a valid block device, DeviceNotFound
1691 # If @device is not encrypted, DeviceNotEncrypted
1693 # Notes: Not all block formats support encryption and some that do are not
1694 # able to validate that a password is correct. Disk corruption may
1695 # occur if an invalid password is specified.
1699 { 'command': 'block_passwd', 'data': {'*device': 'str',
1700 '*node-name': 'str', 'password': 'str'} }
1705 # Request the balloon driver to change its balloon size.
1707 # @value: the target size of the balloon in bytes
1709 # Returns: Nothing on success
1710 # If the balloon driver is enabled but not functional because the KVM
1711 # kernel module cannot support it, KvmMissingCap
1712 # If no balloon device is present, DeviceNotActive
1714 # Notes: This command just issues a request to the guest. When it returns,
1715 # the balloon size may not have changed. A guest can change the balloon
1716 # size independent of this command.
1720 { 'command': 'balloon', 'data': {'value': 'int'} }
1725 # Resize a block image while a guest is running.
1727 # Either @device or @node-name must be set but not both.
1729 # @device: #optional the name of the device to get the image resized
1731 # @node-name: #optional graph node name to get the image resized (Since 2.0)
1733 # @size: new image size in bytes
1735 # Returns: nothing on success
1736 # If @device is not a valid block device, DeviceNotFound
1740 { 'command': 'block_resize', 'data': { '*device': 'str',
1741 '*node-name': 'str',
1747 # An enumeration that tells QEMU how to set the backing file path in
1750 # @existing: QEMU should look for an existing image file.
1752 # @absolute-paths: QEMU should create a new image with absolute paths
1753 # for the backing file. If there is no backing file available, the new
1754 # image will not be backed either.
1758 { 'enum': 'NewImageMode',
1759 'data': [ 'existing', 'absolute-paths' ] }
1764 # @device: the name of the device to generate the snapshot from.
1766 # @snapshot-file: the target of the new image. A new file will be created.
1768 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1770 # @mode: #optional whether and how QEMU should create a new image, default is
1773 { 'type': 'BlockdevSnapshot',
1774 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1775 '*mode': 'NewImageMode' } }
1778 # @BlockdevSnapshotInternal
1780 # @device: the name of the device to generate the snapshot from
1782 # @name: the name of the internal snapshot to be created
1784 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1785 # exists, the operation will fail. Only some image formats support it,
1786 # for example, qcow2, rbd, and sheepdog.
1790 { 'type': 'BlockdevSnapshotInternal',
1791 'data': { 'device': 'str', 'name': 'str' } }
1796 # @device: the name of the device which should be copied.
1798 # @target: the target of the new image. If the file exists, or if it
1799 # is a device, the existing file/device will be used as the new
1800 # destination. If it does not exist, a new file will be created.
1802 # @format: #optional the format of the new destination, default is to
1803 # probe if @mode is 'existing', else the format of the source
1805 # @sync: what parts of the disk image should be copied to the destination
1806 # (all the disk, only the sectors allocated in the topmost image, or
1809 # @mode: #optional whether and how QEMU should create a new image, default is
1812 # @speed: #optional the maximum speed, in bytes per second
1814 # @on-source-error: #optional the action to take on an error on the source,
1815 # default 'report'. 'stop' and 'enospc' can only be used
1816 # if the block device supports io-status (see BlockInfo).
1818 # @on-target-error: #optional the action to take on an error on the target,
1819 # default 'report' (no limitations, since this applies to
1820 # a different block device than @device).
1822 # Note that @on-source-error and @on-target-error only affect background I/O.
1823 # If an error occurs during a guest write request, the device's rerror/werror
1824 # actions will be used.
1828 { 'type': 'DriveBackup',
1829 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1830 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1832 '*on-source-error': 'BlockdevOnError',
1833 '*on-target-error': 'BlockdevOnError' } }
1838 # This action can be used to test transaction failure.
1846 # @TransactionAction
1848 # A discriminated record of operations that can be performed with
1851 { 'union': 'TransactionAction',
1853 'blockdev-snapshot-sync': 'BlockdevSnapshot',
1854 'drive-backup': 'DriveBackup',
1856 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1862 # Executes a number of transactionable QMP commands atomically. If any
1863 # operation fails, then the entire set of actions will be abandoned and the
1864 # appropriate error returned.
1867 # @TransactionAction: information needed for the respective operation
1869 # Returns: nothing on success
1870 # Errors depend on the operations of the transaction
1872 # Note: The transaction aborts on the first failure. Therefore, there will be
1873 # information on only one failed operation returned in an error condition, and
1874 # subsequent actions will not have been attempted.
1878 { 'command': 'transaction',
1879 'data': { 'actions': [ 'TransactionAction' ] } }
1882 # @blockdev-snapshot-sync
1884 # Generates a synchronous snapshot of a block device.
1886 # For the arguments, see the documentation of BlockdevSnapshot.
1888 # Returns: nothing on success
1889 # If @device is not a valid block device, DeviceNotFound
1893 { 'command': 'blockdev-snapshot-sync',
1894 'data': 'BlockdevSnapshot' }
1897 # @blockdev-snapshot-internal-sync
1899 # Synchronously take an internal snapshot of a block device, when the format
1900 # of the image used supports it.
1902 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1904 # Returns: nothing on success
1905 # If @device is not a valid block device, DeviceNotFound
1906 # If any snapshot matching @name exists, or @name is empty,
1908 # If the format of the image used does not support it,
1909 # BlockFormatFeatureNotSupported
1913 { 'command': 'blockdev-snapshot-internal-sync',
1914 'data': 'BlockdevSnapshotInternal' }
1917 # @blockdev-snapshot-delete-internal-sync
1919 # Synchronously delete an internal snapshot of a block device, when the format
1920 # of the image used support it. The snapshot is identified by name or id or
1921 # both. One of the name or id is required. Return SnapshotInfo for the
1922 # successfully deleted snapshot.
1924 # @device: the name of the device to delete the snapshot from
1926 # @id: optional the snapshot's ID to be deleted
1928 # @name: optional the snapshot's name to be deleted
1930 # Returns: SnapshotInfo on success
1931 # If @device is not a valid block device, DeviceNotFound
1932 # If snapshot not found, GenericError
1933 # If the format of the image used does not support it,
1934 # BlockFormatFeatureNotSupported
1935 # If @id and @name are both not specified, GenericError
1939 { 'command': 'blockdev-snapshot-delete-internal-sync',
1940 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
1941 'returns': 'SnapshotInfo' }
1944 # @human-monitor-command:
1946 # Execute a command on the human monitor and return the output.
1948 # @command-line: the command to execute in the human monitor
1950 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1952 # Returns: the output of the command as a string
1956 # Notes: This command only exists as a stop-gap. Its use is highly
1957 # discouraged. The semantics of this command are not guaranteed.
1959 # Known limitations:
1961 # o This command is stateless, this means that commands that depend
1962 # on state information (such as getfd) might not work
1964 # o Commands that prompt the user for data (eg. 'cont' when the block
1965 # device is encrypted) don't currently work
1967 { 'command': 'human-monitor-command',
1968 'data': {'command-line': 'str', '*cpu-index': 'int'},
1974 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1975 # writes data between 'top' and 'base' into 'base'.
1977 # @device: the name of the device
1979 # @base: #optional The file name of the backing image to write data into.
1980 # If not specified, this is the deepest backing image
1982 # @top: The file name of the backing image within the image chain,
1983 # which contains the topmost data to be committed down.
1985 # If top == base, that is an error.
1986 # If top == active, the job will not be completed by itself,
1987 # user needs to complete the job with the block-job-complete
1988 # command after getting the ready event. (Since 2.0)
1991 # @speed: #optional the maximum speed, in bytes per second
1993 # Returns: Nothing on success
1994 # If commit or stream is already active on this device, DeviceInUse
1995 # If @device does not exist, DeviceNotFound
1996 # If image commit is not supported by this device, NotSupported
1997 # If @base or @top is invalid, a generic error is returned
1998 # If @speed is invalid, InvalidParameter
2003 { 'command': 'block-commit',
2004 'data': { 'device': 'str', '*base': 'str', 'top': 'str',
2010 # Start a point-in-time copy of a block device to a new destination. The
2011 # status of ongoing drive-backup operations can be checked with
2012 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
2013 # The operation can be stopped before it has completed using the
2014 # block-job-cancel command.
2016 # For the arguments, see the documentation of DriveBackup.
2018 # Returns: nothing on success
2019 # If @device is not a valid block device, DeviceNotFound
2023 { 'command': 'drive-backup', 'data': 'DriveBackup' }
2026 # @query-named-block-nodes
2028 # Get the named block driver list
2030 # Returns: the list of BlockDeviceInfo
2034 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
2039 # Start mirroring a block device's writes to a new destination.
2041 # @device: the name of the device whose writes should be mirrored.
2043 # @target: the target of the new image. If the file exists, or if it
2044 # is a device, the existing file/device will be used as the new
2045 # destination. If it does not exist, a new file will be created.
2047 # @format: #optional the format of the new destination, default is to
2048 # probe if @mode is 'existing', else the format of the source
2050 # @mode: #optional whether and how QEMU should create a new image, default is
2053 # @speed: #optional the maximum speed, in bytes per second
2055 # @sync: what parts of the disk image should be copied to the destination
2056 # (all the disk, only the sectors allocated in the topmost image, or
2059 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2060 # if the image format doesn't have clusters, 4K if the clusters
2061 # are smaller than that, else the cluster size. Must be a
2062 # power of 2 between 512 and 64M (since 1.4).
2064 # @buf-size: #optional maximum amount of data in flight from source to
2065 # target (since 1.4).
2067 # @on-source-error: #optional the action to take on an error on the source,
2068 # default 'report'. 'stop' and 'enospc' can only be used
2069 # if the block device supports io-status (see BlockInfo).
2071 # @on-target-error: #optional the action to take on an error on the target,
2072 # default 'report' (no limitations, since this applies to
2073 # a different block device than @device).
2075 # Returns: nothing on success
2076 # If @device is not a valid block device, DeviceNotFound
2080 { 'command': 'drive-mirror',
2081 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2082 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2083 '*speed': 'int', '*granularity': 'uint32',
2084 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2085 '*on-target-error': 'BlockdevOnError' } }
2090 # Cancel the current executing migration process.
2092 # Returns: nothing on success
2094 # Notes: This command succeeds even if there is no migration process running.
2098 { 'command': 'migrate_cancel' }
2101 # @migrate_set_downtime
2103 # Set maximum tolerated downtime for migration.
2105 # @value: maximum downtime in seconds
2107 # Returns: nothing on success
2111 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2114 # @migrate_set_speed
2116 # Set maximum speed for migration.
2118 # @value: maximum speed in bytes.
2120 # Returns: nothing on success
2122 # Notes: A value lesser than zero will be automatically round up to zero.
2126 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2129 # @migrate-set-cache-size
2131 # Set XBZRLE cache size
2133 # @value: cache size in bytes
2135 # The size will be rounded down to the nearest power of 2.
2136 # The cache size can be modified before and during ongoing migration
2138 # Returns: nothing on success
2142 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2145 # @query-migrate-cache-size
2147 # query XBZRLE cache size
2149 # Returns: XBZRLE cache size in bytes
2153 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2156 # @ObjectPropertyInfo:
2158 # @name: the name of the property
2160 # @type: the type of the property. This will typically come in one of four
2163 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2164 # These types are mapped to the appropriate JSON type.
2166 # 2) A legacy type in the form 'legacy<subtype>' where subtype is the
2167 # legacy qdev typename. These types are always treated as strings.
2169 # 3) A child type in the form 'child<subtype>' where subtype is a qdev
2170 # device type name. Child properties create the composition tree.
2172 # 4) A link type in the form 'link<subtype>' where subtype is a qdev
2173 # device type name. Link properties form the device model graph.
2177 { 'type': 'ObjectPropertyInfo',
2178 'data': { 'name': 'str', 'type': 'str' } }
2183 # This command will list any properties of a object given a path in the object
2186 # @path: the path within the object model. See @qom-get for a description of
2189 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2194 { 'command': 'qom-list',
2195 'data': { 'path': 'str' },
2196 'returns': [ 'ObjectPropertyInfo' ] }
2201 # This command will get a property from a object model path and return the
2204 # @path: The path within the object model. There are two forms of supported
2205 # paths--absolute and partial paths.
2207 # Absolute paths are derived from the root object and can follow child<>
2208 # or link<> properties. Since they can follow link<> properties, they
2209 # can be arbitrarily long. Absolute paths look like absolute filenames
2210 # and are prefixed with a leading slash.
2212 # Partial paths look like relative filenames. They do not begin
2213 # with a prefix. The matching rules for partial paths are subtle but
2214 # designed to make specifying objects easy. At each level of the
2215 # composition tree, the partial path is matched as an absolute path.
2216 # The first match is not returned. At least two matches are searched
2217 # for. A successful result is only returned if only one match is
2218 # found. If more than one match is found, a flag is return to
2219 # indicate that the match was ambiguous.
2221 # @property: The property name to read
2223 # Returns: The property value. The type depends on the property type. legacy<>
2224 # properties are returned as #str. child<> and link<> properties are
2225 # returns as #str pathnames. All integer property types (u8, u16, etc)
2226 # are returned as #int.
2230 { 'command': 'qom-get',
2231 'data': { 'path': 'str', 'property': 'str' },
2232 'returns': 'visitor',
2238 # This command will set a property from a object model path.
2240 # @path: see @qom-get for a description of this parameter
2242 # @property: the property name to set
2244 # @value: a value who's type is appropriate for the property type. See @qom-get
2245 # for a description of type mapping.
2249 { 'command': 'qom-set',
2250 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2256 # Sets the password of a remote display session.
2258 # @protocol: `vnc' to modify the VNC server password
2259 # `spice' to modify the Spice server password
2261 # @password: the new password
2263 # @connected: #optional how to handle existing clients when changing the
2264 # password. If nothing is specified, defaults to `keep'
2265 # `fail' to fail the command if clients are connected
2266 # `disconnect' to disconnect existing clients
2267 # `keep' to maintain existing clients
2269 # Returns: Nothing on success
2270 # If Spice is not enabled, DeviceNotFound
2274 { 'command': 'set_password',
2275 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2280 # Expire the password of a remote display server.
2282 # @protocol: the name of the remote display protocol `vnc' or `spice'
2284 # @time: when to expire the password.
2285 # `now' to expire the password immediately
2286 # `never' to cancel password expiration
2287 # `+INT' where INT is the number of seconds from now (integer)
2288 # `INT' where INT is the absolute time in seconds
2290 # Returns: Nothing on success
2291 # If @protocol is `spice' and Spice is not active, DeviceNotFound
2295 # Notes: Time is relative to the server and currently there is no way to
2296 # coordinate server time with client time. It is not recommended to
2297 # use the absolute time version of the @time parameter unless you're
2298 # sure you are on the same machine as the QEMU instance.
2300 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2305 # Ejects a device from a removable drive.
2307 # @device: The name of the device
2309 # @force: @optional If true, eject regardless of whether the drive is locked.
2310 # If not specified, the default value is false.
2312 # Returns: Nothing on success
2313 # If @device is not a valid block device, DeviceNotFound
2315 # Notes: Ejecting a device will no media results in success
2319 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2322 # @change-vnc-password:
2324 # Change the VNC server password.
2326 # @target: the new password to use with VNC authentication
2330 # Notes: An empty password in this command will set the password to the empty
2331 # string. Existing clients are unaffected by executing this command.
2333 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2338 # This command is multiple commands multiplexed together.
2340 # @device: This is normally the name of a block device but it may also be 'vnc'.
2341 # when it's 'vnc', then sub command depends on @target
2343 # @target: If @device is a block device, then this is the new filename.
2344 # If @device is 'vnc', then if the value 'password' selects the vnc
2345 # change password command. Otherwise, this specifies a new server URI
2346 # address to listen to for VNC connections.
2348 # @arg: If @device is a block device, then this is an optional format to open
2350 # If @device is 'vnc' and @target is 'password', this is the new VNC
2351 # password to set. If this argument is an empty string, then no future
2352 # logins will be allowed.
2354 # Returns: Nothing on success.
2355 # If @device is not a valid block device, DeviceNotFound
2356 # If the new block device is encrypted, DeviceEncrypted. Note that
2357 # if this error is returned, the device has been opened successfully
2358 # and an additional call to @block_passwd is required to set the
2359 # device's password. The behavior of reads and writes to the block
2360 # device between when these calls are executed is undefined.
2362 # Notes: It is strongly recommended that this interface is not used especially
2363 # for changing block devices.
2367 { 'command': 'change',
2368 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2371 # @block_set_io_throttle:
2373 # Change I/O throttle limits for a block drive.
2375 # @device: The name of the device
2377 # @bps: total throughput limit in bytes per second
2379 # @bps_rd: read throughput limit in bytes per second
2381 # @bps_wr: write throughput limit in bytes per second
2383 # @iops: total I/O operations per second
2385 # @ops_rd: read I/O operations per second
2387 # @iops_wr: write I/O operations per second
2389 # @bps_max: #optional total max in bytes (Since 1.7)
2391 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2393 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2395 # @iops_max: #optional total I/O operations max (Since 1.7)
2397 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2399 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2401 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2403 # Returns: Nothing on success
2404 # If @device is not a valid block device, DeviceNotFound
2408 { 'command': 'block_set_io_throttle',
2409 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2410 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2411 '*bps_max': 'int', '*bps_rd_max': 'int',
2412 '*bps_wr_max': 'int', '*iops_max': 'int',
2413 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2414 '*iops_size': 'int' } }
2419 # Copy data from a backing file into a block device.
2421 # The block streaming operation is performed in the background until the entire
2422 # backing file has been copied. This command returns immediately once streaming
2423 # has started. The status of ongoing block streaming operations can be checked
2424 # with query-block-jobs. The operation can be stopped before it has completed
2425 # using the block-job-cancel command.
2427 # If a base file is specified then sectors are not copied from that base file and
2428 # its backing chain. When streaming completes the image file will have the base
2429 # file as its backing file. This can be used to stream a subset of the backing
2430 # file chain instead of flattening the entire image.
2432 # On successful completion the image file is updated to drop the backing file
2433 # and the BLOCK_JOB_COMPLETED event is emitted.
2435 # @device: the device name
2437 # @base: #optional the common backing file name
2439 # @speed: #optional the maximum speed, in bytes per second
2441 # @on-error: #optional the action to take on an error (default report).
2442 # 'stop' and 'enospc' can only be used if the block device
2443 # supports io-status (see BlockInfo). Since 1.3.
2445 # Returns: Nothing on success
2446 # If @device does not exist, DeviceNotFound
2450 { 'command': 'block-stream',
2451 'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2452 '*on-error': 'BlockdevOnError' } }
2455 # @block-job-set-speed:
2457 # Set maximum speed for a background block operation.
2459 # This command can only be issued when there is an active block job.
2461 # Throttling can be disabled by setting the speed to 0.
2463 # @device: the device name
2465 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2468 # Returns: Nothing on success
2469 # If no background operation is active on this device, DeviceNotActive
2473 { 'command': 'block-job-set-speed',
2474 'data': { 'device': 'str', 'speed': 'int' } }
2477 # @block-job-cancel:
2479 # Stop an active background block operation.
2481 # This command returns immediately after marking the active background block
2482 # operation for cancellation. It is an error to call this command if no
2483 # operation is in progress.
2485 # The operation will cancel as soon as possible and then emit the
2486 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2487 # enumerated using query-block-jobs.
2489 # For streaming, the image file retains its backing file unless the streaming
2490 # operation happens to complete just as it is being cancelled. A new streaming
2491 # operation can be started at a later time to finish copying all data from the
2494 # @device: the device name
2496 # @force: #optional whether to allow cancellation of a paused job (default
2497 # false). Since 1.3.
2499 # Returns: Nothing on success
2500 # If no background operation is active on this device, DeviceNotActive
2504 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2509 # Pause an active background block operation.
2511 # This command returns immediately after marking the active background block
2512 # operation for pausing. It is an error to call this command if no
2513 # operation is in progress. Pausing an already paused job has no cumulative
2514 # effect; a single block-job-resume command will resume the job.
2516 # The operation will pause as soon as possible. No event is emitted when
2517 # the operation is actually paused. Cancelling a paused job automatically
2520 # @device: the device name
2522 # Returns: Nothing on success
2523 # If no background operation is active on this device, DeviceNotActive
2527 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2530 # @block-job-resume:
2532 # Resume an active background block operation.
2534 # This command returns immediately after resuming a paused background block
2535 # operation. It is an error to call this command if no operation is in
2536 # progress. Resuming an already running job is not an error.
2538 # This command also clears the error status of the job.
2540 # @device: the device name
2542 # Returns: Nothing on success
2543 # If no background operation is active on this device, DeviceNotActive
2547 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2550 # @block-job-complete:
2552 # Manually trigger completion of an active background block operation. This
2553 # is supported for drive mirroring, where it also switches the device to
2554 # write to the target path only. The ability to complete is signaled with
2555 # a BLOCK_JOB_READY event.
2557 # This command completes an active background block operation synchronously.
2558 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2559 # is not defined. Note that if an I/O error occurs during the processing of
2560 # this command: 1) the command itself will fail; 2) the error will be processed
2561 # according to the rerror/werror arguments that were specified when starting
2564 # A cancelled or paused job cannot be completed.
2566 # @device: the device name
2568 # Returns: Nothing on success
2569 # If no background operation is active on this device, DeviceNotActive
2573 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2578 # This structure describes a search result from @qom-list-types
2580 # @name: the type name found in the search
2584 # Notes: This command is experimental and may change syntax in future releases.
2586 { 'type': 'ObjectTypeInfo',
2587 'data': { 'name': 'str' } }
2592 # This command will return a list of types given search parameters
2594 # @implements: if specified, only return types that implement this type name
2596 # @abstract: if true, include abstract types in the results
2598 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2602 { 'command': 'qom-list-types',
2603 'data': { '*implements': 'str', '*abstract': 'bool' },
2604 'returns': [ 'ObjectTypeInfo' ] }
2607 # @DevicePropertyInfo:
2609 # Information about device properties.
2611 # @name: the name of the property
2612 # @type: the typename of the property
2616 { 'type': 'DevicePropertyInfo',
2617 'data': { 'name': 'str', 'type': 'str' } }
2620 # @device-list-properties:
2622 # List properties associated with a device.
2624 # @typename: the type name of a device
2626 # Returns: a list of DevicePropertyInfo describing a devices properties
2630 { 'command': 'device-list-properties',
2631 'data': { 'typename': 'str'},
2632 'returns': [ 'DevicePropertyInfo' ] }
2637 # Migrates the current running guest to another Virtual Machine.
2639 # @uri: the Uniform Resource Identifier of the destination VM
2641 # @blk: #optional do block migration (full disk copy)
2643 # @inc: #optional incremental disk copy migration
2645 # @detach: this argument exists only for compatibility reasons and
2646 # is ignored by QEMU
2648 # Returns: nothing on success
2652 { 'command': 'migrate',
2653 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2655 # @xen-save-devices-state:
2657 # Save the state of all devices to file. The RAM and the block devices
2658 # of the VM are not saved by this command.
2660 # @filename: the file to save the state of the devices to as binary
2661 # data. See xen-save-devices-state.txt for a description of the binary
2664 # Returns: Nothing on success
2668 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2671 # @xen-set-global-dirty-log
2673 # Enable or disable the global dirty log mode.
2675 # @enable: true to enable, false to disable.
2681 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2686 # Remove a device from a guest
2688 # @id: the name of the device
2690 # Returns: Nothing on success
2691 # If @id is not a valid device, DeviceNotFound
2693 # Notes: When this command completes, the device may not be removed from the
2694 # guest. Hot removal is an operation that requires guest cooperation.
2695 # This command merely requests that the guest begin the hot removal
2696 # process. Completion of the device removal process is signaled with a
2697 # DEVICE_DELETED event. Guest reset will automatically complete removal
2702 { 'command': 'device_del', 'data': {'id': 'str'} }
2705 # @dump-guest-memory
2707 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2708 # very long depending on the amount of guest memory. This command is only
2709 # supported on i386 and x86_64.
2711 # @paging: if true, do paging to get guest's memory mapping. This allows
2712 # using gdb to process the core file.
2714 # IMPORTANT: this option can make QEMU allocate several gigabytes
2715 # of RAM. This can happen for a large guest, or a
2716 # malicious guest pretending to be large.
2718 # Also, paging=true has the following limitations:
2720 # 1. The guest may be in a catastrophic state or can have corrupted
2721 # memory, which cannot be trusted
2722 # 2. The guest can be in real-mode even if paging is enabled. For
2723 # example, the guest uses ACPI to sleep, and ACPI sleep state
2726 # @protocol: the filename or file descriptor of the vmcore. The supported
2729 # 1. file: the protocol starts with "file:", and the following
2730 # string is the file's path.
2731 # 2. fd: the protocol starts with "fd:", and the following string
2734 # @begin: #optional if specified, the starting physical address.
2736 # @length: #optional if specified, the memory size, in bytes. If you don't
2737 # want to dump all guest's memory, please specify the start @begin
2740 # Returns: nothing on success
2744 { 'command': 'dump-guest-memory',
2745 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2746 '*length': 'int' } }
2751 # Add a network backend.
2753 # @type: the type of network backend. Current valid values are 'user', 'tap',
2754 # 'vde', 'socket', 'dump' and 'bridge'
2756 # @id: the name of the new network backend
2758 # @props: #optional a list of properties to be passed to the backend in
2759 # the format 'name=value', like 'ifname=tap0,script=no'
2761 # Notes: The semantics of @props is not well defined. Future commands will be
2762 # introduced that provide stronger typing for backend creation.
2766 # Returns: Nothing on success
2767 # If @type is not a valid network backend, DeviceNotFound
2769 { 'command': 'netdev_add',
2770 'data': {'type': 'str', 'id': 'str', '*props': '**'},
2776 # Remove a network backend.
2778 # @id: the name of the network backend to remove
2780 # Returns: Nothing on success
2781 # If @id is not a valid network backend, DeviceNotFound
2785 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2790 # Create a QOM object.
2792 # @qom-type: the class name for the object to be created
2794 # @id: the name of the new object
2796 # @props: #optional a dictionary of properties to be passed to the backend
2798 # Returns: Nothing on success
2799 # Error if @qom-type is not a valid class name
2803 { 'command': 'object-add',
2804 'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
2810 # Remove a QOM object.
2812 # @id: the name of the QOM object to remove
2814 # Returns: Nothing on success
2815 # Error if @id is not a valid id for a QOM object
2819 { 'command': 'object-del', 'data': {'id': 'str'} }
2822 # @NetdevNoneOptions
2824 # Use it alone to have zero network devices.
2828 { 'type': 'NetdevNoneOptions',
2832 # @NetLegacyNicOptions
2834 # Create a new Network Interface Card.
2836 # @netdev: #optional id of -netdev to connect to
2838 # @macaddr: #optional MAC address
2840 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2842 # @addr: #optional PCI device address
2844 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2848 { 'type': 'NetLegacyNicOptions',
2854 '*vectors': 'uint32' } }
2859 # A fat type wrapping 'str', to be embedded in lists.
2868 # @NetdevUserOptions
2870 # Use the user mode network stack which requires no administrator privilege to
2873 # @hostname: #optional client hostname reported by the builtin DHCP server
2875 # @restrict: #optional isolate the guest from the host
2877 # @ip: #optional legacy parameter, use net= instead
2879 # @net: #optional IP address and optional netmask
2881 # @host: #optional guest-visible address of the host
2883 # @tftp: #optional root directory of the built-in TFTP server
2885 # @bootfile: #optional BOOTP filename, for use with tftp=
2887 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2890 # @dns: #optional guest-visible address of the virtual nameserver
2892 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2895 # @smb: #optional root directory of the built-in SMB server
2897 # @smbserver: #optional IP address of the built-in SMB server
2899 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2902 # @guestfwd: #optional forward guest TCP connections
2906 { 'type': 'NetdevUserOptions',
2909 '*restrict': 'bool',
2915 '*dhcpstart': 'str',
2917 '*dnssearch': ['String'],
2919 '*smbserver': 'str',
2920 '*hostfwd': ['String'],
2921 '*guestfwd': ['String'] } }
2926 # Connect the host TAP network interface name to the VLAN.
2928 # @ifname: #optional interface name
2930 # @fd: #optional file descriptor of an already opened tap
2932 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2935 # @script: #optional script to initialize the interface
2937 # @downscript: #optional script to shut down the interface
2939 # @helper: #optional command to execute to configure bridge
2941 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2943 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2945 # @vhost: #optional enable vhost-net network accelerator
2947 # @vhostfd: #optional file descriptor of an already opened vhost net device
2949 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2952 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2954 # @queues: #optional number of queues to be created for multiqueue capable tap
2958 { 'type': 'NetdevTapOptions',
2964 '*downscript': 'str',
2967 '*vnet_hdr': 'bool',
2971 '*vhostforce': 'bool',
2972 '*queues': 'uint32'} }
2975 # @NetdevSocketOptions
2977 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2978 # socket connection.
2980 # @fd: #optional file descriptor of an already opened socket
2982 # @listen: #optional port number, and optional hostname, to listen on
2984 # @connect: #optional port number, and optional hostname, to connect to
2986 # @mcast: #optional UDP multicast address and port number
2988 # @localaddr: #optional source address and port for multicast and udp packets
2990 # @udp: #optional UDP unicast address and port number
2994 { 'type': 'NetdevSocketOptions',
3000 '*localaddr': 'str',
3006 # Connect the VLAN to a vde switch running on the host.
3008 # @sock: #optional socket path
3010 # @port: #optional port number
3012 # @group: #optional group owner of socket
3014 # @mode: #optional permissions for socket
3018 { 'type': 'NetdevVdeOptions',
3023 '*mode': 'uint16' } }
3026 # @NetdevDumpOptions
3028 # Dump VLAN network traffic to a file.
3030 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3033 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3037 { 'type': 'NetdevDumpOptions',
3043 # @NetdevBridgeOptions
3045 # Connect a host TAP network interface to a host bridge device.
3047 # @br: #optional bridge name
3049 # @helper: #optional command to execute to configure bridge
3053 { 'type': 'NetdevBridgeOptions',
3056 '*helper': 'str' } }
3059 # @NetdevHubPortOptions
3061 # Connect two or more net clients through a software hub.
3063 # @hubid: hub identifier number
3067 { 'type': 'NetdevHubPortOptions',
3069 'hubid': 'int32' } }
3072 # @NetdevNetmapOptions
3074 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3076 # @ifname: Either the name of an existing network interface supported by
3077 # netmap, or the name of a VALE port (created on the fly).
3078 # A VALE port name is in the form 'valeXXX:YYY', where XXX and
3079 # YYY are non-negative integers. XXX identifies a switch and
3080 # YYY identifies a port of the switch. VALE ports having the
3081 # same XXX are therefore connected to the same switch.
3083 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3087 { 'type': 'NetdevNetmapOptions',
3090 '*devname': 'str' } }
3095 # A discriminated record of network device traits.
3099 { 'union': 'NetClientOptions',
3101 'none': 'NetdevNoneOptions',
3102 'nic': 'NetLegacyNicOptions',
3103 'user': 'NetdevUserOptions',
3104 'tap': 'NetdevTapOptions',
3105 'socket': 'NetdevSocketOptions',
3106 'vde': 'NetdevVdeOptions',
3107 'dump': 'NetdevDumpOptions',
3108 'bridge': 'NetdevBridgeOptions',
3109 'hubport': 'NetdevHubPortOptions',
3110 'netmap': 'NetdevNetmapOptions' } }
3115 # Captures the configuration of a network device; legacy.
3117 # @vlan: #optional vlan number
3119 # @id: #optional identifier for monitor commands
3121 # @name: #optional identifier for monitor commands, ignored if @id is present
3123 # @opts: device type specific properties (legacy)
3127 { 'type': 'NetLegacy',
3132 'opts': 'NetClientOptions' } }
3137 # Captures the configuration of a network device.
3139 # @id: identifier for monitor commands.
3141 # @opts: device type specific properties
3148 'opts': 'NetClientOptions' } }
3151 # @InetSocketAddress
3153 # Captures a socket address or address range in the Internet namespace.
3155 # @host: host part of the address
3157 # @port: port part of the address, or lowest port if @to is present
3159 # @to: highest port to try
3161 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3164 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3169 { 'type': 'InetSocketAddress',
3178 # @UnixSocketAddress
3180 # Captures a socket address in the local ("Unix socket") namespace.
3182 # @path: filesystem path to use
3186 { 'type': 'UnixSocketAddress',
3193 # Captures the address of a socket, which could also be a named file descriptor
3197 { 'union': 'SocketAddress',
3199 'inet': 'InetSocketAddress',
3200 'unix': 'UnixSocketAddress',
3206 # Receive a file descriptor via SCM rights and assign it a name
3208 # @fdname: file descriptor name
3210 # Returns: Nothing on success
3214 # Notes: If @fdname already exists, the file descriptor assigned to
3215 # it will be closed and replaced by the received file
3217 # The 'closefd' command can be used to explicitly close the
3218 # file descriptor when it is no longer needed.
3220 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3225 # Close a file descriptor previously passed via SCM rights
3227 # @fdname: file descriptor name
3229 # Returns: Nothing on success
3233 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3238 # Information describing a machine.
3240 # @name: the name of the machine
3242 # @alias: #optional an alias for the machine name
3244 # @default: #optional whether the machine is default
3246 # @cpu-max: maximum number of CPUs supported by the machine type
3251 { 'type': 'MachineInfo',
3252 'data': { 'name': 'str', '*alias': 'str',
3253 '*is-default': 'bool', 'cpu-max': 'int' } }
3258 # Return a list of supported machines
3260 # Returns: a list of MachineInfo
3264 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3267 # @CpuDefinitionInfo:
3269 # Virtual CPU definition.
3271 # @name: the name of the CPU definition
3275 { 'type': 'CpuDefinitionInfo',
3276 'data': { 'name': 'str' } }
3279 # @query-cpu-definitions:
3281 # Return a list of supported virtual CPU definitions
3283 # Returns: a list of CpuDefInfo
3287 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3291 # Information about a file descriptor that was added to an fd set.
3293 # @fdset-id: The ID of the fd set that @fd was added to.
3295 # @fd: The file descriptor that was received via SCM rights and
3296 # added to the fd set.
3300 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3305 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3307 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3309 # @opaque: #optional A free-form string that can be used to describe the fd.
3311 # Returns: @AddfdInfo on success
3312 # If file descriptor was not received, FdNotSupplied
3313 # If @fdset-id is a negative value, InvalidParameterValue
3315 # Notes: The list of fd sets is shared by all monitor connections.
3317 # If @fdset-id is not specified, a new fd set will be created.
3321 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3322 'returns': 'AddfdInfo' }
3327 # Remove a file descriptor from an fd set.
3329 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3331 # @fd: #optional The file descriptor that is to be removed.
3333 # Returns: Nothing on success
3334 # If @fdset-id or @fd is not found, FdNotFound
3338 # Notes: The list of fd sets is shared by all monitor connections.
3340 # If @fd is not specified, all file descriptors in @fdset-id
3343 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3348 # Information about a file descriptor that belongs to an fd set.
3350 # @fd: The file descriptor value.
3352 # @opaque: #optional A free-form string that can be used to describe the fd.
3356 { 'type': 'FdsetFdInfo',
3357 'data': {'fd': 'int', '*opaque': 'str'} }
3362 # Information about an fd set.
3364 # @fdset-id: The ID of the fd set.
3366 # @fds: A list of file descriptors that belong to this fd set.
3370 { 'type': 'FdsetInfo',
3371 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3376 # Return information describing all fd sets.
3378 # Returns: A list of @FdsetInfo
3382 # Note: The list of fd sets is shared by all monitor connections.
3385 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3390 # Information describing the QEMU target.
3392 # @arch: the target architecture (eg "x86_64", "i386", etc)
3396 { 'type': 'TargetInfo',
3397 'data': { 'arch': 'str' } }
3402 # Return information about the target for this QEMU
3404 # Returns: TargetInfo
3408 { 'command': 'query-target', 'returns': 'TargetInfo' }
3413 # An enumeration of key name.
3415 # This is used by the send-key command.
3419 { 'enum': 'QKeyCode',
3420 'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3421 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3422 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3423 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3424 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3425 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3426 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3427 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3428 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3429 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3430 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3431 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3432 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3433 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3434 'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3439 # Represents a keyboard key.
3443 { 'union': 'KeyValue',
3446 'qcode': 'QKeyCode' } }
3451 # Send keys to guest.
3453 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3454 # simultaneously sent to the guest. A @KeyValue.number value is sent
3455 # directly to the guest, while @KeyValue.qcode must be a valid
3458 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3461 # Returns: Nothing on success
3462 # If key is unknown or redundant, InvalidParameter
3467 { 'command': 'send-key',
3468 'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3473 # Write a PPM of the VGA screen to a file.
3475 # @filename: the path of a new PPM file to store the image
3477 # Returns: Nothing on success
3481 { 'command': 'screendump', 'data': {'filename': 'str'} }
3484 # @nbd-server-start:
3486 # Start an NBD server listening on the given host and port. Block
3487 # devices can then be exported using @nbd-server-add. The NBD
3488 # server will present them as named exports; for example, another
3489 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3491 # @addr: Address on which to listen.
3493 # Returns: error if the server is already running.
3497 { 'command': 'nbd-server-start',
3498 'data': { 'addr': 'SocketAddress' } }
3503 # Export a device to QEMU's embedded NBD server.
3505 # @device: Block device to be exported
3507 # @writable: Whether clients should be able to write to the device via the
3508 # NBD connection (default false). #optional
3510 # Returns: error if the device is already marked for export.
3514 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3519 # Stop QEMU's embedded NBD server, and unregister all devices previously
3520 # added via @nbd-server-add.
3524 { 'command': 'nbd-server-stop' }
3529 # Configuration info for file chardevs.
3531 # @in: #optional The name of the input file
3532 # @out: The name of the output file
3536 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3542 # Configuration info for device and pipe chardevs.
3544 # @device: The name of the special file for the device,
3545 # i.e. /dev/ttyS0 on Unix or COM1: on Windows
3546 # @type: What kind of device this is.
3550 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3555 # Configuration info for (stream) socket chardevs.
3557 # @addr: socket address to listen on (server=true)
3558 # or connect to (server=false)
3559 # @server: #optional create server socket (default: true)
3560 # @wait: #optional wait for incoming connection on server
3561 # sockets (default: false).
3562 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3563 # @telnet: #optional enable telnet protocol on server
3564 # sockets (default: false)
3568 { 'type': 'ChardevSocket', 'data': { 'addr' : 'SocketAddress',
3571 '*nodelay' : 'bool',
3572 '*telnet' : 'bool' } }
3577 # Configuration info for datagram socket chardevs.
3579 # @remote: remote address
3580 # @local: #optional local address
3584 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3585 '*local' : 'SocketAddress' } }
3590 # Configuration info for mux chardevs.
3592 # @chardev: name of the base chardev.
3596 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3601 # Configuration info for stdio chardevs.
3603 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3604 # be delivered to qemu. Default: true in -nographic mode,
3609 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3612 # @ChardevSpiceChannel:
3614 # Configuration info for spice vm channel chardevs.
3616 # @type: kind of channel (for example vdagent).
3620 { 'type': 'ChardevSpiceChannel', 'data': { 'type' : 'str' } }
3623 # @ChardevSpicePort:
3625 # Configuration info for spice port chardevs.
3627 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3631 { 'type': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' } }
3636 # Configuration info for virtual console chardevs.
3638 # @width: console width, in pixels
3639 # @height: console height, in pixels
3640 # @cols: console width, in chars
3641 # @rows: console height, in chars
3645 { 'type': 'ChardevVC', 'data': { '*width' : 'int',
3653 # Configuration info for ring buffer chardevs.
3655 # @size: #optional ring buffer size, must be power of two, default is 65536
3659 { 'type': 'ChardevRingbuf', 'data': { '*size' : 'int' } }
3664 # Configuration info for the new chardev backend.
3668 { 'type': 'ChardevDummy', 'data': { } }
3670 { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
3671 'serial' : 'ChardevHostdev',
3672 'parallel': 'ChardevHostdev',
3673 'pipe' : 'ChardevHostdev',
3674 'socket' : 'ChardevSocket',
3675 'udp' : 'ChardevUdp',
3676 'pty' : 'ChardevDummy',
3677 'null' : 'ChardevDummy',
3678 'mux' : 'ChardevMux',
3679 'msmouse': 'ChardevDummy',
3680 'braille': 'ChardevDummy',
3681 'stdio' : 'ChardevStdio',
3682 'console': 'ChardevDummy',
3683 'spicevmc' : 'ChardevSpiceChannel',
3684 'spiceport' : 'ChardevSpicePort',
3686 'ringbuf': 'ChardevRingbuf',
3687 # next one is just for compatibility
3688 'memory' : 'ChardevRingbuf' } }
3693 # Return info about the chardev backend just created.
3695 # @pty: #optional name of the slave pseudoterminal device, present if
3696 # and only if a chardev of type 'pty' was created
3700 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3705 # Add a character device backend
3707 # @id: the chardev's ID, must be unique
3708 # @backend: backend type and parameters
3710 # Returns: ChardevReturn.
3714 { 'command': 'chardev-add', 'data': {'id' : 'str',
3715 'backend' : 'ChardevBackend' },
3716 'returns': 'ChardevReturn' }
3721 # Remove a character device backend
3723 # @id: the chardev's ID, must exist and not be in use
3725 # Returns: Nothing on success
3729 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3734 # An enumeration of TPM models
3736 # @tpm-tis: TPM TIS model
3740 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3743 # @query-tpm-models:
3745 # Return a list of supported TPM models
3747 # Returns: a list of TpmModel
3751 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3756 # An enumeration of TPM types
3758 # @passthrough: TPM passthrough type
3762 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3767 # Return a list of supported TPM types
3769 # Returns: a list of TpmType
3773 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3776 # @TPMPassthroughOptions:
3778 # Information about the TPM passthrough type
3780 # @path: #optional string describing the path used for accessing the TPM device
3782 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3783 # for cancellation of TPM commands while they are executing
3787 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3788 '*cancel-path' : 'str'} }
3793 # A union referencing different TPM backend types' configuration options
3795 # @passthrough: The configuration options for the TPM passthrough type
3799 { 'union': 'TpmTypeOptions',
3800 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3805 # Information about the TPM
3807 # @id: The Id of the TPM
3809 # @model: The TPM frontend model
3811 # @options: The TPM (backend) type configuration options
3815 { 'type': 'TPMInfo',
3816 'data': {'id': 'str',
3817 'model': 'TpmModel',
3818 'options': 'TpmTypeOptions' } }
3823 # Return information about the TPM device
3825 # Returns: @TPMInfo on success
3829 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3834 # Specify an ACPI table on the command line to load.
3836 # At most one of @file and @data can be specified. The list of files specified
3837 # by any one of them is loaded and concatenated in order. If both are omitted,
3840 # Other fields / optargs can be used to override fields of the generic ACPI
3841 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3842 # Description Table Header. If a header field is not overridden, then the
3843 # corresponding value from the concatenated blob is used (in case of @file), or
3844 # it is filled in with a hard-coded value (in case of @data).
3846 # String fields are copied into the matching ACPI member from lowest address
3847 # upwards, and silently truncated / NUL-padded to length.
3849 # @sig: #optional table signature / identifier (4 bytes)
3851 # @rev: #optional table revision number (dependent on signature, 1 byte)
3853 # @oem_id: #optional OEM identifier (6 bytes)
3855 # @oem_table_id: #optional OEM table identifier (8 bytes)
3857 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3859 # @asl_compiler_id: #optional identifier of the utility that created the table
3862 # @asl_compiler_rev: #optional revision number of the utility that created the
3865 # @file: #optional colon (:) separated list of pathnames to load and
3866 # concatenate as table data. The resultant binary blob is expected to
3867 # have an ACPI table header. At least one file is required. This field
3870 # @data: #optional colon (:) separated list of pathnames to load and
3871 # concatenate as table data. The resultant binary blob must not have an
3872 # ACPI table header. At least one file is required. This field excludes
3877 { 'type': 'AcpiTableOptions',
3882 '*oem_table_id': 'str',
3883 '*oem_rev': 'uint32',
3884 '*asl_compiler_id': 'str',
3885 '*asl_compiler_rev': 'uint32',
3890 # @CommandLineParameterType:
3892 # Possible types for an option parameter.
3894 # @string: accepts a character string
3896 # @boolean: accepts "on" or "off"
3898 # @number: accepts a number
3900 # @size: accepts a number followed by an optional suffix (K)ilo,
3901 # (M)ega, (G)iga, (T)era
3905 { 'enum': 'CommandLineParameterType',
3906 'data': ['string', 'boolean', 'number', 'size'] }
3909 # @CommandLineParameterInfo:
3911 # Details about a single parameter of a command line option.
3913 # @name: parameter name
3915 # @type: parameter @CommandLineParameterType
3917 # @help: #optional human readable text string, not suitable for parsing.
3921 { 'type': 'CommandLineParameterInfo',
3922 'data': { 'name': 'str',
3923 'type': 'CommandLineParameterType',
3927 # @CommandLineOptionInfo:
3929 # Details about a command line option, including its list of parameter details
3931 # @option: option name
3933 # @parameters: an array of @CommandLineParameterInfo
3937 { 'type': 'CommandLineOptionInfo',
3938 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3941 # @query-command-line-options:
3943 # Query command line option schema.
3945 # @option: #optional option name
3947 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3948 # @option). Returns an error if the given @option doesn't exist.
3952 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3953 'returns': ['CommandLineOptionInfo'] }
3958 # A X86 32-bit register
3962 { 'enum': 'X86CPURegister32',
3963 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3966 # @X86CPUFeatureWordInfo
3968 # Information about a X86 CPU feature word
3970 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3972 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3975 # @cpuid-register: Output register containing the feature bits
3977 # @features: value of output register, containing the feature bits
3981 { 'type': 'X86CPUFeatureWordInfo',
3982 'data': { 'cpuid-input-eax': 'int',
3983 '*cpuid-input-ecx': 'int',
3984 'cpuid-register': 'X86CPURegister32',
3985 'features': 'int' } }
3990 # Packets receiving state
3992 # @normal: filter assigned packets according to the mac-table
3994 # @none: don't receive any assigned packet
3996 # @all: receive all assigned packets
4000 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4005 # Rx-filter information for a NIC.
4007 # @name: net client name
4009 # @promiscuous: whether promiscuous mode is enabled
4011 # @multicast: multicast receive state
4013 # @unicast: unicast receive state
4015 # @broadcast-allowed: whether to receive broadcast
4017 # @multicast-overflow: multicast table is overflowed or not
4019 # @unicast-overflow: unicast table is overflowed or not
4021 # @main-mac: the main macaddr string
4023 # @vlan-table: a list of active vlan id
4025 # @unicast-table: a list of unicast macaddr string
4027 # @multicast-table: a list of multicast macaddr string
4032 { 'type': 'RxFilterInfo',
4035 'promiscuous': 'bool',
4036 'multicast': 'RxState',
4037 'unicast': 'RxState',
4038 'broadcast-allowed': 'bool',
4039 'multicast-overflow': 'bool',
4040 'unicast-overflow': 'bool',
4042 'vlan-table': ['int'],
4043 'unicast-table': ['str'],
4044 'multicast-table': ['str'] }}
4049 # Return rx-filter information for all NICs (or for the given NIC).
4051 # @name: #optional net client name
4053 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4054 # Returns an error if the given @name doesn't exist, or given
4055 # NIC doesn't support rx-filter querying, or given net client
4060 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4061 'returns': ['RxFilterInfo'] }
4065 # @BlockdevDiscardOptions
4067 # Determines how to handle discard requests.
4069 # @ignore: Ignore the request
4070 # @unmap: Forward as an unmap request
4074 { 'enum': 'BlockdevDiscardOptions',
4075 'data': [ 'ignore', 'unmap' ] }
4078 # @BlockdevAioOptions
4080 # Selects the AIO backend to handle I/O requests
4082 # @threads: Use qemu's thread pool
4083 # @native: Use native AIO backend (only Linux and Windows)
4087 { 'enum': 'BlockdevAioOptions',
4088 'data': [ 'threads', 'native' ] }
4091 # @BlockdevCacheOptions
4093 # Includes cache-related options for block devices
4095 # @writeback: #optional enables writeback mode for any caches (default: true)
4096 # @direct: #optional enables use of O_DIRECT (bypass the host page cache;
4098 # @no-flush: #optional ignore any flush requests for the device (default:
4103 { 'type': 'BlockdevCacheOptions',
4104 'data': { '*writeback': 'bool',
4106 '*no-flush': 'bool' } }
4109 # @BlockdevOptionsBase
4111 # Options that are available for all block devices, independent of the block
4114 # @driver: block driver name
4115 # @id: #optional id by which the new block device can be referred to.
4116 # This is a required option on the top level of blockdev-add, and
4117 # currently not allowed on any other level.
4118 # @node-name: #optional the name of a block driver state node (Since 2.0)
4119 # @discard: #optional discard-related options (default: ignore)
4120 # @cache: #optional cache-related options
4121 # @aio: #optional AIO backend (default: threads)
4122 # @rerror: #optional how to handle read errors on the device
4124 # @werror: #optional how to handle write errors on the device
4126 # @read-only: #optional whether the block device should be read-only
4131 { 'type': 'BlockdevOptionsBase',
4132 'data': { 'driver': 'str',
4134 '*node-name': 'str',
4135 '*discard': 'BlockdevDiscardOptions',
4136 '*cache': 'BlockdevCacheOptions',
4137 '*aio': 'BlockdevAioOptions',
4138 '*rerror': 'BlockdevOnError',
4139 '*werror': 'BlockdevOnError',
4140 '*read-only': 'bool' } }
4143 # @BlockdevOptionsFile
4145 # Driver specific block device options for the file backend and similar
4148 # @filename: path to the image file
4152 { 'type': 'BlockdevOptionsFile',
4153 'data': { 'filename': 'str' } }
4156 # @BlockdevOptionsVVFAT
4158 # Driver specific block device options for the vvfat protocol.
4160 # @dir: directory to be exported as FAT image
4161 # @fat-type: #optional FAT type: 12, 16 or 32
4162 # @floppy: #optional whether to export a floppy image (true) or
4163 # partitioned hard disk (false; default)
4164 # @rw: #optional whether to allow write operations (default: false)
4168 { 'type': 'BlockdevOptionsVVFAT',
4169 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4173 # @BlockdevOptionsGenericFormat
4175 # Driver specific block device options for image format that have no option
4176 # besides their data source.
4178 # @file: reference to or definition of the data source block device
4182 { 'type': 'BlockdevOptionsGenericFormat',
4183 'data': { 'file': 'BlockdevRef' } }
4186 # @BlockdevOptionsGenericCOWFormat
4188 # Driver specific block device options for image format that have no option
4189 # besides their data source and an optional backing file.
4191 # @backing: #optional reference to or definition of the backing file block
4192 # device (if missing, taken from the image file content). It is
4193 # allowed to pass an empty string here in order to disable the
4194 # default backing file.
4198 { 'type': 'BlockdevOptionsGenericCOWFormat',
4199 'base': 'BlockdevOptionsGenericFormat',
4200 'data': { '*backing': 'BlockdevRef' } }
4203 # @BlockdevOptionsQcow2
4205 # Driver specific block device options for qcow2.
4207 # @lazy-refcounts: #optional whether to enable the lazy refcounts
4208 # feature (default is taken from the image file)
4210 # @pass-discard-request: #optional whether discard requests to the qcow2
4211 # device should be forwarded to the data source
4213 # @pass-discard-snapshot: #optional whether discard requests for the data source
4214 # should be issued when a snapshot operation (e.g.
4215 # deleting a snapshot) frees clusters in the qcow2 file
4217 # @pass-discard-other: #optional whether discard requests for the data source
4218 # should be issued on other occasions where a cluster
4223 { 'type': 'BlockdevOptionsQcow2',
4224 'base': 'BlockdevOptionsGenericCOWFormat',
4225 'data': { '*lazy-refcounts': 'bool',
4226 '*pass-discard-request': 'bool',
4227 '*pass-discard-snapshot': 'bool',
4228 '*pass-discard-other': 'bool' } }
4233 # Trigger events supported by blkdebug.
4235 { 'enum': 'BlkdebugEvent',
4236 'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
4237 'l1_grow.activate_table', 'l2_load', 'l2_update',
4238 'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
4239 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
4240 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
4241 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
4242 'refblock_load', 'refblock_update', 'refblock_update_part',
4243 'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
4244 'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
4245 'refblock_alloc.switch_table', 'cluster_alloc',
4246 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
4250 # @BlkdebugInjectErrorOptions
4252 # Describes a single error injection for blkdebug.
4254 # @event: trigger event
4256 # @state: #optional the state identifier blkdebug needs to be in to
4257 # actually trigger the event; defaults to "any"
4259 # @errno: #optional error identifier (errno) to be returned; defaults to
4262 # @sector: #optional specifies the sector index which has to be affected
4263 # in order to actually trigger the event; defaults to "any
4266 # @once: #optional disables further events after this one has been
4267 # triggered; defaults to false
4269 # @immediately: #optional fail immediately; defaults to false
4273 { 'type': 'BlkdebugInjectErrorOptions',
4274 'data': { 'event': 'BlkdebugEvent',
4279 '*immediately': 'bool' } }
4282 # @BlkdebugSetStateOptions
4284 # Describes a single state-change event for blkdebug.
4286 # @event: trigger event
4288 # @state: #optional the current state identifier blkdebug needs to be in;
4291 # @new_state: the state identifier blkdebug is supposed to assume if
4292 # this event is triggered
4296 { 'type': 'BlkdebugSetStateOptions',
4297 'data': { 'event': 'BlkdebugEvent',
4299 'new_state': 'int' } }
4302 # @BlockdevOptionsBlkdebug
4304 # Driver specific block device options for blkdebug.
4306 # @image: underlying raw block device (or image file)
4308 # @config: #optional filename of the configuration file
4310 # @inject-error: #optional array of error injection descriptions
4312 # @set-state: #optional array of state-change descriptions
4316 { 'type': 'BlockdevOptionsBlkdebug',
4317 'data': { 'image': 'BlockdevRef',
4319 '*inject-error': ['BlkdebugInjectErrorOptions'],
4320 '*set-state': ['BlkdebugSetStateOptions'] } }
4323 # @BlockdevOptionsBlkverify
4325 # Driver specific block device options for blkverify.
4327 # @test: block device to be tested
4329 # @raw: raw image used for verification
4333 { 'type': 'BlockdevOptionsBlkverify',
4334 'data': { 'test': 'BlockdevRef',
4335 'raw': 'BlockdevRef' } }
4340 # Options for creating a block device.
4344 { 'union': 'BlockdevOptions',
4345 'base': 'BlockdevOptionsBase',
4346 'discriminator': 'driver',
4348 'file': 'BlockdevOptionsFile',
4349 'http': 'BlockdevOptionsFile',
4350 'https': 'BlockdevOptionsFile',
4351 'ftp': 'BlockdevOptionsFile',
4352 'ftps': 'BlockdevOptionsFile',
4353 'tftp': 'BlockdevOptionsFile',
4354 # TODO gluster: Wait for structured options
4355 # TODO iscsi: Wait for structured options
4356 # TODO nbd: Should take InetSocketAddress for 'host'?
4357 # TODO rbd: Wait for structured options
4358 # TODO sheepdog: Wait for structured options
4359 # TODO ssh: Should take InetSocketAddress for 'host'?
4360 'vvfat': 'BlockdevOptionsVVFAT',
4361 'blkdebug': 'BlockdevOptionsBlkdebug',
4362 'blkverify': 'BlockdevOptionsBlkverify',
4363 'bochs': 'BlockdevOptionsGenericFormat',
4364 'cloop': 'BlockdevOptionsGenericFormat',
4365 'cow': 'BlockdevOptionsGenericCOWFormat',
4366 'dmg': 'BlockdevOptionsGenericFormat',
4367 'parallels': 'BlockdevOptionsGenericFormat',
4368 'qcow': 'BlockdevOptionsGenericCOWFormat',
4369 'qcow2': 'BlockdevOptionsQcow2',
4370 'qed': 'BlockdevOptionsGenericCOWFormat',
4371 'raw': 'BlockdevOptionsGenericFormat',
4372 'vdi': 'BlockdevOptionsGenericFormat',
4373 'vhdx': 'BlockdevOptionsGenericFormat',
4374 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4375 'vpc': 'BlockdevOptionsGenericFormat'
4381 # Reference to a block device.
4383 # @definition: defines a new block device inline
4384 # @reference: references the ID of an existing block device. An
4385 # empty string means that no block device should be
4390 { 'union': 'BlockdevRef',
4391 'discriminator': {},
4392 'data': { 'definition': 'BlockdevOptions',
4393 'reference': 'str' } }
4398 # Creates a new block device.
4400 # @options: block device options for the new device
4404 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }