vfio-pci: Add extra debugging
[qemu/ar7.git] / qapi-schema.json
blobf629a249debac70333ce84f0024764e8fc58ccd2
1 # -*- Mode: Python -*-
3 # QAPI Schema
5 ##
6 # @ErrorClass
8 # QEMU error classes
10 # @GenericError: this is used for errors that don't require a specific error
11 #                class. This should be the default case for most errors
13 # @CommandNotFound: the requested command has not been found
15 # @DeviceEncrypted: the requested operation can't be fulfilled because the
16 #                   selected device is encrypted
18 # @DeviceNotActive: a device has failed to be become active
20 # @DeviceNotFound: the requested device has not been found
22 # @KVMMissingCap: the requested operation can't be fulfilled because a
23 #                 required KVM capability is missing
25 # Since: 1.2
27 { 'enum': 'ErrorClass',
28   'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
29             'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
32 # @add_client
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"
46 #       protocol
48 # Returns: nothing on success.
50 # Since: 0.14.0
52 { 'command': 'add_client',
53   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
54             '*tls': 'bool' } }
57 # @NameInfo:
59 # Guest name information.
61 # @name: #optional The name of the guest
63 # Since 0.14.0
65 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
68 # @query-name:
70 # Return the name information of a guest.
72 # Returns: @NameInfo of the guest
74 # Since 0.14.0
76 { 'command': 'query-name', 'returns': 'NameInfo' }
79 # @VersionInfo:
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.
98 # Since: 0.14.0
100 { 'type': 'VersionInfo',
101   'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
102            'package': 'str'} }
105 # @query-version:
107 # Returns the current version of QEMU.
109 # Returns:  A @VersionInfo object describing the current version of QEMU.
111 # Since: 0.14.0
113 { 'command': 'query-version', 'returns': 'VersionInfo' }
116 # @KvmInfo:
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
124 # Since: 0.14.0
126 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
129 # @query-kvm:
131 # Returns information about KVM acceleration
133 # Returns: @KvmInfo
135 # Since: 0.14.0
137 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
140 # @RunState
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
152 # started.
154 # @internal-error: An internal error that prevents further guest execution
155 # has occurred
157 # @io-error: the last IOP has failed and the device is configured to pause
158 # on I/O errors
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 { 'enum': 'RunState',
179   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
180             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
181             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
184 # @SnapshotInfo
186 # @id: unique snapshot id
188 # @name: user chosen name
190 # @vm-state-size: size of the VM state
192 # @date-sec: UTC date of the snapshot in seconds
194 # @date-nsec: fractional part in nano seconds to be used with date-sec
196 # @vm-clock-sec: VM clock relative to boot in seconds
198 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
200 # Since: 1.3
204 { 'type': 'SnapshotInfo',
205   'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
206             'date-sec': 'int', 'date-nsec': 'int',
207             'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
210 # @ImageInfo:
212 # Information about a QEMU image file
214 # @filename: name of the image file
216 # @format: format of the image file
218 # @virtual-size: maximum capacity in bytes of the image
220 # @actual-size: #optional actual size on disk in bytes of the image
222 # @dirty-flag: #optional true if image is not cleanly closed
224 # @cluster-size: #optional size of a cluster in bytes
226 # @encrypted: #optional true if the image is encrypted
228 # @backing-filename: #optional name of the backing file
230 # @full-backing-filename: #optional full path of the backing file
232 # @backing-filename-format: #optional the format of the backing file
234 # @snapshots: #optional list of VM snapshots
236 # Since: 1.3
240 { 'type': 'ImageInfo',
241   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
242            '*actual-size': 'int', 'virtual-size': 'int',
243            '*cluster-size': 'int', '*encrypted': 'bool',
244            '*backing-filename': 'str', '*full-backing-filename': 'str',
245            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'] } }
248 # @ImageCheck:
250 # Information about a QEMU image file check
252 # @filename: name of the image file checked
254 # @format: format of the image file checked
256 # @check-errors: number of unexpected errors occurred during check
258 # @image-end-offset: #optional offset (in bytes) where the image ends, this
259 #                    field is present if the driver for the image format
260 #                    supports it
262 # @corruptions: #optional number of corruptions found during the check if any
264 # @leaks: #optional number of leaks found during the check if any
266 # @corruptions-fixed: #optional number of corruptions fixed during the check
267 #                     if any
269 # @leaks-fixed: #optional number of leaks fixed during the check if any
271 # @total-clusters: #optional total number of clusters, this field is present
272 #                  if the driver for the image format supports it
274 # @allocated-clusters: #optional total number of allocated clusters, this
275 #                      field is present if the driver for the image format
276 #                      supports it
278 # @fragmented-clusters: #optional total number of fragmented clusters, this
279 #                       field is present if the driver for the image format
280 #                       supports it
282 # @compressed-clusters: #optional total number of compressed clusters, this
283 #                       field is present if the driver for the image format
284 #                       supports it
286 # Since: 1.4
290 { 'type': 'ImageCheck',
291   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
292            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
293            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
294            '*total-clusters': 'int', '*allocated-clusters': 'int',
295            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
298 # @StatusInfo:
300 # Information about VCPU run state
302 # @running: true if all VCPUs are runnable, false if not runnable
304 # @singlestep: true if VCPUs are in single-step mode
306 # @status: the virtual machine @RunState
308 # Since:  0.14.0
310 # Notes: @singlestep is enabled through the GDB stub
312 { 'type': 'StatusInfo',
313   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
316 # @query-status:
318 # Query the run status of all VCPUs
320 # Returns: @StatusInfo reflecting all VCPUs
322 # Since:  0.14.0
324 { 'command': 'query-status', 'returns': 'StatusInfo' }
327 # @UuidInfo:
329 # Guest UUID information.
331 # @UUID: the UUID of the guest
333 # Since: 0.14.0
335 # Notes: If no UUID was specified for the guest, a null UUID is returned.
337 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
340 # @query-uuid:
342 # Query the guest UUID information.
344 # Returns: The @UuidInfo for the guest
346 # Since 0.14.0
348 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
351 # @ChardevInfo:
353 # Information about a character device.
355 # @label: the label of the character device
357 # @filename: the filename of the character device
359 # Notes: @filename is encoded using the QEMU command line character device
360 #        encoding.  See the QEMU man page for details.
362 # Since: 0.14.0
364 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
367 # @query-chardev:
369 # Returns information about current character devices.
371 # Returns: a list of @ChardevInfo
373 # Since: 0.14.0
375 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
378 # @DataFormat:
380 # An enumeration of data format.
382 # @utf8: Data is a UTF-8 string (RFC 3629)
384 # @base64: Data is Base64 encoded binary (RFC 3548)
386 # Since: 1.4
388 { 'enum': 'DataFormat'
389   'data': [ 'utf8', 'base64' ] }
392 # @ringbuf-write:
394 # Write to a ring buffer character device.
396 # @device: the ring buffer character device name
398 # @data: data to write
400 # @format: #optional data encoding (default 'utf8').
401 #          - base64: data must be base64 encoded text.  Its binary
402 #            decoding gets written.
403 #            Bug: invalid base64 is currently not rejected.
404 #            Whitespace *is* invalid.
405 #          - utf8: data's UTF-8 encoding is written
406 #          - data itself is always Unicode regardless of format, like
407 #            any other string.
409 # Returns: Nothing on success
411 # Since: 1.4
413 { 'command': 'ringbuf-write',
414   'data': {'device': 'str', 'data': 'str',
415            '*format': 'DataFormat'} }
418 # @ringbuf-read:
420 # Read from a ring buffer character device.
422 # @device: the ring buffer character device name
424 # @size: how many bytes to read at most
426 # @format: #optional data encoding (default 'utf8').
427 #          - base64: the data read is returned in base64 encoding.
428 #          - utf8: the data read is interpreted as UTF-8.
429 #            Bug: can screw up when the buffer contains invalid UTF-8
430 #            sequences, NUL characters, after the ring buffer lost
431 #            data, and when reading stops because the size limit is
432 #            reached.
433 #          - The return value is always Unicode regardless of format,
434 #            like any other string.
436 # Returns: data read from the device
438 # Since: 1.4
440 { 'command': 'ringbuf-read',
441   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
442   'returns': 'str' }
445 # @CommandInfo:
447 # Information about a QMP command
449 # @name: The command name
451 # Since: 0.14.0
453 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
456 # @query-commands:
458 # Return a list of supported QMP commands by this server
460 # Returns: A list of @CommandInfo for all supported commands
462 # Since: 0.14.0
464 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
467 # @EventInfo:
469 # Information about a QMP event
471 # @name: The event name
473 # Since: 1.2.0
475 { 'type': 'EventInfo', 'data': {'name': 'str'} }
478 # @query-events:
480 # Return a list of supported QMP events by this server
482 # Returns: A list of @EventInfo for all supported events
484 # Since: 1.2.0
486 { 'command': 'query-events', 'returns': ['EventInfo'] }
489 # @MigrationStats
491 # Detailed migration status.
493 # @transferred: amount of bytes already transferred to the target VM
495 # @remaining: amount of bytes remaining to be transferred to the target VM
497 # @total: total amount of bytes involved in the migration process
499 # @duplicate: number of duplicate (zero) pages (since 1.2)
501 # @skipped: number of skipped zero pages (since 1.5)
503 # @normal : number of normal pages (since 1.2)
505 # @normal-bytes: number of normal bytes sent (since 1.2)
507 # @dirty-pages-rate: number of pages dirtied by second by the
508 #        guest (since 1.3)
510 # Since: 0.14.0
512 { 'type': 'MigrationStats',
513   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
514            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
515            'normal-bytes': 'int', 'dirty-pages-rate' : 'int' } }
518 # @XBZRLECacheStats
520 # Detailed XBZRLE migration cache statistics
522 # @cache-size: XBZRLE cache size
524 # @bytes: amount of bytes already transferred to the target VM
526 # @pages: amount of pages transferred to the target VM
528 # @cache-miss: number of cache miss
530 # @overflow: number of overflows
532 # Since: 1.2
534 { 'type': 'XBZRLECacheStats',
535   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
536            'cache-miss': 'int', 'overflow': 'int' } }
539 # @MigrationInfo
541 # Information about current migration process.
543 # @status: #optional string describing the current migration status.
544 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
545 #          'cancelled'. If this field is not returned, no migration process
546 #          has been initiated
548 # @ram: #optional @MigrationStats containing detailed migration
549 #       status, only returned if status is 'active' or
550 #       'completed'. 'comppleted' (since 1.2)
552 # @disk: #optional @MigrationStats containing detailed disk migration
553 #        status, only returned if status is 'active' and it is a block
554 #        migration
556 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
557 #                migration statistics, only returned if XBZRLE feature is on and
558 #                status is 'active' or 'completed' (since 1.2)
560 # @total-time: #optional total amount of milliseconds since migration started.
561 #        If migration has ended, it returns the total migration
562 #        time. (since 1.2)
564 # @downtime: #optional only present when migration finishes correctly
565 #        total downtime in milliseconds for the guest.
566 #        (since 1.3)
568 # @expected-downtime: #optional only present while migration is active
569 #        expected downtime in milliseconds for the guest in last walk
570 #        of the dirty bitmap. (since 1.3)
572 # Since: 0.14.0
574 { 'type': 'MigrationInfo',
575   'data': {'*status': 'str', '*ram': 'MigrationStats',
576            '*disk': 'MigrationStats',
577            '*xbzrle-cache': 'XBZRLECacheStats',
578            '*total-time': 'int',
579            '*expected-downtime': 'int',
580            '*downtime': 'int'} }
583 # @query-migrate
585 # Returns information about current migration process.
587 # Returns: @MigrationInfo
589 # Since: 0.14.0
591 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
594 # @MigrationCapability
596 # Migration capabilities enumeration
598 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
599 #          This feature allows us to minimize migration traffic for certain work
600 #          loads, by sending compressed difference of the pages
602 # Since: 1.2
604 { 'enum': 'MigrationCapability',
605   'data': ['xbzrle'] }
608 # @MigrationCapabilityStatus
610 # Migration capability information
612 # @capability: capability enum
614 # @state: capability state bool
616 # Since: 1.2
618 { 'type': 'MigrationCapabilityStatus',
619   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
622 # @migrate-set-capabilities
624 # Enable/Disable the following migration capabilities (like xbzrle)
626 # @capabilities: json array of capability modifications to make
628 # Since: 1.2
630 { 'command': 'migrate-set-capabilities',
631   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
634 # @query-migrate-capabilities
636 # Returns information about the current migration capabilities status
638 # Returns: @MigrationCapabilitiesStatus
640 # Since: 1.2
642 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
645 # @MouseInfo:
647 # Information about a mouse device.
649 # @name: the name of the mouse device
651 # @index: the index of the mouse device
653 # @current: true if this device is currently receiving mouse events
655 # @absolute: true if this device supports absolute coordinates as input
657 # Since: 0.14.0
659 { 'type': 'MouseInfo',
660   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
661            'absolute': 'bool'} }
664 # @query-mice:
666 # Returns information about each active mouse device
668 # Returns: a list of @MouseInfo for each device
670 # Since: 0.14.0
672 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
675 # @CpuInfo:
677 # Information about a virtual CPU
679 # @CPU: the index of the virtual CPU
681 # @current: this only exists for backwards compatible and should be ignored
683 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
684 #          to a processor specific low power mode.
686 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
687 #                pointer.
688 #                If the target is Sparc, this is the PC component of the
689 #                instruction pointer.
691 # @nip: #optional If the target is PPC, the instruction pointer
693 # @npc: #optional If the target is Sparc, the NPC component of the instruction
694 #                 pointer
696 # @PC: #optional If the target is MIPS, the instruction pointer
698 # @thread_id: ID of the underlying host thread
700 # Since: 0.14.0
702 # Notes: @halted is a transient state that changes frequently.  By the time the
703 #        data is sent to the client, the guest may no longer be halted.
705 { 'type': 'CpuInfo',
706   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
707            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
710 # @query-cpus:
712 # Returns a list of information about each virtual CPU.
714 # Returns: a list of @CpuInfo for each virtual CPU
716 # Since: 0.14.0
718 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
721 # @BlockDeviceInfo:
723 # Information about the backing device for a block device.
725 # @file: the filename of the backing device
727 # @ro: true if the backing device was open read-only
729 # @drv: the name of the block format used to open the backing device. As of
730 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
731 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
732 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
733 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
735 # @backing_file: #optional the name of the backing file (for copy-on-write)
737 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
739 # @encrypted: true if the backing device is encrypted
741 # @encryption_key_missing: true if the backing device is encrypted but an
742 #                          valid encryption key is missing
744 # @bps: total throughput limit in bytes per second is specified
746 # @bps_rd: read throughput limit in bytes per second is specified
748 # @bps_wr: write throughput limit in bytes per second is specified
750 # @iops: total I/O operations per second is specified
752 # @iops_rd: read I/O operations per second is specified
754 # @iops_wr: write I/O operations per second is specified
756 # Since: 0.14.0
758 # Notes: This interface is only found in @BlockInfo.
760 { 'type': 'BlockDeviceInfo',
761   'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
762             '*backing_file': 'str', 'backing_file_depth': 'int',
763             'encrypted': 'bool', 'encryption_key_missing': 'bool',
764             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
765             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
768 # @BlockDeviceIoStatus:
770 # An enumeration of block device I/O status.
772 # @ok: The last I/O operation has succeeded
774 # @failed: The last I/O operation has failed
776 # @nospace: The last I/O operation has failed due to a no-space condition
778 # Since: 1.0
780 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
783 # @BlockDirtyInfo:
785 # Block dirty bitmap information.
787 # @count: number of dirty bytes according to the dirty bitmap
789 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
791 # Since: 1.3
793 { 'type': 'BlockDirtyInfo',
794   'data': {'count': 'int', 'granularity': 'int'} }
797 # @BlockInfo:
799 # Block device information.  This structure describes a virtual device and
800 # the backing device associated with it.
802 # @device: The device name associated with the virtual device.
804 # @type: This field is returned only for compatibility reasons, it should
805 #        not be used (always returns 'unknown')
807 # @removable: True if the device supports removable media.
809 # @locked: True if the guest has locked this device from having its media
810 #          removed
812 # @tray_open: #optional True if the device has a tray and it is open
813 #             (only present if removable is true)
815 # @dirty: #optional dirty bitmap information (only present if the dirty
816 #         bitmap is enabled)
818 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
819 #             supports it and the VM is configured to stop on errors
821 # @inserted: #optional @BlockDeviceInfo describing the device if media is
822 #            present
824 # Since:  0.14.0
826 { 'type': 'BlockInfo',
827   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
828            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
829            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
830            '*dirty': 'BlockDirtyInfo' } }
833 # @query-block:
835 # Get a list of BlockInfo for all virtual block devices.
837 # Returns: a list of @BlockInfo describing each virtual block device
839 # Since: 0.14.0
841 { 'command': 'query-block', 'returns': ['BlockInfo'] }
844 # @BlockDeviceStats:
846 # Statistics of a virtual block device or a block backing device.
848 # @rd_bytes:      The number of bytes read by the device.
850 # @wr_bytes:      The number of bytes written by the device.
852 # @rd_operations: The number of read operations performed by the device.
854 # @wr_operations: The number of write operations performed by the device.
856 # @flush_operations: The number of cache flush operations performed by the
857 #                    device (since 0.15.0)
859 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
860 #                       (since 0.15.0).
862 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
864 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
866 # @wr_highest_offset: The offset after the greatest byte written to the
867 #                     device.  The intended use of this information is for
868 #                     growable sparse files (like qcow2) that are used on top
869 #                     of a physical device.
871 # Since: 0.14.0
873 { 'type': 'BlockDeviceStats',
874   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
875            'wr_operations': 'int', 'flush_operations': 'int',
876            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
877            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
880 # @BlockStats:
882 # Statistics of a virtual block device or a block backing device.
884 # @device: #optional If the stats are for a virtual block device, the name
885 #          corresponding to the virtual block device.
887 # @stats:  A @BlockDeviceStats for the device.
889 # @parent: #optional This may point to the backing block device if this is a
890 #          a virtual block device.  If it's a backing block, this will point
891 #          to the backing file is one is present.
893 # Since: 0.14.0
895 { 'type': 'BlockStats',
896   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
897            '*parent': 'BlockStats'} }
900 # @query-blockstats:
902 # Query the @BlockStats for all virtual block devices.
904 # Returns: A list of @BlockStats for each virtual block devices.
906 # Since: 0.14.0
908 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
911 # @VncClientInfo:
913 # Information about a connected VNC client.
915 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
916 #        when possible.
918 # @family: 'ipv6' if the client is connected via IPv6 and TCP
919 #          'ipv4' if the client is connected via IPv4 and TCP
920 #          'unix' if the client is connected via a unix domain socket
921 #          'unknown' otherwise
923 # @service: The service name of the client's port.  This may depends on the
924 #           host system's service database so symbolic names should not be
925 #           relied on.
927 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
928 #              Name of the client.
930 # @sasl_username: #optional If SASL authentication is in use, the SASL username
931 #                 used for authentication.
933 # Since: 0.14.0
935 { 'type': 'VncClientInfo',
936   'data': {'host': 'str', 'family': 'str', 'service': 'str',
937            '*x509_dname': 'str', '*sasl_username': 'str'} }
940 # @VncInfo:
942 # Information about the VNC session.
944 # @enabled: true if the VNC server is enabled, false otherwise
946 # @host: #optional The hostname the VNC server is bound to.  This depends on
947 #        the name resolution on the host and may be an IP address.
949 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
950 #                    'ipv4' if the host is listening for IPv4 connections
951 #                    'unix' if the host is listening on a unix domain socket
952 #                    'unknown' otherwise
954 # @service: #optional The service name of the server's port.  This may depends
955 #           on the host system's service database so symbolic names should not
956 #           be relied on.
958 # @auth: #optional the current authentication type used by the server
959 #        'none' if no authentication is being used
960 #        'vnc' if VNC authentication is being used
961 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
962 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
963 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
964 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
965 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
966 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
967 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
968 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
969 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
971 # @clients: a list of @VncClientInfo of all currently connected clients
973 # Since: 0.14.0
975 { 'type': 'VncInfo',
976   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
977            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
980 # @query-vnc:
982 # Returns information about the current VNC server
984 # Returns: @VncInfo
986 # Since: 0.14.0
988 { 'command': 'query-vnc', 'returns': 'VncInfo' }
991 # @SpiceChannel
993 # Information about a SPICE client channel.
995 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
996 #        when possible.
998 # @family: 'ipv6' if the client is connected via IPv6 and TCP
999 #          'ipv4' if the client is connected via IPv4 and TCP
1000 #          'unix' if the client is connected via a unix domain socket
1001 #          'unknown' otherwise
1003 # @port: The client's port number.
1005 # @connection-id: SPICE connection id number.  All channels with the same id
1006 #                 belong to the same SPICE session.
1008 # @connection-type: SPICE channel type number.  "1" is the main control
1009 #                   channel, filter for this one if you want to track spice
1010 #                   sessions only
1012 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1013 #              multiple channels of the same type exist, such as multiple
1014 #              display channels in a multihead setup
1016 # @tls: true if the channel is encrypted, false otherwise.
1018 # Since: 0.14.0
1020 { 'type': 'SpiceChannel',
1021   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1022            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1023            'tls': 'bool'} }
1026 # @SpiceQueryMouseMode
1028 # An enumeration of Spice mouse states.
1030 # @client: Mouse cursor position is determined by the client.
1032 # @server: Mouse cursor position is determined by the server.
1034 # @unknown: No information is available about mouse mode used by
1035 #           the spice server.
1037 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1039 # Since: 1.1
1041 { 'enum': 'SpiceQueryMouseMode',
1042   'data': [ 'client', 'server', 'unknown' ] }
1045 # @SpiceInfo
1047 # Information about the SPICE session.
1049 # @enabled: true if the SPICE server is enabled, false otherwise
1051 # @migrated: true if the last guest migration completed and spice
1052 #            migration had completed as well. false otherwise.
1054 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1055 #        the name resolution on the host and may be an IP address.
1057 # @port: #optional The SPICE server's port number.
1059 # @compiled-version: #optional SPICE server version.
1061 # @tls-port: #optional The SPICE server's TLS port number.
1063 # @auth: #optional the current authentication type used by the server
1064 #        'none'  if no authentication is being used
1065 #        'spice' uses SASL or direct TLS authentication, depending on command
1066 #                line options
1068 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1069 #              be determined by the client or the server, or unknown if spice
1070 #              server doesn't provide this information.
1072 #              Since: 1.1
1074 # @channels: a list of @SpiceChannel for each active spice channel
1076 # Since: 0.14.0
1078 { 'type': 'SpiceInfo',
1079   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1080            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1081            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1084 # @query-spice
1086 # Returns information about the current SPICE server
1088 # Returns: @SpiceInfo
1090 # Since: 0.14.0
1092 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1095 # @BalloonInfo:
1097 # Information about the guest balloon device.
1099 # @actual: the number of bytes the balloon currently contains
1101 # Since: 0.14.0
1104 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1107 # @query-balloon:
1109 # Return information about the balloon device.
1111 # Returns: @BalloonInfo on success
1112 #          If the balloon driver is enabled but not functional because the KVM
1113 #          kernel module cannot support it, KvmMissingCap
1114 #          If no balloon device is present, DeviceNotActive
1116 # Since: 0.14.0
1118 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1121 # @PciMemoryRange:
1123 # A PCI device memory region
1125 # @base: the starting address (guest physical)
1127 # @limit: the ending address (guest physical)
1129 # Since: 0.14.0
1131 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1134 # @PciMemoryRegion
1136 # Information about a PCI device I/O region.
1138 # @bar: the index of the Base Address Register for this region
1140 # @type: 'io' if the region is a PIO region
1141 #        'memory' if the region is a MMIO region
1143 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1145 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1147 # Since: 0.14.0
1149 { 'type': 'PciMemoryRegion',
1150   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1151            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1154 # @PciBridgeInfo:
1156 # Information about a PCI Bridge device
1158 # @bus.number: primary bus interface number.  This should be the number of the
1159 #              bus the device resides on.
1161 # @bus.secondary: secondary bus interface number.  This is the number of the
1162 #                 main bus for the bridge
1164 # @bus.subordinate: This is the highest number bus that resides below the
1165 #                   bridge.
1167 # @bus.io_range: The PIO range for all devices on this bridge
1169 # @bus.memory_range: The MMIO range for all devices on this bridge
1171 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1172 #                          this bridge
1174 # @devices: a list of @PciDeviceInfo for each device on this bridge
1176 # Since: 0.14.0
1178 { 'type': 'PciBridgeInfo',
1179   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1180                     'io_range': 'PciMemoryRange',
1181                     'memory_range': 'PciMemoryRange',
1182                     'prefetchable_range': 'PciMemoryRange' },
1183            '*devices': ['PciDeviceInfo']} }
1186 # @PciDeviceInfo:
1188 # Information about a PCI device
1190 # @bus: the bus number of the device
1192 # @slot: the slot the device is located in
1194 # @function: the function of the slot used by the device
1196 # @class_info.desc: #optional a string description of the device's class
1198 # @class_info.class: the class code of the device
1200 # @id.device: the PCI device id
1202 # @id.vendor: the PCI vendor id
1204 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1206 # @qdev_id: the device name of the PCI device
1208 # @pci_bridge: if the device is a PCI bridge, the bridge information
1210 # @regions: a list of the PCI I/O regions associated with the device
1212 # Notes: the contents of @class_info.desc are not stable and should only be
1213 #        treated as informational.
1215 # Since: 0.14.0
1217 { 'type': 'PciDeviceInfo',
1218   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1219            'class_info': {'*desc': 'str', 'class': 'int'},
1220            'id': {'device': 'int', 'vendor': 'int'},
1221            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1222            'regions': ['PciMemoryRegion']} }
1225 # @PciInfo:
1227 # Information about a PCI bus
1229 # @bus: the bus index
1231 # @devices: a list of devices on this bus
1233 # Since: 0.14.0
1235 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1238 # @query-pci:
1240 # Return information about the PCI bus topology of the guest.
1242 # Returns: a list of @PciInfo for each PCI bus
1244 # Since: 0.14.0
1246 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1249 # @BlockdevOnError:
1251 # An enumeration of possible behaviors for errors on I/O operations.
1252 # The exact meaning depends on whether the I/O was initiated by a guest
1253 # or by a block job
1255 # @report: for guest operations, report the error to the guest;
1256 #          for jobs, cancel the job
1258 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1259 #          or BLOCK_JOB_ERROR)
1261 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1263 # @stop: for guest operations, stop the virtual machine;
1264 #        for jobs, pause the job
1266 # Since: 1.3
1268 { 'enum': 'BlockdevOnError',
1269   'data': ['report', 'ignore', 'enospc', 'stop'] }
1272 # @MirrorSyncMode:
1274 # An enumeration of possible behaviors for the initial synchronization
1275 # phase of storage mirroring.
1277 # @top: copies data in the topmost image to the destination
1279 # @full: copies data from all images to the destination
1281 # @none: only copy data written from now on
1283 # Since: 1.3
1285 { 'enum': 'MirrorSyncMode',
1286   'data': ['top', 'full', 'none'] }
1289 # @BlockJobInfo:
1291 # Information about a long-running block device operation.
1293 # @type: the job type ('stream' for image streaming)
1295 # @device: the block device name
1297 # @len: the maximum progress value
1299 # @busy: false if the job is known to be in a quiescent state, with
1300 #        no pending I/O.  Since 1.3.
1302 # @paused: whether the job is paused or, if @busy is true, will
1303 #          pause itself as soon as possible.  Since 1.3.
1305 # @offset: the current progress value
1307 # @speed: the rate limit, bytes per second
1309 # @io-status: the status of the job (since 1.3)
1311 # Since: 1.1
1313 { 'type': 'BlockJobInfo',
1314   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1315            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1316            'io-status': 'BlockDeviceIoStatus'} }
1319 # @query-block-jobs:
1321 # Return information about long-running block device operations.
1323 # Returns: a list of @BlockJobInfo for each active block job
1325 # Since: 1.1
1327 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1330 # @quit:
1332 # This command will cause the QEMU process to exit gracefully.  While every
1333 # attempt is made to send the QMP response before terminating, this is not
1334 # guaranteed.  When using this interface, a premature EOF would not be
1335 # unexpected.
1337 # Since: 0.14.0
1339 { 'command': 'quit' }
1342 # @stop:
1344 # Stop all guest VCPU execution.
1346 # Since:  0.14.0
1348 # Notes:  This function will succeed even if the guest is already in the stopped
1349 #         state.  In "inmigrate" state, it will ensure that the guest
1350 #         remains paused once migration finishes, as if the -S option was
1351 #         passed on the command line.
1353 { 'command': 'stop' }
1356 # @system_reset:
1358 # Performs a hard reset of a guest.
1360 # Since: 0.14.0
1362 { 'command': 'system_reset' }
1365 # @system_powerdown:
1367 # Requests that a guest perform a powerdown operation.
1369 # Since: 0.14.0
1371 # Notes: A guest may or may not respond to this command.  This command
1372 #        returning does not indicate that a guest has accepted the request or
1373 #        that it has shut down.  Many guests will respond to this command by
1374 #        prompting the user in some way.
1376 { 'command': 'system_powerdown' }
1379 # @cpu:
1381 # This command is a nop that is only provided for the purposes of compatibility.
1383 # Since: 0.14.0
1385 # Notes: Do not use this command.
1387 { 'command': 'cpu', 'data': {'index': 'int'} }
1390 # @memsave:
1392 # Save a portion of guest memory to a file.
1394 # @val: the virtual address of the guest to start from
1396 # @size: the size of memory region to save
1398 # @filename: the file to save the memory to as binary data
1400 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1401 #                       virtual address (defaults to CPU 0)
1403 # Returns: Nothing on success
1405 # Since: 0.14.0
1407 # Notes: Errors were not reliably returned until 1.1
1409 { 'command': 'memsave',
1410   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1413 # @pmemsave:
1415 # Save a portion of guest physical memory to a file.
1417 # @val: the physical address of the guest to start from
1419 # @size: the size of memory region to save
1421 # @filename: the file to save the memory to as binary data
1423 # Returns: Nothing on success
1425 # Since: 0.14.0
1427 # Notes: Errors were not reliably returned until 1.1
1429 { 'command': 'pmemsave',
1430   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1433 # @cont:
1435 # Resume guest VCPU execution.
1437 # Since:  0.14.0
1439 # Returns:  If successful, nothing
1440 #           If QEMU was started with an encrypted block device and a key has
1441 #              not yet been set, DeviceEncrypted.
1443 # Notes:  This command will succeed if the guest is currently running.  It
1444 #         will also succeed if the guest is in the "inmigrate" state; in
1445 #         this case, the effect of the command is to make sure the guest
1446 #         starts once migration finishes, removing the effect of the -S
1447 #         command line option if it was passed.
1449 { 'command': 'cont' }
1452 # @system_wakeup:
1454 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1456 # Since:  1.1
1458 # Returns:  nothing.
1460 { 'command': 'system_wakeup' }
1463 # @inject-nmi:
1465 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1467 # Returns:  If successful, nothing
1469 # Since:  0.14.0
1471 # Notes: Only x86 Virtual Machines support this command.
1473 { 'command': 'inject-nmi' }
1476 # @set_link:
1478 # Sets the link status of a virtual network adapter.
1480 # @name: the device name of the virtual network adapter
1482 # @up: true to set the link status to be up
1484 # Returns: Nothing on success
1485 #          If @name is not a valid network device, DeviceNotFound
1487 # Since: 0.14.0
1489 # Notes: Not all network adapters support setting link status.  This command
1490 #        will succeed even if the network adapter does not support link status
1491 #        notification.
1493 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1496 # @block_passwd:
1498 # This command sets the password of a block device that has not been open
1499 # with a password and requires one.
1501 # The two cases where this can happen are a block device is created through
1502 # QEMU's initial command line or a block device is changed through the legacy
1503 # @change interface.
1505 # In the event that the block device is created through the initial command
1506 # line, the VM will start in the stopped state regardless of whether '-S' is
1507 # used.  The intention is for a management tool to query the block devices to
1508 # determine which ones are encrypted, set the passwords with this command, and
1509 # then start the guest with the @cont command.
1511 # @device:   the name of the device to set the password on
1513 # @password: the password to use for the device
1515 # Returns: nothing on success
1516 #          If @device is not a valid block device, DeviceNotFound
1517 #          If @device is not encrypted, DeviceNotEncrypted
1519 # Notes:  Not all block formats support encryption and some that do are not
1520 #         able to validate that a password is correct.  Disk corruption may
1521 #         occur if an invalid password is specified.
1523 # Since: 0.14.0
1525 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1528 # @balloon:
1530 # Request the balloon driver to change its balloon size.
1532 # @value: the target size of the balloon in bytes
1534 # Returns: Nothing on success
1535 #          If the balloon driver is enabled but not functional because the KVM
1536 #            kernel module cannot support it, KvmMissingCap
1537 #          If no balloon device is present, DeviceNotActive
1539 # Notes: This command just issues a request to the guest.  When it returns,
1540 #        the balloon size may not have changed.  A guest can change the balloon
1541 #        size independent of this command.
1543 # Since: 0.14.0
1545 { 'command': 'balloon', 'data': {'value': 'int'} }
1548 # @block_resize
1550 # Resize a block image while a guest is running.
1552 # @device:  the name of the device to get the image resized
1554 # @size:  new image size in bytes
1556 # Returns: nothing on success
1557 #          If @device is not a valid block device, DeviceNotFound
1559 # Since: 0.14.0
1561 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1564 # @NewImageMode
1566 # An enumeration that tells QEMU how to set the backing file path in
1567 # a new image file.
1569 # @existing: QEMU should look for an existing image file.
1571 # @absolute-paths: QEMU should create a new image with absolute paths
1572 # for the backing file.
1574 # Since: 1.1
1576 { 'enum': 'NewImageMode'
1577   'data': [ 'existing', 'absolute-paths' ] }
1580 # @BlockdevSnapshot
1582 # @device:  the name of the device to generate the snapshot from.
1584 # @snapshot-file: the target of the new image. A new file will be created.
1586 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1588 # @mode: #optional whether and how QEMU should create a new image, default is
1589 #        'absolute-paths'.
1591 { 'type': 'BlockdevSnapshot',
1592   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1593             '*mode': 'NewImageMode' } }
1596 # @BlockdevAction
1598 # A discriminated record of operations that can be performed with
1599 # @transaction.
1601 { 'union': 'BlockdevAction',
1602   'data': {
1603        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1604    } }
1607 # @transaction
1609 # Atomically operate on a group of one or more block devices.  If
1610 # any operation fails, then the entire set of actions will be
1611 # abandoned and the appropriate error returned.  The only operation
1612 # supported is currently blockdev-snapshot-sync.
1614 #  List of:
1615 #  @BlockdevAction: information needed for the device snapshot
1617 # Returns: nothing on success
1618 #          If @device is not a valid block device, DeviceNotFound
1620 # Note: The transaction aborts on the first failure.  Therefore, there will
1621 # be only one device or snapshot file returned in an error condition, and
1622 # subsequent actions will not have been attempted.
1624 # Since 1.1
1626 { 'command': 'transaction',
1627   'data': { 'actions': [ 'BlockdevAction' ] } }
1630 # @blockdev-snapshot-sync
1632 # Generates a synchronous snapshot of a block device.
1634 # @device:  the name of the device to generate the snapshot from.
1636 # @snapshot-file: the target of the new image. If the file exists, or if it
1637 #                 is a device, the snapshot will be created in the existing
1638 #                 file/device. If does not exist, a new file will be created.
1640 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1642 # @mode: #optional whether and how QEMU should create a new image, default is
1643 #        'absolute-paths'.
1645 # Returns: nothing on success
1646 #          If @device is not a valid block device, DeviceNotFound
1648 # Since 0.14.0
1650 { 'command': 'blockdev-snapshot-sync',
1651   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1652             '*mode': 'NewImageMode'} }
1655 # @human-monitor-command:
1657 # Execute a command on the human monitor and return the output.
1659 # @command-line: the command to execute in the human monitor
1661 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1663 # Returns: the output of the command as a string
1665 # Since: 0.14.0
1667 # Notes: This command only exists as a stop-gap.  It's use is highly
1668 #        discouraged.  The semantics of this command are not guaranteed.
1670 #        Known limitations:
1672 #        o This command is stateless, this means that commands that depend
1673 #          on state information (such as getfd) might not work
1675 #       o Commands that prompt the user for data (eg. 'cont' when the block
1676 #         device is encrypted) don't currently work
1678 { 'command': 'human-monitor-command',
1679   'data': {'command-line': 'str', '*cpu-index': 'int'},
1680   'returns': 'str' }
1683 # @block-commit
1685 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1686 # writes data between 'top' and 'base' into 'base'.
1688 # @device:  the name of the device
1690 # @base:   #optional The file name of the backing image to write data into.
1691 #                    If not specified, this is the deepest backing image
1693 # @top:              The file name of the backing image within the image chain,
1694 #                    which contains the topmost data to be committed down.
1695 #                    Note, the active layer as 'top' is currently unsupported.
1697 #                    If top == base, that is an error.
1700 # @speed:  #optional the maximum speed, in bytes per second
1702 # Returns: Nothing on success
1703 #          If commit or stream is already active on this device, DeviceInUse
1704 #          If @device does not exist, DeviceNotFound
1705 #          If image commit is not supported by this device, NotSupported
1706 #          If @base or @top is invalid, a generic error is returned
1707 #          If @top is the active layer, or omitted, a generic error is returned
1708 #          If @speed is invalid, InvalidParameter
1710 # Since: 1.3
1713 { 'command': 'block-commit',
1714   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1715             '*speed': 'int' } }
1718 # @drive-mirror
1720 # Start mirroring a block device's writes to a new destination.
1722 # @device:  the name of the device whose writes should be mirrored.
1724 # @target: the target of the new image. If the file exists, or if it
1725 #          is a device, the existing file/device will be used as the new
1726 #          destination.  If it does not exist, a new file will be created.
1728 # @format: #optional the format of the new destination, default is to
1729 #          probe if @mode is 'existing', else the format of the source
1731 # @mode: #optional whether and how QEMU should create a new image, default is
1732 #        'absolute-paths'.
1734 # @speed:  #optional the maximum speed, in bytes per second
1736 # @sync: what parts of the disk image should be copied to the destination
1737 #        (all the disk, only the sectors allocated in the topmost image, or
1738 #        only new I/O).
1740 # @granularity: #optional granularity of the dirty bitmap, default is 64K
1741 #               if the image format doesn't have clusters, 4K if the clusters
1742 #               are smaller than that, else the cluster size.  Must be a
1743 #               power of 2 between 512 and 64M (since 1.4).
1745 # @buf-size: #optional maximum amount of data in flight from source to
1746 #            target (since 1.4).
1748 # @on-source-error: #optional the action to take on an error on the source,
1749 #                   default 'report'.  'stop' and 'enospc' can only be used
1750 #                   if the block device supports io-status (see BlockInfo).
1752 # @on-target-error: #optional the action to take on an error on the target,
1753 #                   default 'report' (no limitations, since this applies to
1754 #                   a different block device than @device).
1756 # Returns: nothing on success
1757 #          If @device is not a valid block device, DeviceNotFound
1759 # Since 1.3
1761 { 'command': 'drive-mirror',
1762   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1763             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1764             '*speed': 'int', '*granularity': 'uint32',
1765             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1766             '*on-target-error': 'BlockdevOnError' } }
1769 # @migrate_cancel
1771 # Cancel the current executing migration process.
1773 # Returns: nothing on success
1775 # Notes: This command succeeds even if there is no migration process running.
1777 # Since: 0.14.0
1779 { 'command': 'migrate_cancel' }
1782 # @migrate_set_downtime
1784 # Set maximum tolerated downtime for migration.
1786 # @value: maximum downtime in seconds
1788 # Returns: nothing on success
1790 # Since: 0.14.0
1792 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1795 # @migrate_set_speed
1797 # Set maximum speed for migration.
1799 # @value: maximum speed in bytes.
1801 # Returns: nothing on success
1803 # Notes: A value lesser than zero will be automatically round up to zero.
1805 # Since: 0.14.0
1807 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1810 # @migrate-set-cache-size
1812 # Set XBZRLE cache size
1814 # @value: cache size in bytes
1816 # The size will be rounded down to the nearest power of 2.
1817 # The cache size can be modified before and during ongoing migration
1819 # Returns: nothing on success
1821 # Since: 1.2
1823 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1826 # @query-migrate-cache-size
1828 # query XBZRLE cache size
1830 # Returns: XBZRLE cache size in bytes
1832 # Since: 1.2
1834 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1837 ## @query-cpu-max
1839 ## query maximum number of CPUs supported by machine
1841 ## Returns: number of CPUs
1843 ## Since: 1.5
1845 { 'command': 'query-cpu-max', 'returns': 'int' }
1848 # @ObjectPropertyInfo:
1850 # @name: the name of the property
1852 # @type: the type of the property.  This will typically come in one of four
1853 #        forms:
1855 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1856 #           These types are mapped to the appropriate JSON type.
1858 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
1859 #           legacy qdev typename.  These types are always treated as strings.
1861 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
1862 #           device type name.  Child properties create the composition tree.
1864 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
1865 #           device type name.  Link properties form the device model graph.
1867 # Since: 1.2
1869 { 'type': 'ObjectPropertyInfo',
1870   'data': { 'name': 'str', 'type': 'str' } }
1873 # @qom-list:
1875 # This command will list any properties of a object given a path in the object
1876 # model.
1878 # @path: the path within the object model.  See @qom-get for a description of
1879 #        this parameter.
1881 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1882 #          object.
1884 # Since: 1.2
1886 { 'command': 'qom-list',
1887   'data': { 'path': 'str' },
1888   'returns': [ 'ObjectPropertyInfo' ] }
1891 # @qom-get:
1893 # This command will get a property from a object model path and return the
1894 # value.
1896 # @path: The path within the object model.  There are two forms of supported
1897 #        paths--absolute and partial paths.
1899 #        Absolute paths are derived from the root object and can follow child<>
1900 #        or link<> properties.  Since they can follow link<> properties, they
1901 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1902 #        and are prefixed  with a leading slash.
1904 #        Partial paths look like relative filenames.  They do not begin
1905 #        with a prefix.  The matching rules for partial paths are subtle but
1906 #        designed to make specifying objects easy.  At each level of the
1907 #        composition tree, the partial path is matched as an absolute path.
1908 #        The first match is not returned.  At least two matches are searched
1909 #        for.  A successful result is only returned if only one match is
1910 #        found.  If more than one match is found, a flag is return to
1911 #        indicate that the match was ambiguous.
1913 # @property: The property name to read
1915 # Returns: The property value.  The type depends on the property type.  legacy<>
1916 #          properties are returned as #str.  child<> and link<> properties are
1917 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
1918 #          are returned as #int.
1920 # Since: 1.2
1922 { 'command': 'qom-get',
1923   'data': { 'path': 'str', 'property': 'str' },
1924   'returns': 'visitor',
1925   'gen': 'no' }
1928 # @qom-set:
1930 # This command will set a property from a object model path.
1932 # @path: see @qom-get for a description of this parameter
1934 # @property: the property name to set
1936 # @value: a value who's type is appropriate for the property type.  See @qom-get
1937 #         for a description of type mapping.
1939 # Since: 1.2
1941 { 'command': 'qom-set',
1942   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1943   'gen': 'no' }
1946 # @set_password:
1948 # Sets the password of a remote display session.
1950 # @protocol: `vnc' to modify the VNC server password
1951 #            `spice' to modify the Spice server password
1953 # @password: the new password
1955 # @connected: #optional how to handle existing clients when changing the
1956 #                       password.  If nothing is specified, defaults to `keep'
1957 #                       `fail' to fail the command if clients are connected
1958 #                       `disconnect' to disconnect existing clients
1959 #                       `keep' to maintain existing clients
1961 # Returns: Nothing on success
1962 #          If Spice is not enabled, DeviceNotFound
1964 # Since: 0.14.0
1966 { 'command': 'set_password',
1967   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
1970 # @expire_password:
1972 # Expire the password of a remote display server.
1974 # @protocol: the name of the remote display protocol `vnc' or `spice'
1976 # @time: when to expire the password.
1977 #        `now' to expire the password immediately
1978 #        `never' to cancel password expiration
1979 #        `+INT' where INT is the number of seconds from now (integer)
1980 #        `INT' where INT is the absolute time in seconds
1982 # Returns: Nothing on success
1983 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
1985 # Since: 0.14.0
1987 # Notes: Time is relative to the server and currently there is no way to
1988 #        coordinate server time with client time.  It is not recommended to
1989 #        use the absolute time version of the @time parameter unless you're
1990 #        sure you are on the same machine as the QEMU instance.
1992 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
1995 # @eject:
1997 # Ejects a device from a removable drive.
1999 # @device:  The name of the device
2001 # @force:   @optional If true, eject regardless of whether the drive is locked.
2002 #           If not specified, the default value is false.
2004 # Returns:  Nothing on success
2005 #           If @device is not a valid block device, DeviceNotFound
2007 # Notes:    Ejecting a device will no media results in success
2009 # Since: 0.14.0
2011 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2014 # @change-vnc-password:
2016 # Change the VNC server password.
2018 # @target:  the new password to use with VNC authentication
2020 # Since: 1.1
2022 # Notes:  An empty password in this command will set the password to the empty
2023 #         string.  Existing clients are unaffected by executing this command.
2025 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2028 # @change:
2030 # This command is multiple commands multiplexed together.
2032 # @device: This is normally the name of a block device but it may also be 'vnc'.
2033 #          when it's 'vnc', then sub command depends on @target
2035 # @target: If @device is a block device, then this is the new filename.
2036 #          If @device is 'vnc', then if the value 'password' selects the vnc
2037 #          change password command.   Otherwise, this specifies a new server URI
2038 #          address to listen to for VNC connections.
2040 # @arg:    If @device is a block device, then this is an optional format to open
2041 #          the device with.
2042 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2043 #          password to set.  If this argument is an empty string, then no future
2044 #          logins will be allowed.
2046 # Returns: Nothing on success.
2047 #          If @device is not a valid block device, DeviceNotFound
2048 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2049 #          if this error is returned, the device has been opened successfully
2050 #          and an additional call to @block_passwd is required to set the
2051 #          device's password.  The behavior of reads and writes to the block
2052 #          device between when these calls are executed is undefined.
2054 # Notes:  It is strongly recommended that this interface is not used especially
2055 #         for changing block devices.
2057 # Since: 0.14.0
2059 { 'command': 'change',
2060   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2063 # @block_set_io_throttle:
2065 # Change I/O throttle limits for a block drive.
2067 # @device: The name of the device
2069 # @bps: total throughput limit in bytes per second
2071 # @bps_rd: read throughput limit in bytes per second
2073 # @bps_wr: write throughput limit in bytes per second
2075 # @iops: total I/O operations per second
2077 # @ops_rd: read I/O operations per second
2079 # @iops_wr: write I/O operations per second
2081 # Returns: Nothing on success
2082 #          If @device is not a valid block device, DeviceNotFound
2084 # Since: 1.1
2086 { 'command': 'block_set_io_throttle',
2087   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2088             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
2091 # @block-stream:
2093 # Copy data from a backing file into a block device.
2095 # The block streaming operation is performed in the background until the entire
2096 # backing file has been copied.  This command returns immediately once streaming
2097 # has started.  The status of ongoing block streaming operations can be checked
2098 # with query-block-jobs.  The operation can be stopped before it has completed
2099 # using the block-job-cancel command.
2101 # If a base file is specified then sectors are not copied from that base file and
2102 # its backing chain.  When streaming completes the image file will have the base
2103 # file as its backing file.  This can be used to stream a subset of the backing
2104 # file chain instead of flattening the entire image.
2106 # On successful completion the image file is updated to drop the backing file
2107 # and the BLOCK_JOB_COMPLETED event is emitted.
2109 # @device: the device name
2111 # @base:   #optional the common backing file name
2113 # @speed:  #optional the maximum speed, in bytes per second
2115 # @on-error: #optional the action to take on an error (default report).
2116 #            'stop' and 'enospc' can only be used if the block device
2117 #            supports io-status (see BlockInfo).  Since 1.3.
2119 # Returns: Nothing on success
2120 #          If @device does not exist, DeviceNotFound
2122 # Since: 1.1
2124 { 'command': 'block-stream',
2125   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2126             '*on-error': 'BlockdevOnError' } }
2129 # @block-job-set-speed:
2131 # Set maximum speed for a background block operation.
2133 # This command can only be issued when there is an active block job.
2135 # Throttling can be disabled by setting the speed to 0.
2137 # @device: the device name
2139 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2140 #          Defaults to 0.
2142 # Returns: Nothing on success
2143 #          If no background operation is active on this device, DeviceNotActive
2145 # Since: 1.1
2147 { 'command': 'block-job-set-speed',
2148   'data': { 'device': 'str', 'speed': 'int' } }
2151 # @block-job-cancel:
2153 # Stop an active background block operation.
2155 # This command returns immediately after marking the active background block
2156 # operation for cancellation.  It is an error to call this command if no
2157 # operation is in progress.
2159 # The operation will cancel as soon as possible and then emit the
2160 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2161 # enumerated using query-block-jobs.
2163 # For streaming, the image file retains its backing file unless the streaming
2164 # operation happens to complete just as it is being cancelled.  A new streaming
2165 # operation can be started at a later time to finish copying all data from the
2166 # backing file.
2168 # @device: the device name
2170 # @force: #optional whether to allow cancellation of a paused job (default
2171 #         false).  Since 1.3.
2173 # Returns: Nothing on success
2174 #          If no background operation is active on this device, DeviceNotActive
2176 # Since: 1.1
2178 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2181 # @block-job-pause:
2183 # Pause an active background block operation.
2185 # This command returns immediately after marking the active background block
2186 # operation for pausing.  It is an error to call this command if no
2187 # operation is in progress.  Pausing an already paused job has no cumulative
2188 # effect; a single block-job-resume command will resume the job.
2190 # The operation will pause as soon as possible.  No event is emitted when
2191 # the operation is actually paused.  Cancelling a paused job automatically
2192 # resumes it.
2194 # @device: the device name
2196 # Returns: Nothing on success
2197 #          If no background operation is active on this device, DeviceNotActive
2199 # Since: 1.3
2201 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2204 # @block-job-resume:
2206 # Resume an active background block operation.
2208 # This command returns immediately after resuming a paused background block
2209 # operation.  It is an error to call this command if no operation is in
2210 # progress.  Resuming an already running job is not an error.
2212 # This command also clears the error status of the job.
2214 # @device: the device name
2216 # Returns: Nothing on success
2217 #          If no background operation is active on this device, DeviceNotActive
2219 # Since: 1.3
2221 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2224 # @block-job-complete:
2226 # Manually trigger completion of an active background block operation.  This
2227 # is supported for drive mirroring, where it also switches the device to
2228 # write to the target path only.  The ability to complete is signaled with
2229 # a BLOCK_JOB_READY event.
2231 # This command completes an active background block operation synchronously.
2232 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2233 # is not defined.  Note that if an I/O error occurs during the processing of
2234 # this command: 1) the command itself will fail; 2) the error will be processed
2235 # according to the rerror/werror arguments that were specified when starting
2236 # the operation.
2238 # A cancelled or paused job cannot be completed.
2240 # @device: the device name
2242 # Returns: Nothing on success
2243 #          If no background operation is active on this device, DeviceNotActive
2245 # Since: 1.3
2247 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2250 # @ObjectTypeInfo:
2252 # This structure describes a search result from @qom-list-types
2254 # @name: the type name found in the search
2256 # Since: 1.1
2258 # Notes: This command is experimental and may change syntax in future releases.
2260 { 'type': 'ObjectTypeInfo',
2261   'data': { 'name': 'str' } }
2264 # @qom-list-types:
2266 # This command will return a list of types given search parameters
2268 # @implements: if specified, only return types that implement this type name
2270 # @abstract: if true, include abstract types in the results
2272 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2274 # Since: 1.1
2276 { 'command': 'qom-list-types',
2277   'data': { '*implements': 'str', '*abstract': 'bool' },
2278   'returns': [ 'ObjectTypeInfo' ] }
2281 # @DevicePropertyInfo:
2283 # Information about device properties.
2285 # @name: the name of the property
2286 # @type: the typename of the property
2288 # Since: 1.2
2290 { 'type': 'DevicePropertyInfo',
2291   'data': { 'name': 'str', 'type': 'str' } }
2294 # @device-list-properties:
2296 # List properties associated with a device.
2298 # @typename: the type name of a device
2300 # Returns: a list of DevicePropertyInfo describing a devices properties
2302 # Since: 1.2
2304 { 'command': 'device-list-properties',
2305   'data': { 'typename': 'str'},
2306   'returns': [ 'DevicePropertyInfo' ] }
2309 # @migrate
2311 # Migrates the current running guest to another Virtual Machine.
2313 # @uri: the Uniform Resource Identifier of the destination VM
2315 # @blk: #optional do block migration (full disk copy)
2317 # @inc: #optional incremental disk copy migration
2319 # @detach: this argument exists only for compatibility reasons and
2320 #          is ignored by QEMU
2322 # Returns: nothing on success
2324 # Since: 0.14.0
2326 { 'command': 'migrate',
2327   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2329 # @xen-save-devices-state:
2331 # Save the state of all devices to file. The RAM and the block devices
2332 # of the VM are not saved by this command.
2334 # @filename: the file to save the state of the devices to as binary
2335 # data. See xen-save-devices-state.txt for a description of the binary
2336 # format.
2338 # Returns: Nothing on success
2340 # Since: 1.1
2342 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2345 # @xen-set-global-dirty-log
2347 # Enable or disable the global dirty log mode.
2349 # @enable: true to enable, false to disable.
2351 # Returns: nothing
2353 # Since: 1.3
2355 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2358 # @device_del:
2360 # Remove a device from a guest
2362 # @id: the name of the device
2364 # Returns: Nothing on success
2365 #          If @id is not a valid device, DeviceNotFound
2367 # Notes: When this command completes, the device may not be removed from the
2368 #        guest.  Hot removal is an operation that requires guest cooperation.
2369 #        This command merely requests that the guest begin the hot removal
2370 #        process.  Completion of the device removal process is signaled with a
2371 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2372 #        for all devices.
2374 # Since: 0.14.0
2376 { 'command': 'device_del', 'data': {'id': 'str'} }
2379 # @dump-guest-memory
2381 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2382 # very long depending on the amount of guest memory. This command is only
2383 # supported on i386 and x86_64.
2385 # @paging: if true, do paging to get guest's memory mapping. This allows
2386 #          using gdb to process the core file.
2388 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2389 #                     of RAM. This can happen for a large guest, or a
2390 #                     malicious guest pretending to be large.
2392 #          Also, paging=true has the following limitations:
2394 #             1. The guest may be in a catastrophic state or can have corrupted
2395 #                memory, which cannot be trusted
2396 #             2. The guest can be in real-mode even if paging is enabled. For
2397 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2398 #                goes in real-mode
2400 # @protocol: the filename or file descriptor of the vmcore. The supported
2401 #            protocols are:
2403 #            1. file: the protocol starts with "file:", and the following
2404 #               string is the file's path.
2405 #            2. fd: the protocol starts with "fd:", and the following string
2406 #               is the fd's name.
2408 # @begin: #optional if specified, the starting physical address.
2410 # @length: #optional if specified, the memory size, in bytes. If you don't
2411 #          want to dump all guest's memory, please specify the start @begin
2412 #          and @length
2414 # Returns: nothing on success
2416 # Since: 1.2
2418 { 'command': 'dump-guest-memory',
2419   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2420             '*length': 'int' } }
2423 # @netdev_add:
2425 # Add a network backend.
2427 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2428 #        'vde', 'socket', 'dump' and 'bridge'
2430 # @id: the name of the new network backend
2432 # @props: #optional a list of properties to be passed to the backend in
2433 #         the format 'name=value', like 'ifname=tap0,script=no'
2435 # Notes: The semantics of @props is not well defined.  Future commands will be
2436 #        introduced that provide stronger typing for backend creation.
2438 # Since: 0.14.0
2440 # Returns: Nothing on success
2441 #          If @type is not a valid network backend, DeviceNotFound
2443 { 'command': 'netdev_add',
2444   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2445   'gen': 'no' }
2448 # @netdev_del:
2450 # Remove a network backend.
2452 # @id: the name of the network backend to remove
2454 # Returns: Nothing on success
2455 #          If @id is not a valid network backend, DeviceNotFound
2457 # Since: 0.14.0
2459 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2462 # @NetdevNoneOptions
2464 # Use it alone to have zero network devices.
2466 # Since 1.2
2468 { 'type': 'NetdevNoneOptions',
2469   'data': { } }
2472 # @NetLegacyNicOptions
2474 # Create a new Network Interface Card.
2476 # @netdev: #optional id of -netdev to connect to
2478 # @macaddr: #optional MAC address
2480 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2482 # @addr: #optional PCI device address
2484 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2486 # Since 1.2
2488 { 'type': 'NetLegacyNicOptions',
2489   'data': {
2490     '*netdev':  'str',
2491     '*macaddr': 'str',
2492     '*model':   'str',
2493     '*addr':    'str',
2494     '*vectors': 'uint32' } }
2497 # @String
2499 # A fat type wrapping 'str', to be embedded in lists.
2501 # Since 1.2
2503 { 'type': 'String',
2504   'data': {
2505     'str': 'str' } }
2508 # @NetdevUserOptions
2510 # Use the user mode network stack which requires no administrator privilege to
2511 # run.
2513 # @hostname: #optional client hostname reported by the builtin DHCP server
2515 # @restrict: #optional isolate the guest from the host
2517 # @ip: #optional legacy parameter, use net= instead
2519 # @net: #optional IP address and optional netmask
2521 # @host: #optional guest-visible address of the host
2523 # @tftp: #optional root directory of the built-in TFTP server
2525 # @bootfile: #optional BOOTP filename, for use with tftp=
2527 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2528 #             assign
2530 # @dns: #optional guest-visible address of the virtual nameserver
2532 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2533 #             to the guest
2535 # @smb: #optional root directory of the built-in SMB server
2537 # @smbserver: #optional IP address of the built-in SMB server
2539 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2540 #           endpoints
2542 # @guestfwd: #optional forward guest TCP connections
2544 # Since 1.2
2546 { 'type': 'NetdevUserOptions',
2547   'data': {
2548     '*hostname':  'str',
2549     '*restrict':  'bool',
2550     '*ip':        'str',
2551     '*net':       'str',
2552     '*host':      'str',
2553     '*tftp':      'str',
2554     '*bootfile':  'str',
2555     '*dhcpstart': 'str',
2556     '*dns':       'str',
2557     '*dnssearch': ['String'],
2558     '*smb':       'str',
2559     '*smbserver': 'str',
2560     '*hostfwd':   ['String'],
2561     '*guestfwd':  ['String'] } }
2564 # @NetdevTapOptions
2566 # Connect the host TAP network interface name to the VLAN.
2568 # @ifname: #optional interface name
2570 # @fd: #optional file descriptor of an already opened tap
2572 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2573 # tap
2575 # @script: #optional script to initialize the interface
2577 # @downscript: #optional script to shut down the interface
2579 # @helper: #optional command to execute to configure bridge
2581 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2583 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2585 # @vhost: #optional enable vhost-net network accelerator
2587 # @vhostfd: #optional file descriptor of an already opened vhost net device
2589 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2590 # devices
2592 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2594 # Since 1.2
2596 { 'type': 'NetdevTapOptions',
2597   'data': {
2598     '*ifname':     'str',
2599     '*fd':         'str',
2600     '*fds':        'str',
2601     '*script':     'str',
2602     '*downscript': 'str',
2603     '*helper':     'str',
2604     '*sndbuf':     'size',
2605     '*vnet_hdr':   'bool',
2606     '*vhost':      'bool',
2607     '*vhostfd':    'str',
2608     '*vhostfds':   'str',
2609     '*vhostforce': 'bool',
2610     '*queues':     'uint32'} }
2613 # @NetdevSocketOptions
2615 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2616 # socket connection.
2618 # @fd: #optional file descriptor of an already opened socket
2620 # @listen: #optional port number, and optional hostname, to listen on
2622 # @connect: #optional port number, and optional hostname, to connect to
2624 # @mcast: #optional UDP multicast address and port number
2626 # @localaddr: #optional source address and port for multicast and udp packets
2628 # @udp: #optional UDP unicast address and port number
2630 # Since 1.2
2632 { 'type': 'NetdevSocketOptions',
2633   'data': {
2634     '*fd':        'str',
2635     '*listen':    'str',
2636     '*connect':   'str',
2637     '*mcast':     'str',
2638     '*localaddr': 'str',
2639     '*udp':       'str' } }
2642 # @NetdevVdeOptions
2644 # Connect the VLAN to a vde switch running on the host.
2646 # @sock: #optional socket path
2648 # @port: #optional port number
2650 # @group: #optional group owner of socket
2652 # @mode: #optional permissions for socket
2654 # Since 1.2
2656 { 'type': 'NetdevVdeOptions',
2657   'data': {
2658     '*sock':  'str',
2659     '*port':  'uint16',
2660     '*group': 'str',
2661     '*mode':  'uint16' } }
2664 # @NetdevDumpOptions
2666 # Dump VLAN network traffic to a file.
2668 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2669 # suffixes.
2671 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2673 # Since 1.2
2675 { 'type': 'NetdevDumpOptions',
2676   'data': {
2677     '*len':  'size',
2678     '*file': 'str' } }
2681 # @NetdevBridgeOptions
2683 # Connect a host TAP network interface to a host bridge device.
2685 # @br: #optional bridge name
2687 # @helper: #optional command to execute to configure bridge
2689 # Since 1.2
2691 { 'type': 'NetdevBridgeOptions',
2692   'data': {
2693     '*br':     'str',
2694     '*helper': 'str' } }
2697 # @NetdevHubPortOptions
2699 # Connect two or more net clients through a software hub.
2701 # @hubid: hub identifier number
2703 # Since 1.2
2705 { 'type': 'NetdevHubPortOptions',
2706   'data': {
2707     'hubid':     'int32' } }
2710 # @NetClientOptions
2712 # A discriminated record of network device traits.
2714 # Since 1.2
2716 { 'union': 'NetClientOptions',
2717   'data': {
2718     'none':     'NetdevNoneOptions',
2719     'nic':      'NetLegacyNicOptions',
2720     'user':     'NetdevUserOptions',
2721     'tap':      'NetdevTapOptions',
2722     'socket':   'NetdevSocketOptions',
2723     'vde':      'NetdevVdeOptions',
2724     'dump':     'NetdevDumpOptions',
2725     'bridge':   'NetdevBridgeOptions',
2726     'hubport':  'NetdevHubPortOptions' } }
2729 # @NetLegacy
2731 # Captures the configuration of a network device; legacy.
2733 # @vlan: #optional vlan number
2735 # @id: #optional identifier for monitor commands
2737 # @name: #optional identifier for monitor commands, ignored if @id is present
2739 # @opts: device type specific properties (legacy)
2741 # Since 1.2
2743 { 'type': 'NetLegacy',
2744   'data': {
2745     '*vlan': 'int32',
2746     '*id':   'str',
2747     '*name': 'str',
2748     'opts':  'NetClientOptions' } }
2751 # @Netdev
2753 # Captures the configuration of a network device.
2755 # @id: identifier for monitor commands.
2757 # @opts: device type specific properties
2759 # Since 1.2
2761 { 'type': 'Netdev',
2762   'data': {
2763     'id':   'str',
2764     'opts': 'NetClientOptions' } }
2767 # @InetSocketAddress
2769 # Captures a socket address or address range in the Internet namespace.
2771 # @host: host part of the address
2773 # @port: port part of the address, or lowest port if @to is present
2775 # @to: highest port to try
2777 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
2778 #        #optional
2780 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
2781 #        #optional
2783 # Since 1.3
2785 { 'type': 'InetSocketAddress',
2786   'data': {
2787     'host': 'str',
2788     'port': 'str',
2789     '*to': 'uint16',
2790     '*ipv4': 'bool',
2791     '*ipv6': 'bool' } }
2794 # @UnixSocketAddress
2796 # Captures a socket address in the local ("Unix socket") namespace.
2798 # @path: filesystem path to use
2800 # Since 1.3
2802 { 'type': 'UnixSocketAddress',
2803   'data': {
2804     'path': 'str' } }
2807 # @SocketAddress
2809 # Captures the address of a socket, which could also be a named file descriptor
2811 # Since 1.3
2813 { 'union': 'SocketAddress',
2814   'data': {
2815     'inet': 'InetSocketAddress',
2816     'unix': 'UnixSocketAddress',
2817     'fd': 'String' } }
2820 # @getfd:
2822 # Receive a file descriptor via SCM rights and assign it a name
2824 # @fdname: file descriptor name
2826 # Returns: Nothing on success
2828 # Since: 0.14.0
2830 # Notes: If @fdname already exists, the file descriptor assigned to
2831 #        it will be closed and replaced by the received file
2832 #        descriptor.
2833 #        The 'closefd' command can be used to explicitly close the
2834 #        file descriptor when it is no longer needed.
2836 { 'command': 'getfd', 'data': {'fdname': 'str'} }
2839 # @closefd:
2841 # Close a file descriptor previously passed via SCM rights
2843 # @fdname: file descriptor name
2845 # Returns: Nothing on success
2847 # Since: 0.14.0
2849 { 'command': 'closefd', 'data': {'fdname': 'str'} }
2852 # @MachineInfo:
2854 # Information describing a machine.
2856 # @name: the name of the machine
2858 # @alias: #optional an alias for the machine name
2860 # @default: #optional whether the machine is default
2862 # Since: 1.2.0
2864 { 'type': 'MachineInfo',
2865   'data': { 'name': 'str', '*alias': 'str',
2866             '*is-default': 'bool' } }
2869 # @query-machines:
2871 # Return a list of supported machines
2873 # Returns: a list of MachineInfo
2875 # Since: 1.2.0
2877 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
2880 # @CpuDefinitionInfo:
2882 # Virtual CPU definition.
2884 # @name: the name of the CPU definition
2886 # Since: 1.2.0
2888 { 'type': 'CpuDefinitionInfo',
2889   'data': { 'name': 'str' } }
2892 # @query-cpu-definitions:
2894 # Return a list of supported virtual CPU definitions
2896 # Returns: a list of CpuDefInfo
2898 # Since: 1.2.0
2900 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
2902 # @AddfdInfo:
2904 # Information about a file descriptor that was added to an fd set.
2906 # @fdset-id: The ID of the fd set that @fd was added to.
2908 # @fd: The file descriptor that was received via SCM rights and
2909 #      added to the fd set.
2911 # Since: 1.2.0
2913 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2916 # @add-fd:
2918 # Add a file descriptor, that was passed via SCM rights, to an fd set.
2920 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
2922 # @opaque: #optional A free-form string that can be used to describe the fd.
2924 # Returns: @AddfdInfo on success
2925 #          If file descriptor was not received, FdNotSupplied
2926 #          If @fdset-id is a negative value, InvalidParameterValue
2928 # Notes: The list of fd sets is shared by all monitor connections.
2930 #        If @fdset-id is not specified, a new fd set will be created.
2932 # Since: 1.2.0
2934 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2935   'returns': 'AddfdInfo' }
2938 # @remove-fd:
2940 # Remove a file descriptor from an fd set.
2942 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
2944 # @fd: #optional The file descriptor that is to be removed.
2946 # Returns: Nothing on success
2947 #          If @fdset-id or @fd is not found, FdNotFound
2949 # Since: 1.2.0
2951 # Notes: The list of fd sets is shared by all monitor connections.
2953 #        If @fd is not specified, all file descriptors in @fdset-id
2954 #        will be removed.
2956 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2959 # @FdsetFdInfo:
2961 # Information about a file descriptor that belongs to an fd set.
2963 # @fd: The file descriptor value.
2965 # @opaque: #optional A free-form string that can be used to describe the fd.
2967 # Since: 1.2.0
2969 { 'type': 'FdsetFdInfo',
2970   'data': {'fd': 'int', '*opaque': 'str'} }
2973 # @FdsetInfo:
2975 # Information about an fd set.
2977 # @fdset-id: The ID of the fd set.
2979 # @fds: A list of file descriptors that belong to this fd set.
2981 # Since: 1.2.0
2983 { 'type': 'FdsetInfo',
2984   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2987 # @query-fdsets:
2989 # Return information describing all fd sets.
2991 # Returns: A list of @FdsetInfo
2993 # Since: 1.2.0
2995 # Note: The list of fd sets is shared by all monitor connections.
2998 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3001 # @TargetType
3003 # Target CPU emulation type
3005 # These parameters correspond to the softmmu binary CPU name that is currently
3006 # running.
3008 # Since: 1.2.0
3010 { 'enum': 'TargetType',
3011   'data': [ 'alpha', 'arm', 'cris', 'i386', 'lm32', 'm68k', 'microblazeel',
3012             'microblaze', 'mips64el', 'mips64', 'mipsel', 'mips', 'moxie',
3013             'or32', 'ppc64', 'ppcemb', 'ppc', 's390x', 'sh4eb', 'sh4',
3014             'sparc64', 'sparc', 'unicore32', 'x86_64', 'xtensaeb', 'xtensa' ] }
3017 # @TargetInfo:
3019 # Information describing the QEMU target.
3021 # @arch: the target architecture (eg "x86_64", "i386", etc)
3023 # Since: 1.2.0
3025 { 'type': 'TargetInfo',
3026   'data': { 'arch': 'TargetType' } }
3029 # @query-target:
3031 # Return information about the target for this QEMU
3033 # Returns: TargetInfo
3035 # Since: 1.2.0
3037 { 'command': 'query-target', 'returns': 'TargetInfo' }
3040 # @QKeyCode:
3042 # An enumeration of key name.
3044 # This is used by the send-key command.
3046 # Since: 1.3.0
3048 { 'enum': 'QKeyCode',
3049   'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3050             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3051             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3052             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3053             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3054             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3055             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3056             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3057             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3058             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3059             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3060             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3061             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3062             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3063              'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3066 # @KeyValue
3068 # Represents a keyboard key.
3070 # Since: 1.3.0
3072 { 'union': 'KeyValue',
3073   'data': {
3074     'number': 'int',
3075     'qcode': 'QKeyCode' } }
3078 # @send-key:
3080 # Send keys to guest.
3082 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3083 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3084 #        directly to the guest, while @KeyValue.qcode must be a valid
3085 #        @QKeyCode value
3087 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3088 #             to 100
3090 # Returns: Nothing on success
3091 #          If key is unknown or redundant, InvalidParameter
3093 # Since: 1.3.0
3096 { 'command': 'send-key',
3097   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3100 # @screendump:
3102 # Write a PPM of the VGA screen to a file.
3104 # @filename: the path of a new PPM file to store the image
3106 # Returns: Nothing on success
3108 # Since: 0.14.0
3110 { 'command': 'screendump', 'data': {'filename': 'str'} }
3113 # @nbd-server-start:
3115 # Start an NBD server listening on the given host and port.  Block
3116 # devices can then be exported using @nbd-server-add.  The NBD
3117 # server will present them as named exports; for example, another
3118 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3120 # @addr: Address on which to listen.
3122 # Returns: error if the server is already running.
3124 # Since: 1.3.0
3126 { 'command': 'nbd-server-start',
3127   'data': { 'addr': 'SocketAddress' } }
3130 # @nbd-server-add:
3132 # Export a device to QEMU's embedded NBD server.
3134 # @device: Block device to be exported
3136 # @writable: Whether clients should be able to write to the device via the
3137 #     NBD connection (default false). #optional
3139 # Returns: error if the device is already marked for export.
3141 # Since: 1.3.0
3143 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3146 # @nbd-server-stop:
3148 # Stop QEMU's embedded NBD server, and unregister all devices previously
3149 # added via @nbd-server-add.
3151 # Since: 1.3.0
3153 { 'command': 'nbd-server-stop' }
3156 # @ChardevFile:
3158 # Configuration info for file chardevs.
3160 # @in:  #optional The name of the input file
3161 # @out: The name of the output file
3163 # Since: 1.4
3165 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3166                                    'out' : 'str' } }
3169 # @ChardevHostdev:
3171 # Configuration info for device and pipe chardevs.
3173 # @device: The name of the special file for the device,
3174 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3175 # @type: What kind of device this is.
3177 # Since: 1.4
3179 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3182 # @ChardevSocket:
3184 # Configuration info for (stream) socket chardevs.
3186 # @addr: socket address to listen on (server=true)
3187 #        or connect to (server=false)
3188 # @server: #optional create server socket (default: true)
3189 # @wait: #optional wait for connect (not used for server
3190 #        sockets, default: false)
3191 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3192 # @telnet: #optional enable telnet protocol (default: false)
3194 # Since: 1.4
3196 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3197                                      '*server'  : 'bool',
3198                                      '*wait'    : 'bool',
3199                                      '*nodelay' : 'bool',
3200                                      '*telnet'  : 'bool' } }
3203 # @ChardevDgram:
3205 # Configuration info for datagram socket chardevs.
3207 # @remote: remote address
3208 # @local: #optional local address
3210 # Since: 1.5
3212 { 'type': 'ChardevDgram', 'data': { 'remote' : 'SocketAddress',
3213                                     '*local' : 'SocketAddress' } }
3216 # @ChardevMux:
3218 # Configuration info for mux chardevs.
3220 # @chardev: name of the base chardev.
3222 # Since: 1.5
3224 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3227 # @ChardevStdio:
3229 # Configuration info for stdio chardevs.
3231 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3232 #          be delivered to qemu.  Default: true in -nographic mode,
3233 #          false otherwise.
3235 # Since: 1.5
3237 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3240 # @ChardevSpiceChannel:
3242 # Configuration info for spice vm channel chardevs.
3244 # @type: kind of channel (for example vdagent).
3246 # Since: 1.5
3248 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3251 # @ChardevSpicePort:
3253 # Configuration info for spice port chardevs.
3255 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3257 # Since: 1.5
3259 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3262 # @ChardevVC:
3264 # Configuration info for virtual console chardevs.
3266 # @width:  console width,  in pixels
3267 # @height: console height, in pixels
3268 # @cols:   console width,  in chars
3269 # @rows:   console height, in chars
3271 # Since: 1.5
3273 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3274                                  '*height' : 'int',
3275                                  '*cols'   : 'int',
3276                                  '*rows'   : 'int' } }
3279 # @ChardevRingbuf:
3281 # Configuration info for memory chardevs
3283 # @size: #optional Ringbuffer size, must be power of two, default is 65536
3285 # Since: 1.5
3287 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3290 # @ChardevBackend:
3292 # Configuration info for the new chardev backend.
3294 # Since: 1.4
3296 { 'type': 'ChardevDummy', 'data': { } }
3298 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3299                                        'serial' : 'ChardevHostdev',
3300                                        'parallel': 'ChardevHostdev',
3301                                        'pipe'   : 'ChardevHostdev',
3302                                        'socket' : 'ChardevSocket',
3303                                        'dgram'  : 'ChardevDgram',
3304                                        'pty'    : 'ChardevDummy',
3305                                        'null'   : 'ChardevDummy',
3306                                        'mux'    : 'ChardevMux',
3307                                        'msmouse': 'ChardevDummy',
3308                                        'braille': 'ChardevDummy',
3309                                        'stdio'  : 'ChardevStdio',
3310                                        'console': 'ChardevDummy',
3311                                        'spicevmc' : 'ChardevSpiceChannel',
3312                                        'spiceport' : 'ChardevSpicePort',
3313                                        'vc'     : 'ChardevVC',
3314                                        'memory' : 'ChardevRingbuf' } }
3317 # @ChardevReturn:
3319 # Return info about the chardev backend just created.
3321 # @pty: #optional name of the slave pseudoterminal device, present if
3322 #       and only if a chardev of type 'pty' was created
3324 # Since: 1.4
3326 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3329 # @chardev-add:
3331 # Add a character device backend
3333 # @id: the chardev's ID, must be unique
3334 # @backend: backend type and parameters
3336 # Returns: ChardevReturn.
3338 # Since: 1.4
3340 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3341                                      'backend' : 'ChardevBackend' },
3342   'returns': 'ChardevReturn' }
3345 # @chardev-remove:
3347 # Remove a character device backend
3349 # @id: the chardev's ID, must exist and not be in use
3351 # Returns: Nothing on success
3353 # Since: 1.4
3355 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3358 # @TpmModel:
3360 # An enumeration of TPM models
3362 # @tpm-tis: TPM TIS model
3364 # Since: 1.5
3366 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3369 # @query-tpm-models:
3371 # Return a list of supported TPM models
3373 # Returns: a list of TpmModel
3375 # Since: 1.5
3377 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3380 # @TpmType:
3382 # An enumeration of TPM types
3384 # @passthrough: TPM passthrough type
3386 # Since: 1.5
3388 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3391 # @query-tpm-types:
3393 # Return a list of supported TPM types
3395 # Returns: a list of TpmType
3397 # Since: 1.5
3399 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3402 # @TPMPassthroughOptions:
3404 # Information about the TPM passthrough type
3406 # @path: #optional string describing the path used for accessing the TPM device
3408 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3409 #               for cancellation of TPM commands while they are executing
3411 # Since: 1.5
3413 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3414                                              '*cancel-path' : 'str'} }
3417 # @TpmTypeOptions:
3419 # A union referencing different TPM backend types' configuration options
3421 # @passthrough: The configuration options for the TPM passthrough type
3423 # Since: 1.5
3425 { 'union': 'TpmTypeOptions',
3426    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3429 # @TpmInfo:
3431 # Information about the TPM
3433 # @id: The Id of the TPM
3435 # @model: The TPM frontend model
3437 # @options: The TPM (backend) type configuration options
3439 # Since: 1.5
3441 { 'type': 'TPMInfo',
3442   'data': {'id': 'str',
3443            'model': 'TpmModel',
3444            'options': 'TpmTypeOptions' } }
3447 # @query-tpm:
3449 # Return information about the TPM device
3451 # Returns: @TPMInfo on success
3453 # Since: 1.5
3455 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }