xen_disk: simplify blk_disconnect with refcnt
[qemu/kevin.git] / qapi-schema.json
blob5d5164f9e2bdd8560405467b1f85b573043fe578
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 # @guest-panicked: guest has been panicked as a result of guest OS panic
180 { 'enum': 'RunState',
181   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
182             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
183             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
184             'guest-panicked' ] }
187 # @SnapshotInfo
189 # @id: unique snapshot id
191 # @name: user chosen name
193 # @vm-state-size: size of the VM state
195 # @date-sec: UTC date of the snapshot in seconds
197 # @date-nsec: fractional part in nano seconds to be used with date-sec
199 # @vm-clock-sec: VM clock relative to boot in seconds
201 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
203 # Since: 1.3
207 { 'type': 'SnapshotInfo',
208   'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
209             'date-sec': 'int', 'date-nsec': 'int',
210             'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
213 # @ImageInfo:
215 # Information about a QEMU image file
217 # @filename: name of the image file
219 # @format: format of the image file
221 # @virtual-size: maximum capacity in bytes of the image
223 # @actual-size: #optional actual size on disk in bytes of the image
225 # @dirty-flag: #optional true if image is not cleanly closed
227 # @cluster-size: #optional size of a cluster in bytes
229 # @encrypted: #optional true if the image is encrypted
231 # @backing-filename: #optional name of the backing file
233 # @full-backing-filename: #optional full path of the backing file
235 # @backing-filename-format: #optional the format of the backing file
237 # @snapshots: #optional list of VM snapshots
239 # @backing-image: #optional info of the backing image (since 1.6)
241 # Since: 1.3
245 { 'type': 'ImageInfo',
246   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
247            '*actual-size': 'int', 'virtual-size': 'int',
248            '*cluster-size': 'int', '*encrypted': 'bool',
249            '*backing-filename': 'str', '*full-backing-filename': 'str',
250            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
251            '*backing-image': 'ImageInfo' } }
254 # @ImageCheck:
256 # Information about a QEMU image file check
258 # @filename: name of the image file checked
260 # @format: format of the image file checked
262 # @check-errors: number of unexpected errors occurred during check
264 # @image-end-offset: #optional offset (in bytes) where the image ends, this
265 #                    field is present if the driver for the image format
266 #                    supports it
268 # @corruptions: #optional number of corruptions found during the check if any
270 # @leaks: #optional number of leaks found during the check if any
272 # @corruptions-fixed: #optional number of corruptions fixed during the check
273 #                     if any
275 # @leaks-fixed: #optional number of leaks fixed during the check if any
277 # @total-clusters: #optional total number of clusters, this field is present
278 #                  if the driver for the image format supports it
280 # @allocated-clusters: #optional total number of allocated clusters, this
281 #                      field is present if the driver for the image format
282 #                      supports it
284 # @fragmented-clusters: #optional total number of fragmented clusters, this
285 #                       field is present if the driver for the image format
286 #                       supports it
288 # @compressed-clusters: #optional total number of compressed clusters, this
289 #                       field is present if the driver for the image format
290 #                       supports it
292 # Since: 1.4
296 { 'type': 'ImageCheck',
297   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
298            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
299            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
300            '*total-clusters': 'int', '*allocated-clusters': 'int',
301            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
304 # @StatusInfo:
306 # Information about VCPU run state
308 # @running: true if all VCPUs are runnable, false if not runnable
310 # @singlestep: true if VCPUs are in single-step mode
312 # @status: the virtual machine @RunState
314 # Since:  0.14.0
316 # Notes: @singlestep is enabled through the GDB stub
318 { 'type': 'StatusInfo',
319   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
322 # @query-status:
324 # Query the run status of all VCPUs
326 # Returns: @StatusInfo reflecting all VCPUs
328 # Since:  0.14.0
330 { 'command': 'query-status', 'returns': 'StatusInfo' }
333 # @UuidInfo:
335 # Guest UUID information.
337 # @UUID: the UUID of the guest
339 # Since: 0.14.0
341 # Notes: If no UUID was specified for the guest, a null UUID is returned.
343 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
346 # @query-uuid:
348 # Query the guest UUID information.
350 # Returns: The @UuidInfo for the guest
352 # Since 0.14.0
354 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
357 # @ChardevInfo:
359 # Information about a character device.
361 # @label: the label of the character device
363 # @filename: the filename of the character device
365 # Notes: @filename is encoded using the QEMU command line character device
366 #        encoding.  See the QEMU man page for details.
368 # Since: 0.14.0
370 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
373 # @query-chardev:
375 # Returns information about current character devices.
377 # Returns: a list of @ChardevInfo
379 # Since: 0.14.0
381 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
384 # @DataFormat:
386 # An enumeration of data format.
388 # @utf8: Data is a UTF-8 string (RFC 3629)
390 # @base64: Data is Base64 encoded binary (RFC 3548)
392 # Since: 1.4
394 { 'enum': 'DataFormat',
395   'data': [ 'utf8', 'base64' ] }
398 # @ringbuf-write:
400 # Write to a ring buffer character device.
402 # @device: the ring buffer character device name
404 # @data: data to write
406 # @format: #optional data encoding (default 'utf8').
407 #          - base64: data must be base64 encoded text.  Its binary
408 #            decoding gets written.
409 #            Bug: invalid base64 is currently not rejected.
410 #            Whitespace *is* invalid.
411 #          - utf8: data's UTF-8 encoding is written
412 #          - data itself is always Unicode regardless of format, like
413 #            any other string.
415 # Returns: Nothing on success
417 # Since: 1.4
419 { 'command': 'ringbuf-write',
420   'data': {'device': 'str', 'data': 'str',
421            '*format': 'DataFormat'} }
424 # @ringbuf-read:
426 # Read from a ring buffer character device.
428 # @device: the ring buffer character device name
430 # @size: how many bytes to read at most
432 # @format: #optional data encoding (default 'utf8').
433 #          - base64: the data read is returned in base64 encoding.
434 #          - utf8: the data read is interpreted as UTF-8.
435 #            Bug: can screw up when the buffer contains invalid UTF-8
436 #            sequences, NUL characters, after the ring buffer lost
437 #            data, and when reading stops because the size limit is
438 #            reached.
439 #          - The return value is always Unicode regardless of format,
440 #            like any other string.
442 # Returns: data read from the device
444 # Since: 1.4
446 { 'command': 'ringbuf-read',
447   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
448   'returns': 'str' }
451 # @CommandInfo:
453 # Information about a QMP command
455 # @name: The command name
457 # Since: 0.14.0
459 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
462 # @query-commands:
464 # Return a list of supported QMP commands by this server
466 # Returns: A list of @CommandInfo for all supported commands
468 # Since: 0.14.0
470 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
473 # @EventInfo:
475 # Information about a QMP event
477 # @name: The event name
479 # Since: 1.2.0
481 { 'type': 'EventInfo', 'data': {'name': 'str'} }
484 # @query-events:
486 # Return a list of supported QMP events by this server
488 # Returns: A list of @EventInfo for all supported events
490 # Since: 1.2.0
492 { 'command': 'query-events', 'returns': ['EventInfo'] }
495 # @MigrationStats
497 # Detailed migration status.
499 # @transferred: amount of bytes already transferred to the target VM
501 # @remaining: amount of bytes remaining to be transferred to the target VM
503 # @total: total amount of bytes involved in the migration process
505 # @duplicate: number of duplicate (zero) pages (since 1.2)
507 # @skipped: number of skipped zero pages (since 1.5)
509 # @normal : number of normal pages (since 1.2)
511 # @normal-bytes: number of normal bytes sent (since 1.2)
513 # @dirty-pages-rate: number of pages dirtied by second by the
514 #        guest (since 1.3)
516 # @mbps: throughput in megabits/sec. (since 1.6)
518 # Since: 0.14.0
520 { 'type': 'MigrationStats',
521   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
522            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
523            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
524            'mbps' : 'number' } }
527 # @XBZRLECacheStats
529 # Detailed XBZRLE migration cache statistics
531 # @cache-size: XBZRLE cache size
533 # @bytes: amount of bytes already transferred to the target VM
535 # @pages: amount of pages transferred to the target VM
537 # @cache-miss: number of cache miss
539 # @overflow: number of overflows
541 # Since: 1.2
543 { 'type': 'XBZRLECacheStats',
544   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
545            'cache-miss': 'int', 'overflow': 'int' } }
548 # @MigrationInfo
550 # Information about current migration process.
552 # @status: #optional string describing the current migration status.
553 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
554 #          'cancelled'. If this field is not returned, no migration process
555 #          has been initiated
557 # @ram: #optional @MigrationStats containing detailed migration
558 #       status, only returned if status is 'active' or
559 #       'completed'. 'comppleted' (since 1.2)
561 # @disk: #optional @MigrationStats containing detailed disk migration
562 #        status, only returned if status is 'active' and it is a block
563 #        migration
565 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
566 #                migration statistics, only returned if XBZRLE feature is on and
567 #                status is 'active' or 'completed' (since 1.2)
569 # @total-time: #optional total amount of milliseconds since migration started.
570 #        If migration has ended, it returns the total migration
571 #        time. (since 1.2)
573 # @downtime: #optional only present when migration finishes correctly
574 #        total downtime in milliseconds for the guest.
575 #        (since 1.3)
577 # @expected-downtime: #optional only present while migration is active
578 #        expected downtime in milliseconds for the guest in last walk
579 #        of the dirty bitmap. (since 1.3)
581 # @setup-time: #optional amount of setup time in milliseconds _before_ the
582 #        iterations begin but _after_ the QMP command is issued. This is designed
583 #        to provide an accounting of any activities (such as RDMA pinning) which
584 #        may be expensive, but do not actually occur during the iterative
585 #        migration rounds themselves. (since 1.6)
587 # Since: 0.14.0
589 { 'type': 'MigrationInfo',
590   'data': {'*status': 'str', '*ram': 'MigrationStats',
591            '*disk': 'MigrationStats',
592            '*xbzrle-cache': 'XBZRLECacheStats',
593            '*total-time': 'int',
594            '*expected-downtime': 'int',
595            '*downtime': 'int',
596            '*setup-time': 'int'} }
599 # @query-migrate
601 # Returns information about current migration process.
603 # Returns: @MigrationInfo
605 # Since: 0.14.0
607 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
610 # @MigrationCapability
612 # Migration capabilities enumeration
614 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
615 #          This feature allows us to minimize migration traffic for certain work
616 #          loads, by sending compressed difference of the pages
618 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
619 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
620 #          Disabled by default. Experimental: may (or may not) be renamed after
621 #          further testing is complete. (since 1.6)
623 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
624 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
625 #          source and target VM to support this feature. To enable it is sufficient
626 #          to enable the capability on the source VM. The feature is disabled by
627 #          default. (since 1.6)
629 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
630 #          to speed up convergence of RAM migration. (since 1.6)
632 # Since: 1.2
634 { 'enum': 'MigrationCapability',
635   'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
638 # @MigrationCapabilityStatus
640 # Migration capability information
642 # @capability: capability enum
644 # @state: capability state bool
646 # Since: 1.2
648 { 'type': 'MigrationCapabilityStatus',
649   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
652 # @migrate-set-capabilities
654 # Enable/Disable the following migration capabilities (like xbzrle)
656 # @capabilities: json array of capability modifications to make
658 # Since: 1.2
660 { 'command': 'migrate-set-capabilities',
661   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
664 # @query-migrate-capabilities
666 # Returns information about the current migration capabilities status
668 # Returns: @MigrationCapabilitiesStatus
670 # Since: 1.2
672 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
675 # @MouseInfo:
677 # Information about a mouse device.
679 # @name: the name of the mouse device
681 # @index: the index of the mouse device
683 # @current: true if this device is currently receiving mouse events
685 # @absolute: true if this device supports absolute coordinates as input
687 # Since: 0.14.0
689 { 'type': 'MouseInfo',
690   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
691            'absolute': 'bool'} }
694 # @query-mice:
696 # Returns information about each active mouse device
698 # Returns: a list of @MouseInfo for each device
700 # Since: 0.14.0
702 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
705 # @CpuInfo:
707 # Information about a virtual CPU
709 # @CPU: the index of the virtual CPU
711 # @current: this only exists for backwards compatible and should be ignored
713 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
714 #          to a processor specific low power mode.
716 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
717 #                pointer.
718 #                If the target is Sparc, this is the PC component of the
719 #                instruction pointer.
721 # @nip: #optional If the target is PPC, the instruction pointer
723 # @npc: #optional If the target is Sparc, the NPC component of the instruction
724 #                 pointer
726 # @PC: #optional If the target is MIPS, the instruction pointer
728 # @thread_id: ID of the underlying host thread
730 # Since: 0.14.0
732 # Notes: @halted is a transient state that changes frequently.  By the time the
733 #        data is sent to the client, the guest may no longer be halted.
735 { 'type': 'CpuInfo',
736   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
737            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
740 # @query-cpus:
742 # Returns a list of information about each virtual CPU.
744 # Returns: a list of @CpuInfo for each virtual CPU
746 # Since: 0.14.0
748 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
751 # @BlockDeviceInfo:
753 # Information about the backing device for a block device.
755 # @file: the filename of the backing device
757 # @ro: true if the backing device was open read-only
759 # @drv: the name of the block format used to open the backing device. As of
760 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
761 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
762 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
763 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
765 # @backing_file: #optional the name of the backing file (for copy-on-write)
767 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
769 # @encrypted: true if the backing device is encrypted
771 # @encryption_key_missing: true if the backing device is encrypted but an
772 #                          valid encryption key is missing
774 # @bps: total throughput limit in bytes per second is specified
776 # @bps_rd: read throughput limit in bytes per second is specified
778 # @bps_wr: write throughput limit in bytes per second is specified
780 # @iops: total I/O operations per second is specified
782 # @iops_rd: read I/O operations per second is specified
784 # @iops_wr: write I/O operations per second is specified
786 # @image: the info of image used (since: 1.6)
788 # @bps_max: #optional total max in bytes (Since 1.7)
790 # @bps_rd_max: #optional read max in bytes (Since 1.7)
792 # @bps_wr_max: #optional write max in bytes (Since 1.7)
794 # @iops_max: #optional total I/O operations max (Since 1.7)
796 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
798 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
800 # @iops_size: #optional an I/O size in bytes (Since 1.7)
802 # Since: 0.14.0
804 # Notes: This interface is only found in @BlockInfo.
806 { 'type': 'BlockDeviceInfo',
807   'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
808             '*backing_file': 'str', 'backing_file_depth': 'int',
809             'encrypted': 'bool', 'encryption_key_missing': 'bool',
810             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
811             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
812             'image': 'ImageInfo',
813             '*bps_max': 'int', '*bps_rd_max': 'int',
814             '*bps_wr_max': 'int', '*iops_max': 'int',
815             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
816             '*iops_size': 'int' } }
819 # @BlockDeviceIoStatus:
821 # An enumeration of block device I/O status.
823 # @ok: The last I/O operation has succeeded
825 # @failed: The last I/O operation has failed
827 # @nospace: The last I/O operation has failed due to a no-space condition
829 # Since: 1.0
831 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
834 # @BlockDirtyInfo:
836 # Block dirty bitmap information.
838 # @count: number of dirty bytes according to the dirty bitmap
840 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
842 # Since: 1.3
844 { 'type': 'BlockDirtyInfo',
845   'data': {'count': 'int', 'granularity': 'int'} }
848 # @BlockInfo:
850 # Block device information.  This structure describes a virtual device and
851 # the backing device associated with it.
853 # @device: The device name associated with the virtual device.
855 # @type: This field is returned only for compatibility reasons, it should
856 #        not be used (always returns 'unknown')
858 # @removable: True if the device supports removable media.
860 # @locked: True if the guest has locked this device from having its media
861 #          removed
863 # @tray_open: #optional True if the device has a tray and it is open
864 #             (only present if removable is true)
866 # @dirty: #optional dirty bitmap information (only present if the dirty
867 #         bitmap is enabled)
869 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
870 #             supports it and the VM is configured to stop on errors
872 # @inserted: #optional @BlockDeviceInfo describing the device if media is
873 #            present
875 # Since:  0.14.0
877 { 'type': 'BlockInfo',
878   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
879            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
880            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
881            '*dirty': 'BlockDirtyInfo' } }
884 # @query-block:
886 # Get a list of BlockInfo for all virtual block devices.
888 # Returns: a list of @BlockInfo describing each virtual block device
890 # Since: 0.14.0
892 { 'command': 'query-block', 'returns': ['BlockInfo'] }
895 # @BlockDeviceStats:
897 # Statistics of a virtual block device or a block backing device.
899 # @rd_bytes:      The number of bytes read by the device.
901 # @wr_bytes:      The number of bytes written by the device.
903 # @rd_operations: The number of read operations performed by the device.
905 # @wr_operations: The number of write operations performed by the device.
907 # @flush_operations: The number of cache flush operations performed by the
908 #                    device (since 0.15.0)
910 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
911 #                       (since 0.15.0).
913 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
915 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
917 # @wr_highest_offset: The offset after the greatest byte written to the
918 #                     device.  The intended use of this information is for
919 #                     growable sparse files (like qcow2) that are used on top
920 #                     of a physical device.
922 # Since: 0.14.0
924 { 'type': 'BlockDeviceStats',
925   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
926            'wr_operations': 'int', 'flush_operations': 'int',
927            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
928            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
931 # @BlockStats:
933 # Statistics of a virtual block device or a block backing device.
935 # @device: #optional If the stats are for a virtual block device, the name
936 #          corresponding to the virtual block device.
938 # @stats:  A @BlockDeviceStats for the device.
940 # @parent: #optional This may point to the backing block device if this is a
941 #          a virtual block device.  If it's a backing block, this will point
942 #          to the backing file is one is present.
944 # Since: 0.14.0
946 { 'type': 'BlockStats',
947   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
948            '*parent': 'BlockStats'} }
951 # @query-blockstats:
953 # Query the @BlockStats for all virtual block devices.
955 # Returns: A list of @BlockStats for each virtual block devices.
957 # Since: 0.14.0
959 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
962 # @VncClientInfo:
964 # Information about a connected VNC client.
966 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
967 #        when possible.
969 # @family: 'ipv6' if the client is connected via IPv6 and TCP
970 #          'ipv4' if the client is connected via IPv4 and TCP
971 #          'unix' if the client is connected via a unix domain socket
972 #          'unknown' otherwise
974 # @service: The service name of the client's port.  This may depends on the
975 #           host system's service database so symbolic names should not be
976 #           relied on.
978 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
979 #              Name of the client.
981 # @sasl_username: #optional If SASL authentication is in use, the SASL username
982 #                 used for authentication.
984 # Since: 0.14.0
986 { 'type': 'VncClientInfo',
987   'data': {'host': 'str', 'family': 'str', 'service': 'str',
988            '*x509_dname': 'str', '*sasl_username': 'str'} }
991 # @VncInfo:
993 # Information about the VNC session.
995 # @enabled: true if the VNC server is enabled, false otherwise
997 # @host: #optional The hostname the VNC server is bound to.  This depends on
998 #        the name resolution on the host and may be an IP address.
1000 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1001 #                    'ipv4' if the host is listening for IPv4 connections
1002 #                    'unix' if the host is listening on a unix domain socket
1003 #                    'unknown' otherwise
1005 # @service: #optional The service name of the server's port.  This may depends
1006 #           on the host system's service database so symbolic names should not
1007 #           be relied on.
1009 # @auth: #optional the current authentication type used by the server
1010 #        'none' if no authentication is being used
1011 #        'vnc' if VNC authentication is being used
1012 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1013 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1014 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1015 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1016 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1017 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1018 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1019 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1020 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1022 # @clients: a list of @VncClientInfo of all currently connected clients
1024 # Since: 0.14.0
1026 { 'type': 'VncInfo',
1027   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1028            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1031 # @query-vnc:
1033 # Returns information about the current VNC server
1035 # Returns: @VncInfo
1037 # Since: 0.14.0
1039 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1042 # @SpiceChannel
1044 # Information about a SPICE client channel.
1046 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1047 #        when possible.
1049 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1050 #          'ipv4' if the client is connected via IPv4 and TCP
1051 #          'unix' if the client is connected via a unix domain socket
1052 #          'unknown' otherwise
1054 # @port: The client's port number.
1056 # @connection-id: SPICE connection id number.  All channels with the same id
1057 #                 belong to the same SPICE session.
1059 # @connection-type: SPICE channel type number.  "1" is the main control
1060 #                   channel, filter for this one if you want to track spice
1061 #                   sessions only
1063 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1064 #              multiple channels of the same type exist, such as multiple
1065 #              display channels in a multihead setup
1067 # @tls: true if the channel is encrypted, false otherwise.
1069 # Since: 0.14.0
1071 { 'type': 'SpiceChannel',
1072   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1073            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1074            'tls': 'bool'} }
1077 # @SpiceQueryMouseMode
1079 # An enumeration of Spice mouse states.
1081 # @client: Mouse cursor position is determined by the client.
1083 # @server: Mouse cursor position is determined by the server.
1085 # @unknown: No information is available about mouse mode used by
1086 #           the spice server.
1088 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1090 # Since: 1.1
1092 { 'enum': 'SpiceQueryMouseMode',
1093   'data': [ 'client', 'server', 'unknown' ] }
1096 # @SpiceInfo
1098 # Information about the SPICE session.
1100 # @enabled: true if the SPICE server is enabled, false otherwise
1102 # @migrated: true if the last guest migration completed and spice
1103 #            migration had completed as well. false otherwise.
1105 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1106 #        the name resolution on the host and may be an IP address.
1108 # @port: #optional The SPICE server's port number.
1110 # @compiled-version: #optional SPICE server version.
1112 # @tls-port: #optional The SPICE server's TLS port number.
1114 # @auth: #optional the current authentication type used by the server
1115 #        'none'  if no authentication is being used
1116 #        'spice' uses SASL or direct TLS authentication, depending on command
1117 #                line options
1119 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1120 #              be determined by the client or the server, or unknown if spice
1121 #              server doesn't provide this information.
1123 #              Since: 1.1
1125 # @channels: a list of @SpiceChannel for each active spice channel
1127 # Since: 0.14.0
1129 { 'type': 'SpiceInfo',
1130   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1131            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1132            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1135 # @query-spice
1137 # Returns information about the current SPICE server
1139 # Returns: @SpiceInfo
1141 # Since: 0.14.0
1143 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1146 # @BalloonInfo:
1148 # Information about the guest balloon device.
1150 # @actual: the number of bytes the balloon currently contains
1152 # Since: 0.14.0
1155 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1158 # @query-balloon:
1160 # Return information about the balloon device.
1162 # Returns: @BalloonInfo on success
1163 #          If the balloon driver is enabled but not functional because the KVM
1164 #          kernel module cannot support it, KvmMissingCap
1165 #          If no balloon device is present, DeviceNotActive
1167 # Since: 0.14.0
1169 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1172 # @PciMemoryRange:
1174 # A PCI device memory region
1176 # @base: the starting address (guest physical)
1178 # @limit: the ending address (guest physical)
1180 # Since: 0.14.0
1182 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1185 # @PciMemoryRegion
1187 # Information about a PCI device I/O region.
1189 # @bar: the index of the Base Address Register for this region
1191 # @type: 'io' if the region is a PIO region
1192 #        'memory' if the region is a MMIO region
1194 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1196 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1198 # Since: 0.14.0
1200 { 'type': 'PciMemoryRegion',
1201   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1202            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1205 # @PciBridgeInfo:
1207 # Information about a PCI Bridge device
1209 # @bus.number: primary bus interface number.  This should be the number of the
1210 #              bus the device resides on.
1212 # @bus.secondary: secondary bus interface number.  This is the number of the
1213 #                 main bus for the bridge
1215 # @bus.subordinate: This is the highest number bus that resides below the
1216 #                   bridge.
1218 # @bus.io_range: The PIO range for all devices on this bridge
1220 # @bus.memory_range: The MMIO range for all devices on this bridge
1222 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1223 #                          this bridge
1225 # @devices: a list of @PciDeviceInfo for each device on this bridge
1227 # Since: 0.14.0
1229 { 'type': 'PciBridgeInfo',
1230   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1231                     'io_range': 'PciMemoryRange',
1232                     'memory_range': 'PciMemoryRange',
1233                     'prefetchable_range': 'PciMemoryRange' },
1234            '*devices': ['PciDeviceInfo']} }
1237 # @PciDeviceInfo:
1239 # Information about a PCI device
1241 # @bus: the bus number of the device
1243 # @slot: the slot the device is located in
1245 # @function: the function of the slot used by the device
1247 # @class_info.desc: #optional a string description of the device's class
1249 # @class_info.class: the class code of the device
1251 # @id.device: the PCI device id
1253 # @id.vendor: the PCI vendor id
1255 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1257 # @qdev_id: the device name of the PCI device
1259 # @pci_bridge: if the device is a PCI bridge, the bridge information
1261 # @regions: a list of the PCI I/O regions associated with the device
1263 # Notes: the contents of @class_info.desc are not stable and should only be
1264 #        treated as informational.
1266 # Since: 0.14.0
1268 { 'type': 'PciDeviceInfo',
1269   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1270            'class_info': {'*desc': 'str', 'class': 'int'},
1271            'id': {'device': 'int', 'vendor': 'int'},
1272            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1273            'regions': ['PciMemoryRegion']} }
1276 # @PciInfo:
1278 # Information about a PCI bus
1280 # @bus: the bus index
1282 # @devices: a list of devices on this bus
1284 # Since: 0.14.0
1286 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1289 # @query-pci:
1291 # Return information about the PCI bus topology of the guest.
1293 # Returns: a list of @PciInfo for each PCI bus
1295 # Since: 0.14.0
1297 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1300 # @BlockdevOnError:
1302 # An enumeration of possible behaviors for errors on I/O operations.
1303 # The exact meaning depends on whether the I/O was initiated by a guest
1304 # or by a block job
1306 # @report: for guest operations, report the error to the guest;
1307 #          for jobs, cancel the job
1309 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1310 #          or BLOCK_JOB_ERROR)
1312 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1314 # @stop: for guest operations, stop the virtual machine;
1315 #        for jobs, pause the job
1317 # Since: 1.3
1319 { 'enum': 'BlockdevOnError',
1320   'data': ['report', 'ignore', 'enospc', 'stop'] }
1323 # @MirrorSyncMode:
1325 # An enumeration of possible behaviors for the initial synchronization
1326 # phase of storage mirroring.
1328 # @top: copies data in the topmost image to the destination
1330 # @full: copies data from all images to the destination
1332 # @none: only copy data written from now on
1334 # Since: 1.3
1336 { 'enum': 'MirrorSyncMode',
1337   'data': ['top', 'full', 'none'] }
1340 # @BlockJobInfo:
1342 # Information about a long-running block device operation.
1344 # @type: the job type ('stream' for image streaming)
1346 # @device: the block device name
1348 # @len: the maximum progress value
1350 # @busy: false if the job is known to be in a quiescent state, with
1351 #        no pending I/O.  Since 1.3.
1353 # @paused: whether the job is paused or, if @busy is true, will
1354 #          pause itself as soon as possible.  Since 1.3.
1356 # @offset: the current progress value
1358 # @speed: the rate limit, bytes per second
1360 # @io-status: the status of the job (since 1.3)
1362 # Since: 1.1
1364 { 'type': 'BlockJobInfo',
1365   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1366            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1367            'io-status': 'BlockDeviceIoStatus'} }
1370 # @query-block-jobs:
1372 # Return information about long-running block device operations.
1374 # Returns: a list of @BlockJobInfo for each active block job
1376 # Since: 1.1
1378 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1381 # @quit:
1383 # This command will cause the QEMU process to exit gracefully.  While every
1384 # attempt is made to send the QMP response before terminating, this is not
1385 # guaranteed.  When using this interface, a premature EOF would not be
1386 # unexpected.
1388 # Since: 0.14.0
1390 { 'command': 'quit' }
1393 # @stop:
1395 # Stop all guest VCPU execution.
1397 # Since:  0.14.0
1399 # Notes:  This function will succeed even if the guest is already in the stopped
1400 #         state.  In "inmigrate" state, it will ensure that the guest
1401 #         remains paused once migration finishes, as if the -S option was
1402 #         passed on the command line.
1404 { 'command': 'stop' }
1407 # @system_reset:
1409 # Performs a hard reset of a guest.
1411 # Since: 0.14.0
1413 { 'command': 'system_reset' }
1416 # @system_powerdown:
1418 # Requests that a guest perform a powerdown operation.
1420 # Since: 0.14.0
1422 # Notes: A guest may or may not respond to this command.  This command
1423 #        returning does not indicate that a guest has accepted the request or
1424 #        that it has shut down.  Many guests will respond to this command by
1425 #        prompting the user in some way.
1427 { 'command': 'system_powerdown' }
1430 # @cpu:
1432 # This command is a nop that is only provided for the purposes of compatibility.
1434 # Since: 0.14.0
1436 # Notes: Do not use this command.
1438 { 'command': 'cpu', 'data': {'index': 'int'} }
1441 # @cpu-add
1443 # Adds CPU with specified ID
1445 # @id: ID of CPU to be created, valid values [0..max_cpus)
1447 # Returns: Nothing on success
1449 # Since 1.5
1451 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1454 # @memsave:
1456 # Save a portion of guest memory to a file.
1458 # @val: the virtual address of the guest to start from
1460 # @size: the size of memory region to save
1462 # @filename: the file to save the memory to as binary data
1464 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1465 #                       virtual address (defaults to CPU 0)
1467 # Returns: Nothing on success
1469 # Since: 0.14.0
1471 # Notes: Errors were not reliably returned until 1.1
1473 { 'command': 'memsave',
1474   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1477 # @pmemsave:
1479 # Save a portion of guest physical memory to a file.
1481 # @val: the physical address of the guest to start from
1483 # @size: the size of memory region to save
1485 # @filename: the file to save the memory to as binary data
1487 # Returns: Nothing on success
1489 # Since: 0.14.0
1491 # Notes: Errors were not reliably returned until 1.1
1493 { 'command': 'pmemsave',
1494   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1497 # @cont:
1499 # Resume guest VCPU execution.
1501 # Since:  0.14.0
1503 # Returns:  If successful, nothing
1504 #           If QEMU was started with an encrypted block device and a key has
1505 #              not yet been set, DeviceEncrypted.
1507 # Notes:  This command will succeed if the guest is currently running.  It
1508 #         will also succeed if the guest is in the "inmigrate" state; in
1509 #         this case, the effect of the command is to make sure the guest
1510 #         starts once migration finishes, removing the effect of the -S
1511 #         command line option if it was passed.
1513 { 'command': 'cont' }
1516 # @system_wakeup:
1518 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1520 # Since:  1.1
1522 # Returns:  nothing.
1524 { 'command': 'system_wakeup' }
1527 # @inject-nmi:
1529 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1531 # Returns:  If successful, nothing
1533 # Since:  0.14.0
1535 # Notes: Only x86 Virtual Machines support this command.
1537 { 'command': 'inject-nmi' }
1540 # @set_link:
1542 # Sets the link status of a virtual network adapter.
1544 # @name: the device name of the virtual network adapter
1546 # @up: true to set the link status to be up
1548 # Returns: Nothing on success
1549 #          If @name is not a valid network device, DeviceNotFound
1551 # Since: 0.14.0
1553 # Notes: Not all network adapters support setting link status.  This command
1554 #        will succeed even if the network adapter does not support link status
1555 #        notification.
1557 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1560 # @block_passwd:
1562 # This command sets the password of a block device that has not been open
1563 # with a password and requires one.
1565 # The two cases where this can happen are a block device is created through
1566 # QEMU's initial command line or a block device is changed through the legacy
1567 # @change interface.
1569 # In the event that the block device is created through the initial command
1570 # line, the VM will start in the stopped state regardless of whether '-S' is
1571 # used.  The intention is for a management tool to query the block devices to
1572 # determine which ones are encrypted, set the passwords with this command, and
1573 # then start the guest with the @cont command.
1575 # @device:   the name of the device to set the password on
1577 # @password: the password to use for the device
1579 # Returns: nothing on success
1580 #          If @device is not a valid block device, DeviceNotFound
1581 #          If @device is not encrypted, DeviceNotEncrypted
1583 # Notes:  Not all block formats support encryption and some that do are not
1584 #         able to validate that a password is correct.  Disk corruption may
1585 #         occur if an invalid password is specified.
1587 # Since: 0.14.0
1589 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1592 # @balloon:
1594 # Request the balloon driver to change its balloon size.
1596 # @value: the target size of the balloon in bytes
1598 # Returns: Nothing on success
1599 #          If the balloon driver is enabled but not functional because the KVM
1600 #            kernel module cannot support it, KvmMissingCap
1601 #          If no balloon device is present, DeviceNotActive
1603 # Notes: This command just issues a request to the guest.  When it returns,
1604 #        the balloon size may not have changed.  A guest can change the balloon
1605 #        size independent of this command.
1607 # Since: 0.14.0
1609 { 'command': 'balloon', 'data': {'value': 'int'} }
1612 # @block_resize
1614 # Resize a block image while a guest is running.
1616 # @device:  the name of the device to get the image resized
1618 # @size:  new image size in bytes
1620 # Returns: nothing on success
1621 #          If @device is not a valid block device, DeviceNotFound
1623 # Since: 0.14.0
1625 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1628 # @NewImageMode
1630 # An enumeration that tells QEMU how to set the backing file path in
1631 # a new image file.
1633 # @existing: QEMU should look for an existing image file.
1635 # @absolute-paths: QEMU should create a new image with absolute paths
1636 # for the backing file.
1638 # Since: 1.1
1640 { 'enum': 'NewImageMode',
1641   'data': [ 'existing', 'absolute-paths' ] }
1644 # @BlockdevSnapshot
1646 # @device:  the name of the device to generate the snapshot from.
1648 # @snapshot-file: the target of the new image. A new file will be created.
1650 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1652 # @mode: #optional whether and how QEMU should create a new image, default is
1653 #        'absolute-paths'.
1655 { 'type': 'BlockdevSnapshot',
1656   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1657             '*mode': 'NewImageMode' } }
1660 # @DriveBackup
1662 # @device: the name of the device which should be copied.
1664 # @target: the target of the new image. If the file exists, or if it
1665 #          is a device, the existing file/device will be used as the new
1666 #          destination.  If it does not exist, a new file will be created.
1668 # @format: #optional the format of the new destination, default is to
1669 #          probe if @mode is 'existing', else the format of the source
1671 # @sync: what parts of the disk image should be copied to the destination
1672 #        (all the disk, only the sectors allocated in the topmost image, or
1673 #        only new I/O).
1675 # @mode: #optional whether and how QEMU should create a new image, default is
1676 #        'absolute-paths'.
1678 # @speed: #optional the maximum speed, in bytes per second
1680 # @on-source-error: #optional the action to take on an error on the source,
1681 #                   default 'report'.  'stop' and 'enospc' can only be used
1682 #                   if the block device supports io-status (see BlockInfo).
1684 # @on-target-error: #optional the action to take on an error on the target,
1685 #                   default 'report' (no limitations, since this applies to
1686 #                   a different block device than @device).
1688 # Note that @on-source-error and @on-target-error only affect background I/O.
1689 # If an error occurs during a guest write request, the device's rerror/werror
1690 # actions will be used.
1692 # Since: 1.6
1694 { 'type': 'DriveBackup',
1695   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1696             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1697             '*speed': 'int',
1698             '*on-source-error': 'BlockdevOnError',
1699             '*on-target-error': 'BlockdevOnError' } }
1702 # @Abort
1704 # This action can be used to test transaction failure.
1706 # Since: 1.6
1708 { 'type': 'Abort',
1709   'data': { } }
1712 # @TransactionAction
1714 # A discriminated record of operations that can be performed with
1715 # @transaction.
1717 { 'union': 'TransactionAction',
1718   'data': {
1719        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1720        'drive-backup': 'DriveBackup',
1721        'abort': 'Abort'
1722    } }
1725 # @transaction
1727 # Executes a number of transactionable QMP commands atomically. If any
1728 # operation fails, then the entire set of actions will be abandoned and the
1729 # appropriate error returned.
1731 #  List of:
1732 #  @TransactionAction: information needed for the respective operation
1734 # Returns: nothing on success
1735 #          Errors depend on the operations of the transaction
1737 # Note: The transaction aborts on the first failure.  Therefore, there will be
1738 # information on only one failed operation returned in an error condition, and
1739 # subsequent actions will not have been attempted.
1741 # Since 1.1
1743 { 'command': 'transaction',
1744   'data': { 'actions': [ 'TransactionAction' ] } }
1747 # @blockdev-snapshot-sync
1749 # Generates a synchronous snapshot of a block device.
1751 # For the arguments, see the documentation of BlockdevSnapshot.
1753 # Returns: nothing on success
1754 #          If @device is not a valid block device, DeviceNotFound
1756 # Since 0.14.0
1758 { 'command': 'blockdev-snapshot-sync',
1759   'data': 'BlockdevSnapshot' }
1762 # @human-monitor-command:
1764 # Execute a command on the human monitor and return the output.
1766 # @command-line: the command to execute in the human monitor
1768 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1770 # Returns: the output of the command as a string
1772 # Since: 0.14.0
1774 # Notes: This command only exists as a stop-gap.  It's use is highly
1775 #        discouraged.  The semantics of this command are not guaranteed.
1777 #        Known limitations:
1779 #        o This command is stateless, this means that commands that depend
1780 #          on state information (such as getfd) might not work
1782 #       o Commands that prompt the user for data (eg. 'cont' when the block
1783 #         device is encrypted) don't currently work
1785 { 'command': 'human-monitor-command',
1786   'data': {'command-line': 'str', '*cpu-index': 'int'},
1787   'returns': 'str' }
1790 # @block-commit
1792 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1793 # writes data between 'top' and 'base' into 'base'.
1795 # @device:  the name of the device
1797 # @base:   #optional The file name of the backing image to write data into.
1798 #                    If not specified, this is the deepest backing image
1800 # @top:              The file name of the backing image within the image chain,
1801 #                    which contains the topmost data to be committed down.
1802 #                    Note, the active layer as 'top' is currently unsupported.
1804 #                    If top == base, that is an error.
1807 # @speed:  #optional the maximum speed, in bytes per second
1809 # Returns: Nothing on success
1810 #          If commit or stream is already active on this device, DeviceInUse
1811 #          If @device does not exist, DeviceNotFound
1812 #          If image commit is not supported by this device, NotSupported
1813 #          If @base or @top is invalid, a generic error is returned
1814 #          If @top is the active layer, or omitted, a generic error is returned
1815 #          If @speed is invalid, InvalidParameter
1817 # Since: 1.3
1820 { 'command': 'block-commit',
1821   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1822             '*speed': 'int' } }
1825 # @drive-backup
1827 # Start a point-in-time copy of a block device to a new destination.  The
1828 # status of ongoing drive-backup operations can be checked with
1829 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1830 # The operation can be stopped before it has completed using the
1831 # block-job-cancel command.
1833 # For the arguments, see the documentation of DriveBackup.
1835 # Returns: nothing on success
1836 #          If @device is not a valid block device, DeviceNotFound
1838 # Since 1.6
1840 { 'command': 'drive-backup', 'data': 'DriveBackup' }
1843 # @drive-mirror
1845 # Start mirroring a block device's writes to a new destination.
1847 # @device:  the name of the device whose writes should be mirrored.
1849 # @target: the target of the new image. If the file exists, or if it
1850 #          is a device, the existing file/device will be used as the new
1851 #          destination.  If it does not exist, a new file will be created.
1853 # @format: #optional the format of the new destination, default is to
1854 #          probe if @mode is 'existing', else the format of the source
1856 # @mode: #optional whether and how QEMU should create a new image, default is
1857 #        'absolute-paths'.
1859 # @speed:  #optional the maximum speed, in bytes per second
1861 # @sync: what parts of the disk image should be copied to the destination
1862 #        (all the disk, only the sectors allocated in the topmost image, or
1863 #        only new I/O).
1865 # @granularity: #optional granularity of the dirty bitmap, default is 64K
1866 #               if the image format doesn't have clusters, 4K if the clusters
1867 #               are smaller than that, else the cluster size.  Must be a
1868 #               power of 2 between 512 and 64M (since 1.4).
1870 # @buf-size: #optional maximum amount of data in flight from source to
1871 #            target (since 1.4).
1873 # @on-source-error: #optional the action to take on an error on the source,
1874 #                   default 'report'.  'stop' and 'enospc' can only be used
1875 #                   if the block device supports io-status (see BlockInfo).
1877 # @on-target-error: #optional the action to take on an error on the target,
1878 #                   default 'report' (no limitations, since this applies to
1879 #                   a different block device than @device).
1881 # Returns: nothing on success
1882 #          If @device is not a valid block device, DeviceNotFound
1884 # Since 1.3
1886 { 'command': 'drive-mirror',
1887   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1888             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1889             '*speed': 'int', '*granularity': 'uint32',
1890             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1891             '*on-target-error': 'BlockdevOnError' } }
1894 # @migrate_cancel
1896 # Cancel the current executing migration process.
1898 # Returns: nothing on success
1900 # Notes: This command succeeds even if there is no migration process running.
1902 # Since: 0.14.0
1904 { 'command': 'migrate_cancel' }
1907 # @migrate_set_downtime
1909 # Set maximum tolerated downtime for migration.
1911 # @value: maximum downtime in seconds
1913 # Returns: nothing on success
1915 # Since: 0.14.0
1917 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1920 # @migrate_set_speed
1922 # Set maximum speed for migration.
1924 # @value: maximum speed in bytes.
1926 # Returns: nothing on success
1928 # Notes: A value lesser than zero will be automatically round up to zero.
1930 # Since: 0.14.0
1932 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1935 # @migrate-set-cache-size
1937 # Set XBZRLE cache size
1939 # @value: cache size in bytes
1941 # The size will be rounded down to the nearest power of 2.
1942 # The cache size can be modified before and during ongoing migration
1944 # Returns: nothing on success
1946 # Since: 1.2
1948 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1951 # @query-migrate-cache-size
1953 # query XBZRLE cache size
1955 # Returns: XBZRLE cache size in bytes
1957 # Since: 1.2
1959 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1962 # @ObjectPropertyInfo:
1964 # @name: the name of the property
1966 # @type: the type of the property.  This will typically come in one of four
1967 #        forms:
1969 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1970 #           These types are mapped to the appropriate JSON type.
1972 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
1973 #           legacy qdev typename.  These types are always treated as strings.
1975 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
1976 #           device type name.  Child properties create the composition tree.
1978 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
1979 #           device type name.  Link properties form the device model graph.
1981 # Since: 1.2
1983 { 'type': 'ObjectPropertyInfo',
1984   'data': { 'name': 'str', 'type': 'str' } }
1987 # @qom-list:
1989 # This command will list any properties of a object given a path in the object
1990 # model.
1992 # @path: the path within the object model.  See @qom-get for a description of
1993 #        this parameter.
1995 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1996 #          object.
1998 # Since: 1.2
2000 { 'command': 'qom-list',
2001   'data': { 'path': 'str' },
2002   'returns': [ 'ObjectPropertyInfo' ] }
2005 # @qom-get:
2007 # This command will get a property from a object model path and return the
2008 # value.
2010 # @path: The path within the object model.  There are two forms of supported
2011 #        paths--absolute and partial paths.
2013 #        Absolute paths are derived from the root object and can follow child<>
2014 #        or link<> properties.  Since they can follow link<> properties, they
2015 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2016 #        and are prefixed  with a leading slash.
2018 #        Partial paths look like relative filenames.  They do not begin
2019 #        with a prefix.  The matching rules for partial paths are subtle but
2020 #        designed to make specifying objects easy.  At each level of the
2021 #        composition tree, the partial path is matched as an absolute path.
2022 #        The first match is not returned.  At least two matches are searched
2023 #        for.  A successful result is only returned if only one match is
2024 #        found.  If more than one match is found, a flag is return to
2025 #        indicate that the match was ambiguous.
2027 # @property: The property name to read
2029 # Returns: The property value.  The type depends on the property type.  legacy<>
2030 #          properties are returned as #str.  child<> and link<> properties are
2031 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2032 #          are returned as #int.
2034 # Since: 1.2
2036 { 'command': 'qom-get',
2037   'data': { 'path': 'str', 'property': 'str' },
2038   'returns': 'visitor',
2039   'gen': 'no' }
2042 # @qom-set:
2044 # This command will set a property from a object model path.
2046 # @path: see @qom-get for a description of this parameter
2048 # @property: the property name to set
2050 # @value: a value who's type is appropriate for the property type.  See @qom-get
2051 #         for a description of type mapping.
2053 # Since: 1.2
2055 { 'command': 'qom-set',
2056   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2057   'gen': 'no' }
2060 # @set_password:
2062 # Sets the password of a remote display session.
2064 # @protocol: `vnc' to modify the VNC server password
2065 #            `spice' to modify the Spice server password
2067 # @password: the new password
2069 # @connected: #optional how to handle existing clients when changing the
2070 #                       password.  If nothing is specified, defaults to `keep'
2071 #                       `fail' to fail the command if clients are connected
2072 #                       `disconnect' to disconnect existing clients
2073 #                       `keep' to maintain existing clients
2075 # Returns: Nothing on success
2076 #          If Spice is not enabled, DeviceNotFound
2078 # Since: 0.14.0
2080 { 'command': 'set_password',
2081   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2084 # @expire_password:
2086 # Expire the password of a remote display server.
2088 # @protocol: the name of the remote display protocol `vnc' or `spice'
2090 # @time: when to expire the password.
2091 #        `now' to expire the password immediately
2092 #        `never' to cancel password expiration
2093 #        `+INT' where INT is the number of seconds from now (integer)
2094 #        `INT' where INT is the absolute time in seconds
2096 # Returns: Nothing on success
2097 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2099 # Since: 0.14.0
2101 # Notes: Time is relative to the server and currently there is no way to
2102 #        coordinate server time with client time.  It is not recommended to
2103 #        use the absolute time version of the @time parameter unless you're
2104 #        sure you are on the same machine as the QEMU instance.
2106 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2109 # @eject:
2111 # Ejects a device from a removable drive.
2113 # @device:  The name of the device
2115 # @force:   @optional If true, eject regardless of whether the drive is locked.
2116 #           If not specified, the default value is false.
2118 # Returns:  Nothing on success
2119 #           If @device is not a valid block device, DeviceNotFound
2121 # Notes:    Ejecting a device will no media results in success
2123 # Since: 0.14.0
2125 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2128 # @change-vnc-password:
2130 # Change the VNC server password.
2132 # @target:  the new password to use with VNC authentication
2134 # Since: 1.1
2136 # Notes:  An empty password in this command will set the password to the empty
2137 #         string.  Existing clients are unaffected by executing this command.
2139 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2142 # @change:
2144 # This command is multiple commands multiplexed together.
2146 # @device: This is normally the name of a block device but it may also be 'vnc'.
2147 #          when it's 'vnc', then sub command depends on @target
2149 # @target: If @device is a block device, then this is the new filename.
2150 #          If @device is 'vnc', then if the value 'password' selects the vnc
2151 #          change password command.   Otherwise, this specifies a new server URI
2152 #          address to listen to for VNC connections.
2154 # @arg:    If @device is a block device, then this is an optional format to open
2155 #          the device with.
2156 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2157 #          password to set.  If this argument is an empty string, then no future
2158 #          logins will be allowed.
2160 # Returns: Nothing on success.
2161 #          If @device is not a valid block device, DeviceNotFound
2162 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2163 #          if this error is returned, the device has been opened successfully
2164 #          and an additional call to @block_passwd is required to set the
2165 #          device's password.  The behavior of reads and writes to the block
2166 #          device between when these calls are executed is undefined.
2168 # Notes:  It is strongly recommended that this interface is not used especially
2169 #         for changing block devices.
2171 # Since: 0.14.0
2173 { 'command': 'change',
2174   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2177 # @block_set_io_throttle:
2179 # Change I/O throttle limits for a block drive.
2181 # @device: The name of the device
2183 # @bps: total throughput limit in bytes per second
2185 # @bps_rd: read throughput limit in bytes per second
2187 # @bps_wr: write throughput limit in bytes per second
2189 # @iops: total I/O operations per second
2191 # @ops_rd: read I/O operations per second
2193 # @iops_wr: write I/O operations per second
2195 # @bps_max: #optional total max in bytes (Since 1.7)
2197 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2199 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2201 # @iops_max: #optional total I/O operations max (Since 1.7)
2203 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2205 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2207 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2209 # Returns: Nothing on success
2210 #          If @device is not a valid block device, DeviceNotFound
2212 # Since: 1.1
2214 { 'command': 'block_set_io_throttle',
2215   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2216             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2217             '*bps_max': 'int', '*bps_rd_max': 'int',
2218             '*bps_wr_max': 'int', '*iops_max': 'int',
2219             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2220             '*iops_size': 'int' } }
2223 # @block-stream:
2225 # Copy data from a backing file into a block device.
2227 # The block streaming operation is performed in the background until the entire
2228 # backing file has been copied.  This command returns immediately once streaming
2229 # has started.  The status of ongoing block streaming operations can be checked
2230 # with query-block-jobs.  The operation can be stopped before it has completed
2231 # using the block-job-cancel command.
2233 # If a base file is specified then sectors are not copied from that base file and
2234 # its backing chain.  When streaming completes the image file will have the base
2235 # file as its backing file.  This can be used to stream a subset of the backing
2236 # file chain instead of flattening the entire image.
2238 # On successful completion the image file is updated to drop the backing file
2239 # and the BLOCK_JOB_COMPLETED event is emitted.
2241 # @device: the device name
2243 # @base:   #optional the common backing file name
2245 # @speed:  #optional the maximum speed, in bytes per second
2247 # @on-error: #optional the action to take on an error (default report).
2248 #            'stop' and 'enospc' can only be used if the block device
2249 #            supports io-status (see BlockInfo).  Since 1.3.
2251 # Returns: Nothing on success
2252 #          If @device does not exist, DeviceNotFound
2254 # Since: 1.1
2256 { 'command': 'block-stream',
2257   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2258             '*on-error': 'BlockdevOnError' } }
2261 # @block-job-set-speed:
2263 # Set maximum speed for a background block operation.
2265 # This command can only be issued when there is an active block job.
2267 # Throttling can be disabled by setting the speed to 0.
2269 # @device: the device name
2271 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2272 #          Defaults to 0.
2274 # Returns: Nothing on success
2275 #          If no background operation is active on this device, DeviceNotActive
2277 # Since: 1.1
2279 { 'command': 'block-job-set-speed',
2280   'data': { 'device': 'str', 'speed': 'int' } }
2283 # @block-job-cancel:
2285 # Stop an active background block operation.
2287 # This command returns immediately after marking the active background block
2288 # operation for cancellation.  It is an error to call this command if no
2289 # operation is in progress.
2291 # The operation will cancel as soon as possible and then emit the
2292 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2293 # enumerated using query-block-jobs.
2295 # For streaming, the image file retains its backing file unless the streaming
2296 # operation happens to complete just as it is being cancelled.  A new streaming
2297 # operation can be started at a later time to finish copying all data from the
2298 # backing file.
2300 # @device: the device name
2302 # @force: #optional whether to allow cancellation of a paused job (default
2303 #         false).  Since 1.3.
2305 # Returns: Nothing on success
2306 #          If no background operation is active on this device, DeviceNotActive
2308 # Since: 1.1
2310 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2313 # @block-job-pause:
2315 # Pause an active background block operation.
2317 # This command returns immediately after marking the active background block
2318 # operation for pausing.  It is an error to call this command if no
2319 # operation is in progress.  Pausing an already paused job has no cumulative
2320 # effect; a single block-job-resume command will resume the job.
2322 # The operation will pause as soon as possible.  No event is emitted when
2323 # the operation is actually paused.  Cancelling a paused job automatically
2324 # resumes it.
2326 # @device: the device name
2328 # Returns: Nothing on success
2329 #          If no background operation is active on this device, DeviceNotActive
2331 # Since: 1.3
2333 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2336 # @block-job-resume:
2338 # Resume an active background block operation.
2340 # This command returns immediately after resuming a paused background block
2341 # operation.  It is an error to call this command if no operation is in
2342 # progress.  Resuming an already running job is not an error.
2344 # This command also clears the error status of the job.
2346 # @device: the device name
2348 # Returns: Nothing on success
2349 #          If no background operation is active on this device, DeviceNotActive
2351 # Since: 1.3
2353 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2356 # @block-job-complete:
2358 # Manually trigger completion of an active background block operation.  This
2359 # is supported for drive mirroring, where it also switches the device to
2360 # write to the target path only.  The ability to complete is signaled with
2361 # a BLOCK_JOB_READY event.
2363 # This command completes an active background block operation synchronously.
2364 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2365 # is not defined.  Note that if an I/O error occurs during the processing of
2366 # this command: 1) the command itself will fail; 2) the error will be processed
2367 # according to the rerror/werror arguments that were specified when starting
2368 # the operation.
2370 # A cancelled or paused job cannot be completed.
2372 # @device: the device name
2374 # Returns: Nothing on success
2375 #          If no background operation is active on this device, DeviceNotActive
2377 # Since: 1.3
2379 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2382 # @ObjectTypeInfo:
2384 # This structure describes a search result from @qom-list-types
2386 # @name: the type name found in the search
2388 # Since: 1.1
2390 # Notes: This command is experimental and may change syntax in future releases.
2392 { 'type': 'ObjectTypeInfo',
2393   'data': { 'name': 'str' } }
2396 # @qom-list-types:
2398 # This command will return a list of types given search parameters
2400 # @implements: if specified, only return types that implement this type name
2402 # @abstract: if true, include abstract types in the results
2404 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2406 # Since: 1.1
2408 { 'command': 'qom-list-types',
2409   'data': { '*implements': 'str', '*abstract': 'bool' },
2410   'returns': [ 'ObjectTypeInfo' ] }
2413 # @DevicePropertyInfo:
2415 # Information about device properties.
2417 # @name: the name of the property
2418 # @type: the typename of the property
2420 # Since: 1.2
2422 { 'type': 'DevicePropertyInfo',
2423   'data': { 'name': 'str', 'type': 'str' } }
2426 # @device-list-properties:
2428 # List properties associated with a device.
2430 # @typename: the type name of a device
2432 # Returns: a list of DevicePropertyInfo describing a devices properties
2434 # Since: 1.2
2436 { 'command': 'device-list-properties',
2437   'data': { 'typename': 'str'},
2438   'returns': [ 'DevicePropertyInfo' ] }
2441 # @migrate
2443 # Migrates the current running guest to another Virtual Machine.
2445 # @uri: the Uniform Resource Identifier of the destination VM
2447 # @blk: #optional do block migration (full disk copy)
2449 # @inc: #optional incremental disk copy migration
2451 # @detach: this argument exists only for compatibility reasons and
2452 #          is ignored by QEMU
2454 # Returns: nothing on success
2456 # Since: 0.14.0
2458 { 'command': 'migrate',
2459   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2461 # @xen-save-devices-state:
2463 # Save the state of all devices to file. The RAM and the block devices
2464 # of the VM are not saved by this command.
2466 # @filename: the file to save the state of the devices to as binary
2467 # data. See xen-save-devices-state.txt for a description of the binary
2468 # format.
2470 # Returns: Nothing on success
2472 # Since: 1.1
2474 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2477 # @xen-set-global-dirty-log
2479 # Enable or disable the global dirty log mode.
2481 # @enable: true to enable, false to disable.
2483 # Returns: nothing
2485 # Since: 1.3
2487 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2490 # @device_del:
2492 # Remove a device from a guest
2494 # @id: the name of the device
2496 # Returns: Nothing on success
2497 #          If @id is not a valid device, DeviceNotFound
2499 # Notes: When this command completes, the device may not be removed from the
2500 #        guest.  Hot removal is an operation that requires guest cooperation.
2501 #        This command merely requests that the guest begin the hot removal
2502 #        process.  Completion of the device removal process is signaled with a
2503 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2504 #        for all devices.
2506 # Since: 0.14.0
2508 { 'command': 'device_del', 'data': {'id': 'str'} }
2511 # @dump-guest-memory
2513 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2514 # very long depending on the amount of guest memory. This command is only
2515 # supported on i386 and x86_64.
2517 # @paging: if true, do paging to get guest's memory mapping. This allows
2518 #          using gdb to process the core file.
2520 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2521 #                     of RAM. This can happen for a large guest, or a
2522 #                     malicious guest pretending to be large.
2524 #          Also, paging=true has the following limitations:
2526 #             1. The guest may be in a catastrophic state or can have corrupted
2527 #                memory, which cannot be trusted
2528 #             2. The guest can be in real-mode even if paging is enabled. For
2529 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2530 #                goes in real-mode
2532 # @protocol: the filename or file descriptor of the vmcore. The supported
2533 #            protocols are:
2535 #            1. file: the protocol starts with "file:", and the following
2536 #               string is the file's path.
2537 #            2. fd: the protocol starts with "fd:", and the following string
2538 #               is the fd's name.
2540 # @begin: #optional if specified, the starting physical address.
2542 # @length: #optional if specified, the memory size, in bytes. If you don't
2543 #          want to dump all guest's memory, please specify the start @begin
2544 #          and @length
2546 # Returns: nothing on success
2548 # Since: 1.2
2550 { 'command': 'dump-guest-memory',
2551   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2552             '*length': 'int' } }
2555 # @netdev_add:
2557 # Add a network backend.
2559 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2560 #        'vde', 'socket', 'dump' and 'bridge'
2562 # @id: the name of the new network backend
2564 # @props: #optional a list of properties to be passed to the backend in
2565 #         the format 'name=value', like 'ifname=tap0,script=no'
2567 # Notes: The semantics of @props is not well defined.  Future commands will be
2568 #        introduced that provide stronger typing for backend creation.
2570 # Since: 0.14.0
2572 # Returns: Nothing on success
2573 #          If @type is not a valid network backend, DeviceNotFound
2575 { 'command': 'netdev_add',
2576   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2577   'gen': 'no' }
2580 # @netdev_del:
2582 # Remove a network backend.
2584 # @id: the name of the network backend to remove
2586 # Returns: Nothing on success
2587 #          If @id is not a valid network backend, DeviceNotFound
2589 # Since: 0.14.0
2591 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2594 # @NetdevNoneOptions
2596 # Use it alone to have zero network devices.
2598 # Since 1.2
2600 { 'type': 'NetdevNoneOptions',
2601   'data': { } }
2604 # @NetLegacyNicOptions
2606 # Create a new Network Interface Card.
2608 # @netdev: #optional id of -netdev to connect to
2610 # @macaddr: #optional MAC address
2612 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2614 # @addr: #optional PCI device address
2616 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2618 # Since 1.2
2620 { 'type': 'NetLegacyNicOptions',
2621   'data': {
2622     '*netdev':  'str',
2623     '*macaddr': 'str',
2624     '*model':   'str',
2625     '*addr':    'str',
2626     '*vectors': 'uint32' } }
2629 # @String
2631 # A fat type wrapping 'str', to be embedded in lists.
2633 # Since 1.2
2635 { 'type': 'String',
2636   'data': {
2637     'str': 'str' } }
2640 # @NetdevUserOptions
2642 # Use the user mode network stack which requires no administrator privilege to
2643 # run.
2645 # @hostname: #optional client hostname reported by the builtin DHCP server
2647 # @restrict: #optional isolate the guest from the host
2649 # @ip: #optional legacy parameter, use net= instead
2651 # @net: #optional IP address and optional netmask
2653 # @host: #optional guest-visible address of the host
2655 # @tftp: #optional root directory of the built-in TFTP server
2657 # @bootfile: #optional BOOTP filename, for use with tftp=
2659 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2660 #             assign
2662 # @dns: #optional guest-visible address of the virtual nameserver
2664 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2665 #             to the guest
2667 # @smb: #optional root directory of the built-in SMB server
2669 # @smbserver: #optional IP address of the built-in SMB server
2671 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2672 #           endpoints
2674 # @guestfwd: #optional forward guest TCP connections
2676 # Since 1.2
2678 { 'type': 'NetdevUserOptions',
2679   'data': {
2680     '*hostname':  'str',
2681     '*restrict':  'bool',
2682     '*ip':        'str',
2683     '*net':       'str',
2684     '*host':      'str',
2685     '*tftp':      'str',
2686     '*bootfile':  'str',
2687     '*dhcpstart': 'str',
2688     '*dns':       'str',
2689     '*dnssearch': ['String'],
2690     '*smb':       'str',
2691     '*smbserver': 'str',
2692     '*hostfwd':   ['String'],
2693     '*guestfwd':  ['String'] } }
2696 # @NetdevTapOptions
2698 # Connect the host TAP network interface name to the VLAN.
2700 # @ifname: #optional interface name
2702 # @fd: #optional file descriptor of an already opened tap
2704 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2705 # tap
2707 # @script: #optional script to initialize the interface
2709 # @downscript: #optional script to shut down the interface
2711 # @helper: #optional command to execute to configure bridge
2713 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2715 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2717 # @vhost: #optional enable vhost-net network accelerator
2719 # @vhostfd: #optional file descriptor of an already opened vhost net device
2721 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2722 # devices
2724 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2726 # @queues: #optional number of queues to be created for multiqueue capable tap
2728 # Since 1.2
2730 { 'type': 'NetdevTapOptions',
2731   'data': {
2732     '*ifname':     'str',
2733     '*fd':         'str',
2734     '*fds':        'str',
2735     '*script':     'str',
2736     '*downscript': 'str',
2737     '*helper':     'str',
2738     '*sndbuf':     'size',
2739     '*vnet_hdr':   'bool',
2740     '*vhost':      'bool',
2741     '*vhostfd':    'str',
2742     '*vhostfds':   'str',
2743     '*vhostforce': 'bool',
2744     '*queues':     'uint32'} }
2747 # @NetdevSocketOptions
2749 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2750 # socket connection.
2752 # @fd: #optional file descriptor of an already opened socket
2754 # @listen: #optional port number, and optional hostname, to listen on
2756 # @connect: #optional port number, and optional hostname, to connect to
2758 # @mcast: #optional UDP multicast address and port number
2760 # @localaddr: #optional source address and port for multicast and udp packets
2762 # @udp: #optional UDP unicast address and port number
2764 # Since 1.2
2766 { 'type': 'NetdevSocketOptions',
2767   'data': {
2768     '*fd':        'str',
2769     '*listen':    'str',
2770     '*connect':   'str',
2771     '*mcast':     'str',
2772     '*localaddr': 'str',
2773     '*udp':       'str' } }
2776 # @NetdevVdeOptions
2778 # Connect the VLAN to a vde switch running on the host.
2780 # @sock: #optional socket path
2782 # @port: #optional port number
2784 # @group: #optional group owner of socket
2786 # @mode: #optional permissions for socket
2788 # Since 1.2
2790 { 'type': 'NetdevVdeOptions',
2791   'data': {
2792     '*sock':  'str',
2793     '*port':  'uint16',
2794     '*group': 'str',
2795     '*mode':  'uint16' } }
2798 # @NetdevDumpOptions
2800 # Dump VLAN network traffic to a file.
2802 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2803 # suffixes.
2805 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2807 # Since 1.2
2809 { 'type': 'NetdevDumpOptions',
2810   'data': {
2811     '*len':  'size',
2812     '*file': 'str' } }
2815 # @NetdevBridgeOptions
2817 # Connect a host TAP network interface to a host bridge device.
2819 # @br: #optional bridge name
2821 # @helper: #optional command to execute to configure bridge
2823 # Since 1.2
2825 { 'type': 'NetdevBridgeOptions',
2826   'data': {
2827     '*br':     'str',
2828     '*helper': 'str' } }
2831 # @NetdevHubPortOptions
2833 # Connect two or more net clients through a software hub.
2835 # @hubid: hub identifier number
2837 # Since 1.2
2839 { 'type': 'NetdevHubPortOptions',
2840   'data': {
2841     'hubid':     'int32' } }
2844 # @NetClientOptions
2846 # A discriminated record of network device traits.
2848 # Since 1.2
2850 { 'union': 'NetClientOptions',
2851   'data': {
2852     'none':     'NetdevNoneOptions',
2853     'nic':      'NetLegacyNicOptions',
2854     'user':     'NetdevUserOptions',
2855     'tap':      'NetdevTapOptions',
2856     'socket':   'NetdevSocketOptions',
2857     'vde':      'NetdevVdeOptions',
2858     'dump':     'NetdevDumpOptions',
2859     'bridge':   'NetdevBridgeOptions',
2860     'hubport':  'NetdevHubPortOptions' } }
2863 # @NetLegacy
2865 # Captures the configuration of a network device; legacy.
2867 # @vlan: #optional vlan number
2869 # @id: #optional identifier for monitor commands
2871 # @name: #optional identifier for monitor commands, ignored if @id is present
2873 # @opts: device type specific properties (legacy)
2875 # Since 1.2
2877 { 'type': 'NetLegacy',
2878   'data': {
2879     '*vlan': 'int32',
2880     '*id':   'str',
2881     '*name': 'str',
2882     'opts':  'NetClientOptions' } }
2885 # @Netdev
2887 # Captures the configuration of a network device.
2889 # @id: identifier for monitor commands.
2891 # @opts: device type specific properties
2893 # Since 1.2
2895 { 'type': 'Netdev',
2896   'data': {
2897     'id':   'str',
2898     'opts': 'NetClientOptions' } }
2901 # @InetSocketAddress
2903 # Captures a socket address or address range in the Internet namespace.
2905 # @host: host part of the address
2907 # @port: port part of the address, or lowest port if @to is present
2909 # @to: highest port to try
2911 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
2912 #        #optional
2914 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
2915 #        #optional
2917 # Since 1.3
2919 { 'type': 'InetSocketAddress',
2920   'data': {
2921     'host': 'str',
2922     'port': 'str',
2923     '*to': 'uint16',
2924     '*ipv4': 'bool',
2925     '*ipv6': 'bool' } }
2928 # @UnixSocketAddress
2930 # Captures a socket address in the local ("Unix socket") namespace.
2932 # @path: filesystem path to use
2934 # Since 1.3
2936 { 'type': 'UnixSocketAddress',
2937   'data': {
2938     'path': 'str' } }
2941 # @SocketAddress
2943 # Captures the address of a socket, which could also be a named file descriptor
2945 # Since 1.3
2947 { 'union': 'SocketAddress',
2948   'data': {
2949     'inet': 'InetSocketAddress',
2950     'unix': 'UnixSocketAddress',
2951     'fd': 'String' } }
2954 # @getfd:
2956 # Receive a file descriptor via SCM rights and assign it a name
2958 # @fdname: file descriptor name
2960 # Returns: Nothing on success
2962 # Since: 0.14.0
2964 # Notes: If @fdname already exists, the file descriptor assigned to
2965 #        it will be closed and replaced by the received file
2966 #        descriptor.
2967 #        The 'closefd' command can be used to explicitly close the
2968 #        file descriptor when it is no longer needed.
2970 { 'command': 'getfd', 'data': {'fdname': 'str'} }
2973 # @closefd:
2975 # Close a file descriptor previously passed via SCM rights
2977 # @fdname: file descriptor name
2979 # Returns: Nothing on success
2981 # Since: 0.14.0
2983 { 'command': 'closefd', 'data': {'fdname': 'str'} }
2986 # @MachineInfo:
2988 # Information describing a machine.
2990 # @name: the name of the machine
2992 # @alias: #optional an alias for the machine name
2994 # @default: #optional whether the machine is default
2996 # @cpu-max: maximum number of CPUs supported by the machine type
2997 #           (since 1.5.0)
2999 # Since: 1.2.0
3001 { 'type': 'MachineInfo',
3002   'data': { 'name': 'str', '*alias': 'str',
3003             '*is-default': 'bool', 'cpu-max': 'int' } }
3006 # @query-machines:
3008 # Return a list of supported machines
3010 # Returns: a list of MachineInfo
3012 # Since: 1.2.0
3014 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3017 # @CpuDefinitionInfo:
3019 # Virtual CPU definition.
3021 # @name: the name of the CPU definition
3023 # Since: 1.2.0
3025 { 'type': 'CpuDefinitionInfo',
3026   'data': { 'name': 'str' } }
3029 # @query-cpu-definitions:
3031 # Return a list of supported virtual CPU definitions
3033 # Returns: a list of CpuDefInfo
3035 # Since: 1.2.0
3037 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3039 # @AddfdInfo:
3041 # Information about a file descriptor that was added to an fd set.
3043 # @fdset-id: The ID of the fd set that @fd was added to.
3045 # @fd: The file descriptor that was received via SCM rights and
3046 #      added to the fd set.
3048 # Since: 1.2.0
3050 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3053 # @add-fd:
3055 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3057 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3059 # @opaque: #optional A free-form string that can be used to describe the fd.
3061 # Returns: @AddfdInfo on success
3062 #          If file descriptor was not received, FdNotSupplied
3063 #          If @fdset-id is a negative value, InvalidParameterValue
3065 # Notes: The list of fd sets is shared by all monitor connections.
3067 #        If @fdset-id is not specified, a new fd set will be created.
3069 # Since: 1.2.0
3071 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3072   'returns': 'AddfdInfo' }
3075 # @remove-fd:
3077 # Remove a file descriptor from an fd set.
3079 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3081 # @fd: #optional The file descriptor that is to be removed.
3083 # Returns: Nothing on success
3084 #          If @fdset-id or @fd is not found, FdNotFound
3086 # Since: 1.2.0
3088 # Notes: The list of fd sets is shared by all monitor connections.
3090 #        If @fd is not specified, all file descriptors in @fdset-id
3091 #        will be removed.
3093 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3096 # @FdsetFdInfo:
3098 # Information about a file descriptor that belongs to an fd set.
3100 # @fd: The file descriptor value.
3102 # @opaque: #optional A free-form string that can be used to describe the fd.
3104 # Since: 1.2.0
3106 { 'type': 'FdsetFdInfo',
3107   'data': {'fd': 'int', '*opaque': 'str'} }
3110 # @FdsetInfo:
3112 # Information about an fd set.
3114 # @fdset-id: The ID of the fd set.
3116 # @fds: A list of file descriptors that belong to this fd set.
3118 # Since: 1.2.0
3120 { 'type': 'FdsetInfo',
3121   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3124 # @query-fdsets:
3126 # Return information describing all fd sets.
3128 # Returns: A list of @FdsetInfo
3130 # Since: 1.2.0
3132 # Note: The list of fd sets is shared by all monitor connections.
3135 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3138 # @TargetInfo:
3140 # Information describing the QEMU target.
3142 # @arch: the target architecture (eg "x86_64", "i386", etc)
3144 # Since: 1.2.0
3146 { 'type': 'TargetInfo',
3147   'data': { 'arch': 'str' } }
3150 # @query-target:
3152 # Return information about the target for this QEMU
3154 # Returns: TargetInfo
3156 # Since: 1.2.0
3158 { 'command': 'query-target', 'returns': 'TargetInfo' }
3161 # @QKeyCode:
3163 # An enumeration of key name.
3165 # This is used by the send-key command.
3167 # Since: 1.3.0
3169 { 'enum': 'QKeyCode',
3170   'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3171             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3172             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3173             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3174             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3175             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3176             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3177             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3178             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3179             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3180             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3181             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3182             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3183             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3184              'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3187 # @KeyValue
3189 # Represents a keyboard key.
3191 # Since: 1.3.0
3193 { 'union': 'KeyValue',
3194   'data': {
3195     'number': 'int',
3196     'qcode': 'QKeyCode' } }
3199 # @send-key:
3201 # Send keys to guest.
3203 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3204 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3205 #        directly to the guest, while @KeyValue.qcode must be a valid
3206 #        @QKeyCode value
3208 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3209 #             to 100
3211 # Returns: Nothing on success
3212 #          If key is unknown or redundant, InvalidParameter
3214 # Since: 1.3.0
3217 { 'command': 'send-key',
3218   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3221 # @screendump:
3223 # Write a PPM of the VGA screen to a file.
3225 # @filename: the path of a new PPM file to store the image
3227 # Returns: Nothing on success
3229 # Since: 0.14.0
3231 { 'command': 'screendump', 'data': {'filename': 'str'} }
3234 # @nbd-server-start:
3236 # Start an NBD server listening on the given host and port.  Block
3237 # devices can then be exported using @nbd-server-add.  The NBD
3238 # server will present them as named exports; for example, another
3239 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3241 # @addr: Address on which to listen.
3243 # Returns: error if the server is already running.
3245 # Since: 1.3.0
3247 { 'command': 'nbd-server-start',
3248   'data': { 'addr': 'SocketAddress' } }
3251 # @nbd-server-add:
3253 # Export a device to QEMU's embedded NBD server.
3255 # @device: Block device to be exported
3257 # @writable: Whether clients should be able to write to the device via the
3258 #     NBD connection (default false). #optional
3260 # Returns: error if the device is already marked for export.
3262 # Since: 1.3.0
3264 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3267 # @nbd-server-stop:
3269 # Stop QEMU's embedded NBD server, and unregister all devices previously
3270 # added via @nbd-server-add.
3272 # Since: 1.3.0
3274 { 'command': 'nbd-server-stop' }
3277 # @ChardevFile:
3279 # Configuration info for file chardevs.
3281 # @in:  #optional The name of the input file
3282 # @out: The name of the output file
3284 # Since: 1.4
3286 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3287                                    'out' : 'str' } }
3290 # @ChardevHostdev:
3292 # Configuration info for device and pipe chardevs.
3294 # @device: The name of the special file for the device,
3295 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3296 # @type: What kind of device this is.
3298 # Since: 1.4
3300 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3303 # @ChardevSocket:
3305 # Configuration info for (stream) socket chardevs.
3307 # @addr: socket address to listen on (server=true)
3308 #        or connect to (server=false)
3309 # @server: #optional create server socket (default: true)
3310 # @wait: #optional wait for incoming connection on server
3311 #        sockets (default: false).
3312 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3313 # @telnet: #optional enable telnet protocol on server
3314 #          sockets (default: false)
3316 # Since: 1.4
3318 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3319                                      '*server'  : 'bool',
3320                                      '*wait'    : 'bool',
3321                                      '*nodelay' : 'bool',
3322                                      '*telnet'  : 'bool' } }
3325 # @ChardevUdp:
3327 # Configuration info for datagram socket chardevs.
3329 # @remote: remote address
3330 # @local: #optional local address
3332 # Since: 1.5
3334 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3335                                   '*local' : 'SocketAddress' } }
3338 # @ChardevMux:
3340 # Configuration info for mux chardevs.
3342 # @chardev: name of the base chardev.
3344 # Since: 1.5
3346 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3349 # @ChardevStdio:
3351 # Configuration info for stdio chardevs.
3353 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3354 #          be delivered to qemu.  Default: true in -nographic mode,
3355 #          false otherwise.
3357 # Since: 1.5
3359 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3362 # @ChardevSpiceChannel:
3364 # Configuration info for spice vm channel chardevs.
3366 # @type: kind of channel (for example vdagent).
3368 # Since: 1.5
3370 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3373 # @ChardevSpicePort:
3375 # Configuration info for spice port chardevs.
3377 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3379 # Since: 1.5
3381 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3384 # @ChardevVC:
3386 # Configuration info for virtual console chardevs.
3388 # @width:  console width,  in pixels
3389 # @height: console height, in pixels
3390 # @cols:   console width,  in chars
3391 # @rows:   console height, in chars
3393 # Since: 1.5
3395 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3396                                  '*height' : 'int',
3397                                  '*cols'   : 'int',
3398                                  '*rows'   : 'int' } }
3401 # @ChardevRingbuf:
3403 # Configuration info for ring buffer chardevs.
3405 # @size: #optional ring buffer size, must be power of two, default is 65536
3407 # Since: 1.5
3409 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3412 # @ChardevBackend:
3414 # Configuration info for the new chardev backend.
3416 # Since: 1.4
3418 { 'type': 'ChardevDummy', 'data': { } }
3420 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3421                                        'serial' : 'ChardevHostdev',
3422                                        'parallel': 'ChardevHostdev',
3423                                        'pipe'   : 'ChardevHostdev',
3424                                        'socket' : 'ChardevSocket',
3425                                        'udp'    : 'ChardevUdp',
3426                                        'pty'    : 'ChardevDummy',
3427                                        'null'   : 'ChardevDummy',
3428                                        'mux'    : 'ChardevMux',
3429                                        'msmouse': 'ChardevDummy',
3430                                        'braille': 'ChardevDummy',
3431                                        'stdio'  : 'ChardevStdio',
3432                                        'console': 'ChardevDummy',
3433                                        'spicevmc' : 'ChardevSpiceChannel',
3434                                        'spiceport' : 'ChardevSpicePort',
3435                                        'vc'     : 'ChardevVC',
3436                                        'ringbuf': 'ChardevRingbuf',
3437                                        # next one is just for compatibility
3438                                        'memory' : 'ChardevRingbuf' } }
3441 # @ChardevReturn:
3443 # Return info about the chardev backend just created.
3445 # @pty: #optional name of the slave pseudoterminal device, present if
3446 #       and only if a chardev of type 'pty' was created
3448 # Since: 1.4
3450 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3453 # @chardev-add:
3455 # Add a character device backend
3457 # @id: the chardev's ID, must be unique
3458 # @backend: backend type and parameters
3460 # Returns: ChardevReturn.
3462 # Since: 1.4
3464 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3465                                      'backend' : 'ChardevBackend' },
3466   'returns': 'ChardevReturn' }
3469 # @chardev-remove:
3471 # Remove a character device backend
3473 # @id: the chardev's ID, must exist and not be in use
3475 # Returns: Nothing on success
3477 # Since: 1.4
3479 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3482 # @TpmModel:
3484 # An enumeration of TPM models
3486 # @tpm-tis: TPM TIS model
3488 # Since: 1.5
3490 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3493 # @query-tpm-models:
3495 # Return a list of supported TPM models
3497 # Returns: a list of TpmModel
3499 # Since: 1.5
3501 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3504 # @TpmType:
3506 # An enumeration of TPM types
3508 # @passthrough: TPM passthrough type
3510 # Since: 1.5
3512 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3515 # @query-tpm-types:
3517 # Return a list of supported TPM types
3519 # Returns: a list of TpmType
3521 # Since: 1.5
3523 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3526 # @TPMPassthroughOptions:
3528 # Information about the TPM passthrough type
3530 # @path: #optional string describing the path used for accessing the TPM device
3532 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3533 #               for cancellation of TPM commands while they are executing
3535 # Since: 1.5
3537 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3538                                              '*cancel-path' : 'str'} }
3541 # @TpmTypeOptions:
3543 # A union referencing different TPM backend types' configuration options
3545 # @passthrough: The configuration options for the TPM passthrough type
3547 # Since: 1.5
3549 { 'union': 'TpmTypeOptions',
3550    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3553 # @TpmInfo:
3555 # Information about the TPM
3557 # @id: The Id of the TPM
3559 # @model: The TPM frontend model
3561 # @options: The TPM (backend) type configuration options
3563 # Since: 1.5
3565 { 'type': 'TPMInfo',
3566   'data': {'id': 'str',
3567            'model': 'TpmModel',
3568            'options': 'TpmTypeOptions' } }
3571 # @query-tpm:
3573 # Return information about the TPM device
3575 # Returns: @TPMInfo on success
3577 # Since: 1.5
3579 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3582 # @AcpiTableOptions
3584 # Specify an ACPI table on the command line to load.
3586 # At most one of @file and @data can be specified. The list of files specified
3587 # by any one of them is loaded and concatenated in order. If both are omitted,
3588 # @data is implied.
3590 # Other fields / optargs can be used to override fields of the generic ACPI
3591 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3592 # Description Table Header. If a header field is not overridden, then the
3593 # corresponding value from the concatenated blob is used (in case of @file), or
3594 # it is filled in with a hard-coded value (in case of @data).
3596 # String fields are copied into the matching ACPI member from lowest address
3597 # upwards, and silently truncated / NUL-padded to length.
3599 # @sig: #optional table signature / identifier (4 bytes)
3601 # @rev: #optional table revision number (dependent on signature, 1 byte)
3603 # @oem_id: #optional OEM identifier (6 bytes)
3605 # @oem_table_id: #optional OEM table identifier (8 bytes)
3607 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3609 # @asl_compiler_id: #optional identifier of the utility that created the table
3610 #                   (4 bytes)
3612 # @asl_compiler_rev: #optional revision number of the utility that created the
3613 #                    table (4 bytes)
3615 # @file: #optional colon (:) separated list of pathnames to load and
3616 #        concatenate as table data. The resultant binary blob is expected to
3617 #        have an ACPI table header. At least one file is required. This field
3618 #        excludes @data.
3620 # @data: #optional colon (:) separated list of pathnames to load and
3621 #        concatenate as table data. The resultant binary blob must not have an
3622 #        ACPI table header. At least one file is required. This field excludes
3623 #        @file.
3625 # Since 1.5
3627 { 'type': 'AcpiTableOptions',
3628   'data': {
3629     '*sig':               'str',
3630     '*rev':               'uint8',
3631     '*oem_id':            'str',
3632     '*oem_table_id':      'str',
3633     '*oem_rev':           'uint32',
3634     '*asl_compiler_id':   'str',
3635     '*asl_compiler_rev':  'uint32',
3636     '*file':              'str',
3637     '*data':              'str' }}
3640 # @CommandLineParameterType:
3642 # Possible types for an option parameter.
3644 # @string: accepts a character string
3646 # @boolean: accepts "on" or "off"
3648 # @number: accepts a number
3650 # @size: accepts a number followed by an optional suffix (K)ilo,
3651 #        (M)ega, (G)iga, (T)era
3653 # Since 1.5
3655 { 'enum': 'CommandLineParameterType',
3656   'data': ['string', 'boolean', 'number', 'size'] }
3659 # @CommandLineParameterInfo:
3661 # Details about a single parameter of a command line option.
3663 # @name: parameter name
3665 # @type: parameter @CommandLineParameterType
3667 # @help: #optional human readable text string, not suitable for parsing.
3669 # Since 1.5
3671 { 'type': 'CommandLineParameterInfo',
3672   'data': { 'name': 'str',
3673             'type': 'CommandLineParameterType',
3674             '*help': 'str' } }
3677 # @CommandLineOptionInfo:
3679 # Details about a command line option, including its list of parameter details
3681 # @option: option name
3683 # @parameters: an array of @CommandLineParameterInfo
3685 # Since 1.5
3687 { 'type': 'CommandLineOptionInfo',
3688   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3691 # @query-command-line-options:
3693 # Query command line option schema.
3695 # @option: #optional option name
3697 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3698 #          @option).  Returns an error if the given @option doesn't exist.
3700 # Since 1.5
3702 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3703  'returns': ['CommandLineOptionInfo'] }
3706 # @X86CPURegister32
3708 # A X86 32-bit register
3710 # Since: 1.5
3712 { 'enum': 'X86CPURegister32',
3713   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3716 # @X86CPUFeatureWordInfo
3718 # Information about a X86 CPU feature word
3720 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3722 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3723 #                   feature word
3725 # @cpuid-register: Output register containing the feature bits
3727 # @features: value of output register, containing the feature bits
3729 # Since: 1.5
3731 { 'type': 'X86CPUFeatureWordInfo',
3732   'data': { 'cpuid-input-eax': 'int',
3733             '*cpuid-input-ecx': 'int',
3734             'cpuid-register': 'X86CPURegister32',
3735             'features': 'int' } }
3738 # @RxState:
3740 # Packets receiving state
3742 # @normal: filter assigned packets according to the mac-table
3744 # @none: don't receive any assigned packet
3746 # @all: receive all assigned packets
3748 # Since: 1.6
3750 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
3753 # @RxFilterInfo:
3755 # Rx-filter information for a NIC.
3757 # @name: net client name
3759 # @promiscuous: whether promiscuous mode is enabled
3761 # @multicast: multicast receive state
3763 # @unicast: unicast receive state
3765 # @broadcast-allowed: whether to receive broadcast
3767 # @multicast-overflow: multicast table is overflowed or not
3769 # @unicast-overflow: unicast table is overflowed or not
3771 # @main-mac: the main macaddr string
3773 # @vlan-table: a list of active vlan id
3775 # @unicast-table: a list of unicast macaddr string
3777 # @multicast-table: a list of multicast macaddr string
3779 # Since 1.6
3782 { 'type': 'RxFilterInfo',
3783   'data': {
3784     'name':               'str',
3785     'promiscuous':        'bool',
3786     'multicast':          'RxState',
3787     'unicast':            'RxState',
3788     'broadcast-allowed':  'bool',
3789     'multicast-overflow': 'bool',
3790     'unicast-overflow':   'bool',
3791     'main-mac':           'str',
3792     'vlan-table':         ['int'],
3793     'unicast-table':      ['str'],
3794     'multicast-table':    ['str'] }}
3797 # @query-rx-filter:
3799 # Return rx-filter information for all NICs (or for the given NIC).
3801 # @name: #optional net client name
3803 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
3804 #          Returns an error if the given @name doesn't exist, or given
3805 #          NIC doesn't support rx-filter querying, or given net client
3806 #          isn't a NIC.
3808 # Since: 1.6
3810 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
3811   'returns': ['RxFilterInfo'] }