pseries: Fix stalls on hypervisor virtual console
[qemu/ar7.git] / qapi-schema.json
bloba51f7d2d6ebc1b2979e3e72ed167e7678b492c9b
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 # Since: 0.14.0
790 # Notes: This interface is only found in @BlockInfo.
792 { 'type': 'BlockDeviceInfo',
793   'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
794             '*backing_file': 'str', 'backing_file_depth': 'int',
795             'encrypted': 'bool', 'encryption_key_missing': 'bool',
796             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
797             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
798             'image': 'ImageInfo' } }
801 # @BlockDeviceIoStatus:
803 # An enumeration of block device I/O status.
805 # @ok: The last I/O operation has succeeded
807 # @failed: The last I/O operation has failed
809 # @nospace: The last I/O operation has failed due to a no-space condition
811 # Since: 1.0
813 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
816 # @BlockDirtyInfo:
818 # Block dirty bitmap information.
820 # @count: number of dirty bytes according to the dirty bitmap
822 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
824 # Since: 1.3
826 { 'type': 'BlockDirtyInfo',
827   'data': {'count': 'int', 'granularity': 'int'} }
830 # @BlockInfo:
832 # Block device information.  This structure describes a virtual device and
833 # the backing device associated with it.
835 # @device: The device name associated with the virtual device.
837 # @type: This field is returned only for compatibility reasons, it should
838 #        not be used (always returns 'unknown')
840 # @removable: True if the device supports removable media.
842 # @locked: True if the guest has locked this device from having its media
843 #          removed
845 # @tray_open: #optional True if the device has a tray and it is open
846 #             (only present if removable is true)
848 # @dirty: #optional dirty bitmap information (only present if the dirty
849 #         bitmap is enabled)
851 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
852 #             supports it and the VM is configured to stop on errors
854 # @inserted: #optional @BlockDeviceInfo describing the device if media is
855 #            present
857 # Since:  0.14.0
859 { 'type': 'BlockInfo',
860   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
861            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
862            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
863            '*dirty': 'BlockDirtyInfo' } }
866 # @query-block:
868 # Get a list of BlockInfo for all virtual block devices.
870 # Returns: a list of @BlockInfo describing each virtual block device
872 # Since: 0.14.0
874 { 'command': 'query-block', 'returns': ['BlockInfo'] }
877 # @BlockDeviceStats:
879 # Statistics of a virtual block device or a block backing device.
881 # @rd_bytes:      The number of bytes read by the device.
883 # @wr_bytes:      The number of bytes written by the device.
885 # @rd_operations: The number of read operations performed by the device.
887 # @wr_operations: The number of write operations performed by the device.
889 # @flush_operations: The number of cache flush operations performed by the
890 #                    device (since 0.15.0)
892 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
893 #                       (since 0.15.0).
895 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
897 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
899 # @wr_highest_offset: The offset after the greatest byte written to the
900 #                     device.  The intended use of this information is for
901 #                     growable sparse files (like qcow2) that are used on top
902 #                     of a physical device.
904 # Since: 0.14.0
906 { 'type': 'BlockDeviceStats',
907   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
908            'wr_operations': 'int', 'flush_operations': 'int',
909            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
910            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
913 # @BlockStats:
915 # Statistics of a virtual block device or a block backing device.
917 # @device: #optional If the stats are for a virtual block device, the name
918 #          corresponding to the virtual block device.
920 # @stats:  A @BlockDeviceStats for the device.
922 # @parent: #optional This may point to the backing block device if this is a
923 #          a virtual block device.  If it's a backing block, this will point
924 #          to the backing file is one is present.
926 # Since: 0.14.0
928 { 'type': 'BlockStats',
929   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
930            '*parent': 'BlockStats'} }
933 # @query-blockstats:
935 # Query the @BlockStats for all virtual block devices.
937 # Returns: A list of @BlockStats for each virtual block devices.
939 # Since: 0.14.0
941 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
944 # @VncClientInfo:
946 # Information about a connected VNC client.
948 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
949 #        when possible.
951 # @family: 'ipv6' if the client is connected via IPv6 and TCP
952 #          'ipv4' if the client is connected via IPv4 and TCP
953 #          'unix' if the client is connected via a unix domain socket
954 #          'unknown' otherwise
956 # @service: The service name of the client's port.  This may depends on the
957 #           host system's service database so symbolic names should not be
958 #           relied on.
960 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
961 #              Name of the client.
963 # @sasl_username: #optional If SASL authentication is in use, the SASL username
964 #                 used for authentication.
966 # Since: 0.14.0
968 { 'type': 'VncClientInfo',
969   'data': {'host': 'str', 'family': 'str', 'service': 'str',
970            '*x509_dname': 'str', '*sasl_username': 'str'} }
973 # @VncInfo:
975 # Information about the VNC session.
977 # @enabled: true if the VNC server is enabled, false otherwise
979 # @host: #optional The hostname the VNC server is bound to.  This depends on
980 #        the name resolution on the host and may be an IP address.
982 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
983 #                    'ipv4' if the host is listening for IPv4 connections
984 #                    'unix' if the host is listening on a unix domain socket
985 #                    'unknown' otherwise
987 # @service: #optional The service name of the server's port.  This may depends
988 #           on the host system's service database so symbolic names should not
989 #           be relied on.
991 # @auth: #optional the current authentication type used by the server
992 #        'none' if no authentication is being used
993 #        'vnc' if VNC authentication is being used
994 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
995 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
996 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
997 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
998 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
999 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1000 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1001 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1002 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1004 # @clients: a list of @VncClientInfo of all currently connected clients
1006 # Since: 0.14.0
1008 { 'type': 'VncInfo',
1009   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1010            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1013 # @query-vnc:
1015 # Returns information about the current VNC server
1017 # Returns: @VncInfo
1019 # Since: 0.14.0
1021 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1024 # @SpiceChannel
1026 # Information about a SPICE client channel.
1028 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1029 #        when possible.
1031 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1032 #          'ipv4' if the client is connected via IPv4 and TCP
1033 #          'unix' if the client is connected via a unix domain socket
1034 #          'unknown' otherwise
1036 # @port: The client's port number.
1038 # @connection-id: SPICE connection id number.  All channels with the same id
1039 #                 belong to the same SPICE session.
1041 # @connection-type: SPICE channel type number.  "1" is the main control
1042 #                   channel, filter for this one if you want to track spice
1043 #                   sessions only
1045 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1046 #              multiple channels of the same type exist, such as multiple
1047 #              display channels in a multihead setup
1049 # @tls: true if the channel is encrypted, false otherwise.
1051 # Since: 0.14.0
1053 { 'type': 'SpiceChannel',
1054   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1055            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1056            'tls': 'bool'} }
1059 # @SpiceQueryMouseMode
1061 # An enumeration of Spice mouse states.
1063 # @client: Mouse cursor position is determined by the client.
1065 # @server: Mouse cursor position is determined by the server.
1067 # @unknown: No information is available about mouse mode used by
1068 #           the spice server.
1070 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1072 # Since: 1.1
1074 { 'enum': 'SpiceQueryMouseMode',
1075   'data': [ 'client', 'server', 'unknown' ] }
1078 # @SpiceInfo
1080 # Information about the SPICE session.
1082 # @enabled: true if the SPICE server is enabled, false otherwise
1084 # @migrated: true if the last guest migration completed and spice
1085 #            migration had completed as well. false otherwise.
1087 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1088 #        the name resolution on the host and may be an IP address.
1090 # @port: #optional The SPICE server's port number.
1092 # @compiled-version: #optional SPICE server version.
1094 # @tls-port: #optional The SPICE server's TLS port number.
1096 # @auth: #optional the current authentication type used by the server
1097 #        'none'  if no authentication is being used
1098 #        'spice' uses SASL or direct TLS authentication, depending on command
1099 #                line options
1101 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1102 #              be determined by the client or the server, or unknown if spice
1103 #              server doesn't provide this information.
1105 #              Since: 1.1
1107 # @channels: a list of @SpiceChannel for each active spice channel
1109 # Since: 0.14.0
1111 { 'type': 'SpiceInfo',
1112   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1113            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1114            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1117 # @query-spice
1119 # Returns information about the current SPICE server
1121 # Returns: @SpiceInfo
1123 # Since: 0.14.0
1125 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1128 # @BalloonInfo:
1130 # Information about the guest balloon device.
1132 # @actual: the number of bytes the balloon currently contains
1134 # Since: 0.14.0
1137 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1140 # @query-balloon:
1142 # Return information about the balloon device.
1144 # Returns: @BalloonInfo on success
1145 #          If the balloon driver is enabled but not functional because the KVM
1146 #          kernel module cannot support it, KvmMissingCap
1147 #          If no balloon device is present, DeviceNotActive
1149 # Since: 0.14.0
1151 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1154 # @PciMemoryRange:
1156 # A PCI device memory region
1158 # @base: the starting address (guest physical)
1160 # @limit: the ending address (guest physical)
1162 # Since: 0.14.0
1164 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1167 # @PciMemoryRegion
1169 # Information about a PCI device I/O region.
1171 # @bar: the index of the Base Address Register for this region
1173 # @type: 'io' if the region is a PIO region
1174 #        'memory' if the region is a MMIO region
1176 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1178 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1180 # Since: 0.14.0
1182 { 'type': 'PciMemoryRegion',
1183   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1184            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1187 # @PciBridgeInfo:
1189 # Information about a PCI Bridge device
1191 # @bus.number: primary bus interface number.  This should be the number of the
1192 #              bus the device resides on.
1194 # @bus.secondary: secondary bus interface number.  This is the number of the
1195 #                 main bus for the bridge
1197 # @bus.subordinate: This is the highest number bus that resides below the
1198 #                   bridge.
1200 # @bus.io_range: The PIO range for all devices on this bridge
1202 # @bus.memory_range: The MMIO range for all devices on this bridge
1204 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1205 #                          this bridge
1207 # @devices: a list of @PciDeviceInfo for each device on this bridge
1209 # Since: 0.14.0
1211 { 'type': 'PciBridgeInfo',
1212   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1213                     'io_range': 'PciMemoryRange',
1214                     'memory_range': 'PciMemoryRange',
1215                     'prefetchable_range': 'PciMemoryRange' },
1216            '*devices': ['PciDeviceInfo']} }
1219 # @PciDeviceInfo:
1221 # Information about a PCI device
1223 # @bus: the bus number of the device
1225 # @slot: the slot the device is located in
1227 # @function: the function of the slot used by the device
1229 # @class_info.desc: #optional a string description of the device's class
1231 # @class_info.class: the class code of the device
1233 # @id.device: the PCI device id
1235 # @id.vendor: the PCI vendor id
1237 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1239 # @qdev_id: the device name of the PCI device
1241 # @pci_bridge: if the device is a PCI bridge, the bridge information
1243 # @regions: a list of the PCI I/O regions associated with the device
1245 # Notes: the contents of @class_info.desc are not stable and should only be
1246 #        treated as informational.
1248 # Since: 0.14.0
1250 { 'type': 'PciDeviceInfo',
1251   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1252            'class_info': {'*desc': 'str', 'class': 'int'},
1253            'id': {'device': 'int', 'vendor': 'int'},
1254            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1255            'regions': ['PciMemoryRegion']} }
1258 # @PciInfo:
1260 # Information about a PCI bus
1262 # @bus: the bus index
1264 # @devices: a list of devices on this bus
1266 # Since: 0.14.0
1268 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1271 # @query-pci:
1273 # Return information about the PCI bus topology of the guest.
1275 # Returns: a list of @PciInfo for each PCI bus
1277 # Since: 0.14.0
1279 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1282 # @BlockdevOnError:
1284 # An enumeration of possible behaviors for errors on I/O operations.
1285 # The exact meaning depends on whether the I/O was initiated by a guest
1286 # or by a block job
1288 # @report: for guest operations, report the error to the guest;
1289 #          for jobs, cancel the job
1291 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1292 #          or BLOCK_JOB_ERROR)
1294 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1296 # @stop: for guest operations, stop the virtual machine;
1297 #        for jobs, pause the job
1299 # Since: 1.3
1301 { 'enum': 'BlockdevOnError',
1302   'data': ['report', 'ignore', 'enospc', 'stop'] }
1305 # @MirrorSyncMode:
1307 # An enumeration of possible behaviors for the initial synchronization
1308 # phase of storage mirroring.
1310 # @top: copies data in the topmost image to the destination
1312 # @full: copies data from all images to the destination
1314 # @none: only copy data written from now on
1316 # Since: 1.3
1318 { 'enum': 'MirrorSyncMode',
1319   'data': ['top', 'full', 'none'] }
1322 # @BlockJobInfo:
1324 # Information about a long-running block device operation.
1326 # @type: the job type ('stream' for image streaming)
1328 # @device: the block device name
1330 # @len: the maximum progress value
1332 # @busy: false if the job is known to be in a quiescent state, with
1333 #        no pending I/O.  Since 1.3.
1335 # @paused: whether the job is paused or, if @busy is true, will
1336 #          pause itself as soon as possible.  Since 1.3.
1338 # @offset: the current progress value
1340 # @speed: the rate limit, bytes per second
1342 # @io-status: the status of the job (since 1.3)
1344 # Since: 1.1
1346 { 'type': 'BlockJobInfo',
1347   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1348            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1349            'io-status': 'BlockDeviceIoStatus'} }
1352 # @query-block-jobs:
1354 # Return information about long-running block device operations.
1356 # Returns: a list of @BlockJobInfo for each active block job
1358 # Since: 1.1
1360 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1363 # @quit:
1365 # This command will cause the QEMU process to exit gracefully.  While every
1366 # attempt is made to send the QMP response before terminating, this is not
1367 # guaranteed.  When using this interface, a premature EOF would not be
1368 # unexpected.
1370 # Since: 0.14.0
1372 { 'command': 'quit' }
1375 # @stop:
1377 # Stop all guest VCPU execution.
1379 # Since:  0.14.0
1381 # Notes:  This function will succeed even if the guest is already in the stopped
1382 #         state.  In "inmigrate" state, it will ensure that the guest
1383 #         remains paused once migration finishes, as if the -S option was
1384 #         passed on the command line.
1386 { 'command': 'stop' }
1389 # @system_reset:
1391 # Performs a hard reset of a guest.
1393 # Since: 0.14.0
1395 { 'command': 'system_reset' }
1398 # @system_powerdown:
1400 # Requests that a guest perform a powerdown operation.
1402 # Since: 0.14.0
1404 # Notes: A guest may or may not respond to this command.  This command
1405 #        returning does not indicate that a guest has accepted the request or
1406 #        that it has shut down.  Many guests will respond to this command by
1407 #        prompting the user in some way.
1409 { 'command': 'system_powerdown' }
1412 # @cpu:
1414 # This command is a nop that is only provided for the purposes of compatibility.
1416 # Since: 0.14.0
1418 # Notes: Do not use this command.
1420 { 'command': 'cpu', 'data': {'index': 'int'} }
1423 # @cpu-add
1425 # Adds CPU with specified ID
1427 # @id: ID of CPU to be created, valid values [0..max_cpus)
1429 # Returns: Nothing on success
1431 # Since 1.5
1433 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1436 # @memsave:
1438 # Save a portion of guest memory to a file.
1440 # @val: the virtual address of the guest to start from
1442 # @size: the size of memory region to save
1444 # @filename: the file to save the memory to as binary data
1446 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1447 #                       virtual address (defaults to CPU 0)
1449 # Returns: Nothing on success
1451 # Since: 0.14.0
1453 # Notes: Errors were not reliably returned until 1.1
1455 { 'command': 'memsave',
1456   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1459 # @pmemsave:
1461 # Save a portion of guest physical memory to a file.
1463 # @val: the physical address of the guest to start from
1465 # @size: the size of memory region to save
1467 # @filename: the file to save the memory to as binary data
1469 # Returns: Nothing on success
1471 # Since: 0.14.0
1473 # Notes: Errors were not reliably returned until 1.1
1475 { 'command': 'pmemsave',
1476   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1479 # @cont:
1481 # Resume guest VCPU execution.
1483 # Since:  0.14.0
1485 # Returns:  If successful, nothing
1486 #           If QEMU was started with an encrypted block device and a key has
1487 #              not yet been set, DeviceEncrypted.
1489 # Notes:  This command will succeed if the guest is currently running.  It
1490 #         will also succeed if the guest is in the "inmigrate" state; in
1491 #         this case, the effect of the command is to make sure the guest
1492 #         starts once migration finishes, removing the effect of the -S
1493 #         command line option if it was passed.
1495 { 'command': 'cont' }
1498 # @system_wakeup:
1500 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1502 # Since:  1.1
1504 # Returns:  nothing.
1506 { 'command': 'system_wakeup' }
1509 # @inject-nmi:
1511 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1513 # Returns:  If successful, nothing
1515 # Since:  0.14.0
1517 # Notes: Only x86 Virtual Machines support this command.
1519 { 'command': 'inject-nmi' }
1522 # @set_link:
1524 # Sets the link status of a virtual network adapter.
1526 # @name: the device name of the virtual network adapter
1528 # @up: true to set the link status to be up
1530 # Returns: Nothing on success
1531 #          If @name is not a valid network device, DeviceNotFound
1533 # Since: 0.14.0
1535 # Notes: Not all network adapters support setting link status.  This command
1536 #        will succeed even if the network adapter does not support link status
1537 #        notification.
1539 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1542 # @block_passwd:
1544 # This command sets the password of a block device that has not been open
1545 # with a password and requires one.
1547 # The two cases where this can happen are a block device is created through
1548 # QEMU's initial command line or a block device is changed through the legacy
1549 # @change interface.
1551 # In the event that the block device is created through the initial command
1552 # line, the VM will start in the stopped state regardless of whether '-S' is
1553 # used.  The intention is for a management tool to query the block devices to
1554 # determine which ones are encrypted, set the passwords with this command, and
1555 # then start the guest with the @cont command.
1557 # @device:   the name of the device to set the password on
1559 # @password: the password to use for the device
1561 # Returns: nothing on success
1562 #          If @device is not a valid block device, DeviceNotFound
1563 #          If @device is not encrypted, DeviceNotEncrypted
1565 # Notes:  Not all block formats support encryption and some that do are not
1566 #         able to validate that a password is correct.  Disk corruption may
1567 #         occur if an invalid password is specified.
1569 # Since: 0.14.0
1571 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1574 # @balloon:
1576 # Request the balloon driver to change its balloon size.
1578 # @value: the target size of the balloon in bytes
1580 # Returns: Nothing on success
1581 #          If the balloon driver is enabled but not functional because the KVM
1582 #            kernel module cannot support it, KvmMissingCap
1583 #          If no balloon device is present, DeviceNotActive
1585 # Notes: This command just issues a request to the guest.  When it returns,
1586 #        the balloon size may not have changed.  A guest can change the balloon
1587 #        size independent of this command.
1589 # Since: 0.14.0
1591 { 'command': 'balloon', 'data': {'value': 'int'} }
1594 # @block_resize
1596 # Resize a block image while a guest is running.
1598 # @device:  the name of the device to get the image resized
1600 # @size:  new image size in bytes
1602 # Returns: nothing on success
1603 #          If @device is not a valid block device, DeviceNotFound
1605 # Since: 0.14.0
1607 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1610 # @NewImageMode
1612 # An enumeration that tells QEMU how to set the backing file path in
1613 # a new image file.
1615 # @existing: QEMU should look for an existing image file.
1617 # @absolute-paths: QEMU should create a new image with absolute paths
1618 # for the backing file.
1620 # Since: 1.1
1622 { 'enum': 'NewImageMode',
1623   'data': [ 'existing', 'absolute-paths' ] }
1626 # @BlockdevSnapshot
1628 # @device:  the name of the device to generate the snapshot from.
1630 # @snapshot-file: the target of the new image. A new file will be created.
1632 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1634 # @mode: #optional whether and how QEMU should create a new image, default is
1635 #        'absolute-paths'.
1637 { 'type': 'BlockdevSnapshot',
1638   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1639             '*mode': 'NewImageMode' } }
1642 # @DriveBackup
1644 # @device: the name of the device which should be copied.
1646 # @target: the target of the new image. If the file exists, or if it
1647 #          is a device, the existing file/device will be used as the new
1648 #          destination.  If it does not exist, a new file will be created.
1650 # @format: #optional the format of the new destination, default is to
1651 #          probe if @mode is 'existing', else the format of the source
1653 # @sync: what parts of the disk image should be copied to the destination
1654 #        (all the disk, only the sectors allocated in the topmost image, or
1655 #        only new I/O).
1657 # @mode: #optional whether and how QEMU should create a new image, default is
1658 #        'absolute-paths'.
1660 # @speed: #optional the maximum speed, in bytes per second
1662 # @on-source-error: #optional the action to take on an error on the source,
1663 #                   default 'report'.  'stop' and 'enospc' can only be used
1664 #                   if the block device supports io-status (see BlockInfo).
1666 # @on-target-error: #optional the action to take on an error on the target,
1667 #                   default 'report' (no limitations, since this applies to
1668 #                   a different block device than @device).
1670 # Note that @on-source-error and @on-target-error only affect background I/O.
1671 # If an error occurs during a guest write request, the device's rerror/werror
1672 # actions will be used.
1674 # Since: 1.6
1676 { 'type': 'DriveBackup',
1677   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1678             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1679             '*speed': 'int',
1680             '*on-source-error': 'BlockdevOnError',
1681             '*on-target-error': 'BlockdevOnError' } }
1684 # @Abort
1686 # This action can be used to test transaction failure.
1688 # Since: 1.6
1690 { 'type': 'Abort',
1691   'data': { } }
1694 # @TransactionAction
1696 # A discriminated record of operations that can be performed with
1697 # @transaction.
1699 { 'union': 'TransactionAction',
1700   'data': {
1701        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1702        'drive-backup': 'DriveBackup',
1703        'abort': 'Abort'
1704    } }
1707 # @transaction
1709 # Executes a number of transactionable QMP commands atomically. If any
1710 # operation fails, then the entire set of actions will be abandoned and the
1711 # appropriate error returned.
1713 #  List of:
1714 #  @TransactionAction: information needed for the respective operation
1716 # Returns: nothing on success
1717 #          Errors depend on the operations of the transaction
1719 # Note: The transaction aborts on the first failure.  Therefore, there will be
1720 # information on only one failed operation returned in an error condition, and
1721 # subsequent actions will not have been attempted.
1723 # Since 1.1
1725 { 'command': 'transaction',
1726   'data': { 'actions': [ 'TransactionAction' ] } }
1729 # @blockdev-snapshot-sync
1731 # Generates a synchronous snapshot of a block device.
1733 # For the arguments, see the documentation of BlockdevSnapshot.
1735 # Returns: nothing on success
1736 #          If @device is not a valid block device, DeviceNotFound
1738 # Since 0.14.0
1740 { 'command': 'blockdev-snapshot-sync',
1741   'data': 'BlockdevSnapshot' }
1744 # @human-monitor-command:
1746 # Execute a command on the human monitor and return the output.
1748 # @command-line: the command to execute in the human monitor
1750 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1752 # Returns: the output of the command as a string
1754 # Since: 0.14.0
1756 # Notes: This command only exists as a stop-gap.  It's use is highly
1757 #        discouraged.  The semantics of this command are not guaranteed.
1759 #        Known limitations:
1761 #        o This command is stateless, this means that commands that depend
1762 #          on state information (such as getfd) might not work
1764 #       o Commands that prompt the user for data (eg. 'cont' when the block
1765 #         device is encrypted) don't currently work
1767 { 'command': 'human-monitor-command',
1768   'data': {'command-line': 'str', '*cpu-index': 'int'},
1769   'returns': 'str' }
1772 # @block-commit
1774 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1775 # writes data between 'top' and 'base' into 'base'.
1777 # @device:  the name of the device
1779 # @base:   #optional The file name of the backing image to write data into.
1780 #                    If not specified, this is the deepest backing image
1782 # @top:              The file name of the backing image within the image chain,
1783 #                    which contains the topmost data to be committed down.
1784 #                    Note, the active layer as 'top' is currently unsupported.
1786 #                    If top == base, that is an error.
1789 # @speed:  #optional the maximum speed, in bytes per second
1791 # Returns: Nothing on success
1792 #          If commit or stream is already active on this device, DeviceInUse
1793 #          If @device does not exist, DeviceNotFound
1794 #          If image commit is not supported by this device, NotSupported
1795 #          If @base or @top is invalid, a generic error is returned
1796 #          If @top is the active layer, or omitted, a generic error is returned
1797 #          If @speed is invalid, InvalidParameter
1799 # Since: 1.3
1802 { 'command': 'block-commit',
1803   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1804             '*speed': 'int' } }
1807 # @drive-backup
1809 # Start a point-in-time copy of a block device to a new destination.  The
1810 # status of ongoing drive-backup operations can be checked with
1811 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1812 # The operation can be stopped before it has completed using the
1813 # block-job-cancel command.
1815 # For the arguments, see the documentation of DriveBackup.
1817 # Returns: nothing on success
1818 #          If @device is not a valid block device, DeviceNotFound
1820 # Since 1.6
1822 { 'command': 'drive-backup', 'data': 'DriveBackup' }
1825 # @drive-mirror
1827 # Start mirroring a block device's writes to a new destination.
1829 # @device:  the name of the device whose writes should be mirrored.
1831 # @target: the target of the new image. If the file exists, or if it
1832 #          is a device, the existing file/device will be used as the new
1833 #          destination.  If it does not exist, a new file will be created.
1835 # @format: #optional the format of the new destination, default is to
1836 #          probe if @mode is 'existing', else the format of the source
1838 # @mode: #optional whether and how QEMU should create a new image, default is
1839 #        'absolute-paths'.
1841 # @speed:  #optional the maximum speed, in bytes per second
1843 # @sync: what parts of the disk image should be copied to the destination
1844 #        (all the disk, only the sectors allocated in the topmost image, or
1845 #        only new I/O).
1847 # @granularity: #optional granularity of the dirty bitmap, default is 64K
1848 #               if the image format doesn't have clusters, 4K if the clusters
1849 #               are smaller than that, else the cluster size.  Must be a
1850 #               power of 2 between 512 and 64M (since 1.4).
1852 # @buf-size: #optional maximum amount of data in flight from source to
1853 #            target (since 1.4).
1855 # @on-source-error: #optional the action to take on an error on the source,
1856 #                   default 'report'.  'stop' and 'enospc' can only be used
1857 #                   if the block device supports io-status (see BlockInfo).
1859 # @on-target-error: #optional the action to take on an error on the target,
1860 #                   default 'report' (no limitations, since this applies to
1861 #                   a different block device than @device).
1863 # Returns: nothing on success
1864 #          If @device is not a valid block device, DeviceNotFound
1866 # Since 1.3
1868 { 'command': 'drive-mirror',
1869   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1870             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1871             '*speed': 'int', '*granularity': 'uint32',
1872             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
1873             '*on-target-error': 'BlockdevOnError' } }
1876 # @migrate_cancel
1878 # Cancel the current executing migration process.
1880 # Returns: nothing on success
1882 # Notes: This command succeeds even if there is no migration process running.
1884 # Since: 0.14.0
1886 { 'command': 'migrate_cancel' }
1889 # @migrate_set_downtime
1891 # Set maximum tolerated downtime for migration.
1893 # @value: maximum downtime in seconds
1895 # Returns: nothing on success
1897 # Since: 0.14.0
1899 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
1902 # @migrate_set_speed
1904 # Set maximum speed for migration.
1906 # @value: maximum speed in bytes.
1908 # Returns: nothing on success
1910 # Notes: A value lesser than zero will be automatically round up to zero.
1912 # Since: 0.14.0
1914 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
1917 # @migrate-set-cache-size
1919 # Set XBZRLE cache size
1921 # @value: cache size in bytes
1923 # The size will be rounded down to the nearest power of 2.
1924 # The cache size can be modified before and during ongoing migration
1926 # Returns: nothing on success
1928 # Since: 1.2
1930 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1933 # @query-migrate-cache-size
1935 # query XBZRLE cache size
1937 # Returns: XBZRLE cache size in bytes
1939 # Since: 1.2
1941 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
1944 # @ObjectPropertyInfo:
1946 # @name: the name of the property
1948 # @type: the type of the property.  This will typically come in one of four
1949 #        forms:
1951 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1952 #           These types are mapped to the appropriate JSON type.
1954 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
1955 #           legacy qdev typename.  These types are always treated as strings.
1957 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
1958 #           device type name.  Child properties create the composition tree.
1960 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
1961 #           device type name.  Link properties form the device model graph.
1963 # Since: 1.2
1965 { 'type': 'ObjectPropertyInfo',
1966   'data': { 'name': 'str', 'type': 'str' } }
1969 # @qom-list:
1971 # This command will list any properties of a object given a path in the object
1972 # model.
1974 # @path: the path within the object model.  See @qom-get for a description of
1975 #        this parameter.
1977 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
1978 #          object.
1980 # Since: 1.2
1982 { 'command': 'qom-list',
1983   'data': { 'path': 'str' },
1984   'returns': [ 'ObjectPropertyInfo' ] }
1987 # @qom-get:
1989 # This command will get a property from a object model path and return the
1990 # value.
1992 # @path: The path within the object model.  There are two forms of supported
1993 #        paths--absolute and partial paths.
1995 #        Absolute paths are derived from the root object and can follow child<>
1996 #        or link<> properties.  Since they can follow link<> properties, they
1997 #        can be arbitrarily long.  Absolute paths look like absolute filenames
1998 #        and are prefixed  with a leading slash.
2000 #        Partial paths look like relative filenames.  They do not begin
2001 #        with a prefix.  The matching rules for partial paths are subtle but
2002 #        designed to make specifying objects easy.  At each level of the
2003 #        composition tree, the partial path is matched as an absolute path.
2004 #        The first match is not returned.  At least two matches are searched
2005 #        for.  A successful result is only returned if only one match is
2006 #        found.  If more than one match is found, a flag is return to
2007 #        indicate that the match was ambiguous.
2009 # @property: The property name to read
2011 # Returns: The property value.  The type depends on the property type.  legacy<>
2012 #          properties are returned as #str.  child<> and link<> properties are
2013 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2014 #          are returned as #int.
2016 # Since: 1.2
2018 { 'command': 'qom-get',
2019   'data': { 'path': 'str', 'property': 'str' },
2020   'returns': 'visitor',
2021   'gen': 'no' }
2024 # @qom-set:
2026 # This command will set a property from a object model path.
2028 # @path: see @qom-get for a description of this parameter
2030 # @property: the property name to set
2032 # @value: a value who's type is appropriate for the property type.  See @qom-get
2033 #         for a description of type mapping.
2035 # Since: 1.2
2037 { 'command': 'qom-set',
2038   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2039   'gen': 'no' }
2042 # @set_password:
2044 # Sets the password of a remote display session.
2046 # @protocol: `vnc' to modify the VNC server password
2047 #            `spice' to modify the Spice server password
2049 # @password: the new password
2051 # @connected: #optional how to handle existing clients when changing the
2052 #                       password.  If nothing is specified, defaults to `keep'
2053 #                       `fail' to fail the command if clients are connected
2054 #                       `disconnect' to disconnect existing clients
2055 #                       `keep' to maintain existing clients
2057 # Returns: Nothing on success
2058 #          If Spice is not enabled, DeviceNotFound
2060 # Since: 0.14.0
2062 { 'command': 'set_password',
2063   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2066 # @expire_password:
2068 # Expire the password of a remote display server.
2070 # @protocol: the name of the remote display protocol `vnc' or `spice'
2072 # @time: when to expire the password.
2073 #        `now' to expire the password immediately
2074 #        `never' to cancel password expiration
2075 #        `+INT' where INT is the number of seconds from now (integer)
2076 #        `INT' where INT is the absolute time in seconds
2078 # Returns: Nothing on success
2079 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2081 # Since: 0.14.0
2083 # Notes: Time is relative to the server and currently there is no way to
2084 #        coordinate server time with client time.  It is not recommended to
2085 #        use the absolute time version of the @time parameter unless you're
2086 #        sure you are on the same machine as the QEMU instance.
2088 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2091 # @eject:
2093 # Ejects a device from a removable drive.
2095 # @device:  The name of the device
2097 # @force:   @optional If true, eject regardless of whether the drive is locked.
2098 #           If not specified, the default value is false.
2100 # Returns:  Nothing on success
2101 #           If @device is not a valid block device, DeviceNotFound
2103 # Notes:    Ejecting a device will no media results in success
2105 # Since: 0.14.0
2107 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2110 # @change-vnc-password:
2112 # Change the VNC server password.
2114 # @target:  the new password to use with VNC authentication
2116 # Since: 1.1
2118 # Notes:  An empty password in this command will set the password to the empty
2119 #         string.  Existing clients are unaffected by executing this command.
2121 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2124 # @change:
2126 # This command is multiple commands multiplexed together.
2128 # @device: This is normally the name of a block device but it may also be 'vnc'.
2129 #          when it's 'vnc', then sub command depends on @target
2131 # @target: If @device is a block device, then this is the new filename.
2132 #          If @device is 'vnc', then if the value 'password' selects the vnc
2133 #          change password command.   Otherwise, this specifies a new server URI
2134 #          address to listen to for VNC connections.
2136 # @arg:    If @device is a block device, then this is an optional format to open
2137 #          the device with.
2138 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2139 #          password to set.  If this argument is an empty string, then no future
2140 #          logins will be allowed.
2142 # Returns: Nothing on success.
2143 #          If @device is not a valid block device, DeviceNotFound
2144 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2145 #          if this error is returned, the device has been opened successfully
2146 #          and an additional call to @block_passwd is required to set the
2147 #          device's password.  The behavior of reads and writes to the block
2148 #          device between when these calls are executed is undefined.
2150 # Notes:  It is strongly recommended that this interface is not used especially
2151 #         for changing block devices.
2153 # Since: 0.14.0
2155 { 'command': 'change',
2156   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2159 # @block_set_io_throttle:
2161 # Change I/O throttle limits for a block drive.
2163 # @device: The name of the device
2165 # @bps: total throughput limit in bytes per second
2167 # @bps_rd: read throughput limit in bytes per second
2169 # @bps_wr: write throughput limit in bytes per second
2171 # @iops: total I/O operations per second
2173 # @ops_rd: read I/O operations per second
2175 # @iops_wr: write I/O operations per second
2177 # Returns: Nothing on success
2178 #          If @device is not a valid block device, DeviceNotFound
2180 # Since: 1.1
2182 { 'command': 'block_set_io_throttle',
2183   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2184             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
2187 # @block-stream:
2189 # Copy data from a backing file into a block device.
2191 # The block streaming operation is performed in the background until the entire
2192 # backing file has been copied.  This command returns immediately once streaming
2193 # has started.  The status of ongoing block streaming operations can be checked
2194 # with query-block-jobs.  The operation can be stopped before it has completed
2195 # using the block-job-cancel command.
2197 # If a base file is specified then sectors are not copied from that base file and
2198 # its backing chain.  When streaming completes the image file will have the base
2199 # file as its backing file.  This can be used to stream a subset of the backing
2200 # file chain instead of flattening the entire image.
2202 # On successful completion the image file is updated to drop the backing file
2203 # and the BLOCK_JOB_COMPLETED event is emitted.
2205 # @device: the device name
2207 # @base:   #optional the common backing file name
2209 # @speed:  #optional the maximum speed, in bytes per second
2211 # @on-error: #optional the action to take on an error (default report).
2212 #            'stop' and 'enospc' can only be used if the block device
2213 #            supports io-status (see BlockInfo).  Since 1.3.
2215 # Returns: Nothing on success
2216 #          If @device does not exist, DeviceNotFound
2218 # Since: 1.1
2220 { 'command': 'block-stream',
2221   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2222             '*on-error': 'BlockdevOnError' } }
2225 # @block-job-set-speed:
2227 # Set maximum speed for a background block operation.
2229 # This command can only be issued when there is an active block job.
2231 # Throttling can be disabled by setting the speed to 0.
2233 # @device: the device name
2235 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2236 #          Defaults to 0.
2238 # Returns: Nothing on success
2239 #          If no background operation is active on this device, DeviceNotActive
2241 # Since: 1.1
2243 { 'command': 'block-job-set-speed',
2244   'data': { 'device': 'str', 'speed': 'int' } }
2247 # @block-job-cancel:
2249 # Stop an active background block operation.
2251 # This command returns immediately after marking the active background block
2252 # operation for cancellation.  It is an error to call this command if no
2253 # operation is in progress.
2255 # The operation will cancel as soon as possible and then emit the
2256 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2257 # enumerated using query-block-jobs.
2259 # For streaming, the image file retains its backing file unless the streaming
2260 # operation happens to complete just as it is being cancelled.  A new streaming
2261 # operation can be started at a later time to finish copying all data from the
2262 # backing file.
2264 # @device: the device name
2266 # @force: #optional whether to allow cancellation of a paused job (default
2267 #         false).  Since 1.3.
2269 # Returns: Nothing on success
2270 #          If no background operation is active on this device, DeviceNotActive
2272 # Since: 1.1
2274 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2277 # @block-job-pause:
2279 # Pause an active background block operation.
2281 # This command returns immediately after marking the active background block
2282 # operation for pausing.  It is an error to call this command if no
2283 # operation is in progress.  Pausing an already paused job has no cumulative
2284 # effect; a single block-job-resume command will resume the job.
2286 # The operation will pause as soon as possible.  No event is emitted when
2287 # the operation is actually paused.  Cancelling a paused job automatically
2288 # resumes it.
2290 # @device: the device name
2292 # Returns: Nothing on success
2293 #          If no background operation is active on this device, DeviceNotActive
2295 # Since: 1.3
2297 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2300 # @block-job-resume:
2302 # Resume an active background block operation.
2304 # This command returns immediately after resuming a paused background block
2305 # operation.  It is an error to call this command if no operation is in
2306 # progress.  Resuming an already running job is not an error.
2308 # This command also clears the error status of the job.
2310 # @device: the device name
2312 # Returns: Nothing on success
2313 #          If no background operation is active on this device, DeviceNotActive
2315 # Since: 1.3
2317 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2320 # @block-job-complete:
2322 # Manually trigger completion of an active background block operation.  This
2323 # is supported for drive mirroring, where it also switches the device to
2324 # write to the target path only.  The ability to complete is signaled with
2325 # a BLOCK_JOB_READY event.
2327 # This command completes an active background block operation synchronously.
2328 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2329 # is not defined.  Note that if an I/O error occurs during the processing of
2330 # this command: 1) the command itself will fail; 2) the error will be processed
2331 # according to the rerror/werror arguments that were specified when starting
2332 # the operation.
2334 # A cancelled or paused job cannot be completed.
2336 # @device: the device name
2338 # Returns: Nothing on success
2339 #          If no background operation is active on this device, DeviceNotActive
2341 # Since: 1.3
2343 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2346 # @ObjectTypeInfo:
2348 # This structure describes a search result from @qom-list-types
2350 # @name: the type name found in the search
2352 # Since: 1.1
2354 # Notes: This command is experimental and may change syntax in future releases.
2356 { 'type': 'ObjectTypeInfo',
2357   'data': { 'name': 'str' } }
2360 # @qom-list-types:
2362 # This command will return a list of types given search parameters
2364 # @implements: if specified, only return types that implement this type name
2366 # @abstract: if true, include abstract types in the results
2368 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2370 # Since: 1.1
2372 { 'command': 'qom-list-types',
2373   'data': { '*implements': 'str', '*abstract': 'bool' },
2374   'returns': [ 'ObjectTypeInfo' ] }
2377 # @DevicePropertyInfo:
2379 # Information about device properties.
2381 # @name: the name of the property
2382 # @type: the typename of the property
2384 # Since: 1.2
2386 { 'type': 'DevicePropertyInfo',
2387   'data': { 'name': 'str', 'type': 'str' } }
2390 # @device-list-properties:
2392 # List properties associated with a device.
2394 # @typename: the type name of a device
2396 # Returns: a list of DevicePropertyInfo describing a devices properties
2398 # Since: 1.2
2400 { 'command': 'device-list-properties',
2401   'data': { 'typename': 'str'},
2402   'returns': [ 'DevicePropertyInfo' ] }
2405 # @migrate
2407 # Migrates the current running guest to another Virtual Machine.
2409 # @uri: the Uniform Resource Identifier of the destination VM
2411 # @blk: #optional do block migration (full disk copy)
2413 # @inc: #optional incremental disk copy migration
2415 # @detach: this argument exists only for compatibility reasons and
2416 #          is ignored by QEMU
2418 # Returns: nothing on success
2420 # Since: 0.14.0
2422 { 'command': 'migrate',
2423   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2425 # @xen-save-devices-state:
2427 # Save the state of all devices to file. The RAM and the block devices
2428 # of the VM are not saved by this command.
2430 # @filename: the file to save the state of the devices to as binary
2431 # data. See xen-save-devices-state.txt for a description of the binary
2432 # format.
2434 # Returns: Nothing on success
2436 # Since: 1.1
2438 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2441 # @xen-set-global-dirty-log
2443 # Enable or disable the global dirty log mode.
2445 # @enable: true to enable, false to disable.
2447 # Returns: nothing
2449 # Since: 1.3
2451 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2454 # @device_del:
2456 # Remove a device from a guest
2458 # @id: the name of the device
2460 # Returns: Nothing on success
2461 #          If @id is not a valid device, DeviceNotFound
2463 # Notes: When this command completes, the device may not be removed from the
2464 #        guest.  Hot removal is an operation that requires guest cooperation.
2465 #        This command merely requests that the guest begin the hot removal
2466 #        process.  Completion of the device removal process is signaled with a
2467 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2468 #        for all devices.
2470 # Since: 0.14.0
2472 { 'command': 'device_del', 'data': {'id': 'str'} }
2475 # @dump-guest-memory
2477 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2478 # very long depending on the amount of guest memory. This command is only
2479 # supported on i386 and x86_64.
2481 # @paging: if true, do paging to get guest's memory mapping. This allows
2482 #          using gdb to process the core file.
2484 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2485 #                     of RAM. This can happen for a large guest, or a
2486 #                     malicious guest pretending to be large.
2488 #          Also, paging=true has the following limitations:
2490 #             1. The guest may be in a catastrophic state or can have corrupted
2491 #                memory, which cannot be trusted
2492 #             2. The guest can be in real-mode even if paging is enabled. For
2493 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2494 #                goes in real-mode
2496 # @protocol: the filename or file descriptor of the vmcore. The supported
2497 #            protocols are:
2499 #            1. file: the protocol starts with "file:", and the following
2500 #               string is the file's path.
2501 #            2. fd: the protocol starts with "fd:", and the following string
2502 #               is the fd's name.
2504 # @begin: #optional if specified, the starting physical address.
2506 # @length: #optional if specified, the memory size, in bytes. If you don't
2507 #          want to dump all guest's memory, please specify the start @begin
2508 #          and @length
2510 # Returns: nothing on success
2512 # Since: 1.2
2514 { 'command': 'dump-guest-memory',
2515   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2516             '*length': 'int' } }
2519 # @netdev_add:
2521 # Add a network backend.
2523 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2524 #        'vde', 'socket', 'dump' and 'bridge'
2526 # @id: the name of the new network backend
2528 # @props: #optional a list of properties to be passed to the backend in
2529 #         the format 'name=value', like 'ifname=tap0,script=no'
2531 # Notes: The semantics of @props is not well defined.  Future commands will be
2532 #        introduced that provide stronger typing for backend creation.
2534 # Since: 0.14.0
2536 # Returns: Nothing on success
2537 #          If @type is not a valid network backend, DeviceNotFound
2539 { 'command': 'netdev_add',
2540   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2541   'gen': 'no' }
2544 # @netdev_del:
2546 # Remove a network backend.
2548 # @id: the name of the network backend to remove
2550 # Returns: Nothing on success
2551 #          If @id is not a valid network backend, DeviceNotFound
2553 # Since: 0.14.0
2555 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2558 # @NetdevNoneOptions
2560 # Use it alone to have zero network devices.
2562 # Since 1.2
2564 { 'type': 'NetdevNoneOptions',
2565   'data': { } }
2568 # @NetLegacyNicOptions
2570 # Create a new Network Interface Card.
2572 # @netdev: #optional id of -netdev to connect to
2574 # @macaddr: #optional MAC address
2576 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2578 # @addr: #optional PCI device address
2580 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2582 # Since 1.2
2584 { 'type': 'NetLegacyNicOptions',
2585   'data': {
2586     '*netdev':  'str',
2587     '*macaddr': 'str',
2588     '*model':   'str',
2589     '*addr':    'str',
2590     '*vectors': 'uint32' } }
2593 # @String
2595 # A fat type wrapping 'str', to be embedded in lists.
2597 # Since 1.2
2599 { 'type': 'String',
2600   'data': {
2601     'str': 'str' } }
2604 # @NetdevUserOptions
2606 # Use the user mode network stack which requires no administrator privilege to
2607 # run.
2609 # @hostname: #optional client hostname reported by the builtin DHCP server
2611 # @restrict: #optional isolate the guest from the host
2613 # @ip: #optional legacy parameter, use net= instead
2615 # @net: #optional IP address and optional netmask
2617 # @host: #optional guest-visible address of the host
2619 # @tftp: #optional root directory of the built-in TFTP server
2621 # @bootfile: #optional BOOTP filename, for use with tftp=
2623 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2624 #             assign
2626 # @dns: #optional guest-visible address of the virtual nameserver
2628 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2629 #             to the guest
2631 # @smb: #optional root directory of the built-in SMB server
2633 # @smbserver: #optional IP address of the built-in SMB server
2635 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2636 #           endpoints
2638 # @guestfwd: #optional forward guest TCP connections
2640 # Since 1.2
2642 { 'type': 'NetdevUserOptions',
2643   'data': {
2644     '*hostname':  'str',
2645     '*restrict':  'bool',
2646     '*ip':        'str',
2647     '*net':       'str',
2648     '*host':      'str',
2649     '*tftp':      'str',
2650     '*bootfile':  'str',
2651     '*dhcpstart': 'str',
2652     '*dns':       'str',
2653     '*dnssearch': ['String'],
2654     '*smb':       'str',
2655     '*smbserver': 'str',
2656     '*hostfwd':   ['String'],
2657     '*guestfwd':  ['String'] } }
2660 # @NetdevTapOptions
2662 # Connect the host TAP network interface name to the VLAN.
2664 # @ifname: #optional interface name
2666 # @fd: #optional file descriptor of an already opened tap
2668 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2669 # tap
2671 # @script: #optional script to initialize the interface
2673 # @downscript: #optional script to shut down the interface
2675 # @helper: #optional command to execute to configure bridge
2677 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2679 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2681 # @vhost: #optional enable vhost-net network accelerator
2683 # @vhostfd: #optional file descriptor of an already opened vhost net device
2685 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2686 # devices
2688 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2690 # @queues: #optional number of queues to be created for multiqueue capable tap
2692 # Since 1.2
2694 { 'type': 'NetdevTapOptions',
2695   'data': {
2696     '*ifname':     'str',
2697     '*fd':         'str',
2698     '*fds':        'str',
2699     '*script':     'str',
2700     '*downscript': 'str',
2701     '*helper':     'str',
2702     '*sndbuf':     'size',
2703     '*vnet_hdr':   'bool',
2704     '*vhost':      'bool',
2705     '*vhostfd':    'str',
2706     '*vhostfds':   'str',
2707     '*vhostforce': 'bool',
2708     '*queues':     'uint32'} }
2711 # @NetdevSocketOptions
2713 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2714 # socket connection.
2716 # @fd: #optional file descriptor of an already opened socket
2718 # @listen: #optional port number, and optional hostname, to listen on
2720 # @connect: #optional port number, and optional hostname, to connect to
2722 # @mcast: #optional UDP multicast address and port number
2724 # @localaddr: #optional source address and port for multicast and udp packets
2726 # @udp: #optional UDP unicast address and port number
2728 # Since 1.2
2730 { 'type': 'NetdevSocketOptions',
2731   'data': {
2732     '*fd':        'str',
2733     '*listen':    'str',
2734     '*connect':   'str',
2735     '*mcast':     'str',
2736     '*localaddr': 'str',
2737     '*udp':       'str' } }
2740 # @NetdevVdeOptions
2742 # Connect the VLAN to a vde switch running on the host.
2744 # @sock: #optional socket path
2746 # @port: #optional port number
2748 # @group: #optional group owner of socket
2750 # @mode: #optional permissions for socket
2752 # Since 1.2
2754 { 'type': 'NetdevVdeOptions',
2755   'data': {
2756     '*sock':  'str',
2757     '*port':  'uint16',
2758     '*group': 'str',
2759     '*mode':  'uint16' } }
2762 # @NetdevDumpOptions
2764 # Dump VLAN network traffic to a file.
2766 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2767 # suffixes.
2769 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2771 # Since 1.2
2773 { 'type': 'NetdevDumpOptions',
2774   'data': {
2775     '*len':  'size',
2776     '*file': 'str' } }
2779 # @NetdevBridgeOptions
2781 # Connect a host TAP network interface to a host bridge device.
2783 # @br: #optional bridge name
2785 # @helper: #optional command to execute to configure bridge
2787 # Since 1.2
2789 { 'type': 'NetdevBridgeOptions',
2790   'data': {
2791     '*br':     'str',
2792     '*helper': 'str' } }
2795 # @NetdevHubPortOptions
2797 # Connect two or more net clients through a software hub.
2799 # @hubid: hub identifier number
2801 # Since 1.2
2803 { 'type': 'NetdevHubPortOptions',
2804   'data': {
2805     'hubid':     'int32' } }
2808 # @NetClientOptions
2810 # A discriminated record of network device traits.
2812 # Since 1.2
2814 { 'union': 'NetClientOptions',
2815   'data': {
2816     'none':     'NetdevNoneOptions',
2817     'nic':      'NetLegacyNicOptions',
2818     'user':     'NetdevUserOptions',
2819     'tap':      'NetdevTapOptions',
2820     'socket':   'NetdevSocketOptions',
2821     'vde':      'NetdevVdeOptions',
2822     'dump':     'NetdevDumpOptions',
2823     'bridge':   'NetdevBridgeOptions',
2824     'hubport':  'NetdevHubPortOptions' } }
2827 # @NetLegacy
2829 # Captures the configuration of a network device; legacy.
2831 # @vlan: #optional vlan number
2833 # @id: #optional identifier for monitor commands
2835 # @name: #optional identifier for monitor commands, ignored if @id is present
2837 # @opts: device type specific properties (legacy)
2839 # Since 1.2
2841 { 'type': 'NetLegacy',
2842   'data': {
2843     '*vlan': 'int32',
2844     '*id':   'str',
2845     '*name': 'str',
2846     'opts':  'NetClientOptions' } }
2849 # @Netdev
2851 # Captures the configuration of a network device.
2853 # @id: identifier for monitor commands.
2855 # @opts: device type specific properties
2857 # Since 1.2
2859 { 'type': 'Netdev',
2860   'data': {
2861     'id':   'str',
2862     'opts': 'NetClientOptions' } }
2865 # @InetSocketAddress
2867 # Captures a socket address or address range in the Internet namespace.
2869 # @host: host part of the address
2871 # @port: port part of the address, or lowest port if @to is present
2873 # @to: highest port to try
2875 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
2876 #        #optional
2878 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
2879 #        #optional
2881 # Since 1.3
2883 { 'type': 'InetSocketAddress',
2884   'data': {
2885     'host': 'str',
2886     'port': 'str',
2887     '*to': 'uint16',
2888     '*ipv4': 'bool',
2889     '*ipv6': 'bool' } }
2892 # @UnixSocketAddress
2894 # Captures a socket address in the local ("Unix socket") namespace.
2896 # @path: filesystem path to use
2898 # Since 1.3
2900 { 'type': 'UnixSocketAddress',
2901   'data': {
2902     'path': 'str' } }
2905 # @SocketAddress
2907 # Captures the address of a socket, which could also be a named file descriptor
2909 # Since 1.3
2911 { 'union': 'SocketAddress',
2912   'data': {
2913     'inet': 'InetSocketAddress',
2914     'unix': 'UnixSocketAddress',
2915     'fd': 'String' } }
2918 # @getfd:
2920 # Receive a file descriptor via SCM rights and assign it a name
2922 # @fdname: file descriptor name
2924 # Returns: Nothing on success
2926 # Since: 0.14.0
2928 # Notes: If @fdname already exists, the file descriptor assigned to
2929 #        it will be closed and replaced by the received file
2930 #        descriptor.
2931 #        The 'closefd' command can be used to explicitly close the
2932 #        file descriptor when it is no longer needed.
2934 { 'command': 'getfd', 'data': {'fdname': 'str'} }
2937 # @closefd:
2939 # Close a file descriptor previously passed via SCM rights
2941 # @fdname: file descriptor name
2943 # Returns: Nothing on success
2945 # Since: 0.14.0
2947 { 'command': 'closefd', 'data': {'fdname': 'str'} }
2950 # @MachineInfo:
2952 # Information describing a machine.
2954 # @name: the name of the machine
2956 # @alias: #optional an alias for the machine name
2958 # @default: #optional whether the machine is default
2960 # @cpu-max: maximum number of CPUs supported by the machine type
2961 #           (since 1.5.0)
2963 # Since: 1.2.0
2965 { 'type': 'MachineInfo',
2966   'data': { 'name': 'str', '*alias': 'str',
2967             '*is-default': 'bool', 'cpu-max': 'int' } }
2970 # @query-machines:
2972 # Return a list of supported machines
2974 # Returns: a list of MachineInfo
2976 # Since: 1.2.0
2978 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
2981 # @CpuDefinitionInfo:
2983 # Virtual CPU definition.
2985 # @name: the name of the CPU definition
2987 # Since: 1.2.0
2989 { 'type': 'CpuDefinitionInfo',
2990   'data': { 'name': 'str' } }
2993 # @query-cpu-definitions:
2995 # Return a list of supported virtual CPU definitions
2997 # Returns: a list of CpuDefInfo
2999 # Since: 1.2.0
3001 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3003 # @AddfdInfo:
3005 # Information about a file descriptor that was added to an fd set.
3007 # @fdset-id: The ID of the fd set that @fd was added to.
3009 # @fd: The file descriptor that was received via SCM rights and
3010 #      added to the fd set.
3012 # Since: 1.2.0
3014 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3017 # @add-fd:
3019 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3021 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3023 # @opaque: #optional A free-form string that can be used to describe the fd.
3025 # Returns: @AddfdInfo on success
3026 #          If file descriptor was not received, FdNotSupplied
3027 #          If @fdset-id is a negative value, InvalidParameterValue
3029 # Notes: The list of fd sets is shared by all monitor connections.
3031 #        If @fdset-id is not specified, a new fd set will be created.
3033 # Since: 1.2.0
3035 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3036   'returns': 'AddfdInfo' }
3039 # @remove-fd:
3041 # Remove a file descriptor from an fd set.
3043 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3045 # @fd: #optional The file descriptor that is to be removed.
3047 # Returns: Nothing on success
3048 #          If @fdset-id or @fd is not found, FdNotFound
3050 # Since: 1.2.0
3052 # Notes: The list of fd sets is shared by all monitor connections.
3054 #        If @fd is not specified, all file descriptors in @fdset-id
3055 #        will be removed.
3057 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3060 # @FdsetFdInfo:
3062 # Information about a file descriptor that belongs to an fd set.
3064 # @fd: The file descriptor value.
3066 # @opaque: #optional A free-form string that can be used to describe the fd.
3068 # Since: 1.2.0
3070 { 'type': 'FdsetFdInfo',
3071   'data': {'fd': 'int', '*opaque': 'str'} }
3074 # @FdsetInfo:
3076 # Information about an fd set.
3078 # @fdset-id: The ID of the fd set.
3080 # @fds: A list of file descriptors that belong to this fd set.
3082 # Since: 1.2.0
3084 { 'type': 'FdsetInfo',
3085   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3088 # @query-fdsets:
3090 # Return information describing all fd sets.
3092 # Returns: A list of @FdsetInfo
3094 # Since: 1.2.0
3096 # Note: The list of fd sets is shared by all monitor connections.
3099 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3102 # @TargetInfo:
3104 # Information describing the QEMU target.
3106 # @arch: the target architecture (eg "x86_64", "i386", etc)
3108 # Since: 1.2.0
3110 { 'type': 'TargetInfo',
3111   'data': { 'arch': 'str' } }
3114 # @query-target:
3116 # Return information about the target for this QEMU
3118 # Returns: TargetInfo
3120 # Since: 1.2.0
3122 { 'command': 'query-target', 'returns': 'TargetInfo' }
3125 # @QKeyCode:
3127 # An enumeration of key name.
3129 # This is used by the send-key command.
3131 # Since: 1.3.0
3133 { 'enum': 'QKeyCode',
3134   'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3135             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3136             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3137             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3138             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3139             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3140             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3141             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3142             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3143             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3144             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3145             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3146             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3147             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3148              'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3151 # @KeyValue
3153 # Represents a keyboard key.
3155 # Since: 1.3.0
3157 { 'union': 'KeyValue',
3158   'data': {
3159     'number': 'int',
3160     'qcode': 'QKeyCode' } }
3163 # @send-key:
3165 # Send keys to guest.
3167 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3168 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3169 #        directly to the guest, while @KeyValue.qcode must be a valid
3170 #        @QKeyCode value
3172 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3173 #             to 100
3175 # Returns: Nothing on success
3176 #          If key is unknown or redundant, InvalidParameter
3178 # Since: 1.3.0
3181 { 'command': 'send-key',
3182   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3185 # @screendump:
3187 # Write a PPM of the VGA screen to a file.
3189 # @filename: the path of a new PPM file to store the image
3191 # Returns: Nothing on success
3193 # Since: 0.14.0
3195 { 'command': 'screendump', 'data': {'filename': 'str'} }
3198 # @nbd-server-start:
3200 # Start an NBD server listening on the given host and port.  Block
3201 # devices can then be exported using @nbd-server-add.  The NBD
3202 # server will present them as named exports; for example, another
3203 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3205 # @addr: Address on which to listen.
3207 # Returns: error if the server is already running.
3209 # Since: 1.3.0
3211 { 'command': 'nbd-server-start',
3212   'data': { 'addr': 'SocketAddress' } }
3215 # @nbd-server-add:
3217 # Export a device to QEMU's embedded NBD server.
3219 # @device: Block device to be exported
3221 # @writable: Whether clients should be able to write to the device via the
3222 #     NBD connection (default false). #optional
3224 # Returns: error if the device is already marked for export.
3226 # Since: 1.3.0
3228 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3231 # @nbd-server-stop:
3233 # Stop QEMU's embedded NBD server, and unregister all devices previously
3234 # added via @nbd-server-add.
3236 # Since: 1.3.0
3238 { 'command': 'nbd-server-stop' }
3241 # @ChardevFile:
3243 # Configuration info for file chardevs.
3245 # @in:  #optional The name of the input file
3246 # @out: The name of the output file
3248 # Since: 1.4
3250 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3251                                    'out' : 'str' } }
3254 # @ChardevHostdev:
3256 # Configuration info for device and pipe chardevs.
3258 # @device: The name of the special file for the device,
3259 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3260 # @type: What kind of device this is.
3262 # Since: 1.4
3264 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3267 # @ChardevSocket:
3269 # Configuration info for (stream) socket chardevs.
3271 # @addr: socket address to listen on (server=true)
3272 #        or connect to (server=false)
3273 # @server: #optional create server socket (default: true)
3274 # @wait: #optional wait for incoming connection on server
3275 #        sockets (default: false).
3276 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3277 # @telnet: #optional enable telnet protocol on server
3278 #          sockets (default: false)
3280 # Since: 1.4
3282 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3283                                      '*server'  : 'bool',
3284                                      '*wait'    : 'bool',
3285                                      '*nodelay' : 'bool',
3286                                      '*telnet'  : 'bool' } }
3289 # @ChardevUdp:
3291 # Configuration info for datagram socket chardevs.
3293 # @remote: remote address
3294 # @local: #optional local address
3296 # Since: 1.5
3298 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3299                                   '*local' : 'SocketAddress' } }
3302 # @ChardevMux:
3304 # Configuration info for mux chardevs.
3306 # @chardev: name of the base chardev.
3308 # Since: 1.5
3310 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3313 # @ChardevStdio:
3315 # Configuration info for stdio chardevs.
3317 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3318 #          be delivered to qemu.  Default: true in -nographic mode,
3319 #          false otherwise.
3321 # Since: 1.5
3323 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3326 # @ChardevSpiceChannel:
3328 # Configuration info for spice vm channel chardevs.
3330 # @type: kind of channel (for example vdagent).
3332 # Since: 1.5
3334 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3337 # @ChardevSpicePort:
3339 # Configuration info for spice port chardevs.
3341 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3343 # Since: 1.5
3345 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3348 # @ChardevVC:
3350 # Configuration info for virtual console chardevs.
3352 # @width:  console width,  in pixels
3353 # @height: console height, in pixels
3354 # @cols:   console width,  in chars
3355 # @rows:   console height, in chars
3357 # Since: 1.5
3359 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3360                                  '*height' : 'int',
3361                                  '*cols'   : 'int',
3362                                  '*rows'   : 'int' } }
3365 # @ChardevRingbuf:
3367 # Configuration info for ring buffer chardevs.
3369 # @size: #optional ring buffer size, must be power of two, default is 65536
3371 # Since: 1.5
3373 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3376 # @ChardevBackend:
3378 # Configuration info for the new chardev backend.
3380 # Since: 1.4
3382 { 'type': 'ChardevDummy', 'data': { } }
3384 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3385                                        'serial' : 'ChardevHostdev',
3386                                        'parallel': 'ChardevHostdev',
3387                                        'pipe'   : 'ChardevHostdev',
3388                                        'socket' : 'ChardevSocket',
3389                                        'udp'    : 'ChardevUdp',
3390                                        'pty'    : 'ChardevDummy',
3391                                        'null'   : 'ChardevDummy',
3392                                        'mux'    : 'ChardevMux',
3393                                        'msmouse': 'ChardevDummy',
3394                                        'braille': 'ChardevDummy',
3395                                        'stdio'  : 'ChardevStdio',
3396                                        'console': 'ChardevDummy',
3397                                        'spicevmc' : 'ChardevSpiceChannel',
3398                                        'spiceport' : 'ChardevSpicePort',
3399                                        'vc'     : 'ChardevVC',
3400                                        'ringbuf': 'ChardevRingbuf',
3401                                        # next one is just for compatibility
3402                                        'memory' : 'ChardevRingbuf' } }
3405 # @ChardevReturn:
3407 # Return info about the chardev backend just created.
3409 # @pty: #optional name of the slave pseudoterminal device, present if
3410 #       and only if a chardev of type 'pty' was created
3412 # Since: 1.4
3414 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3417 # @chardev-add:
3419 # Add a character device backend
3421 # @id: the chardev's ID, must be unique
3422 # @backend: backend type and parameters
3424 # Returns: ChardevReturn.
3426 # Since: 1.4
3428 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3429                                      'backend' : 'ChardevBackend' },
3430   'returns': 'ChardevReturn' }
3433 # @chardev-remove:
3435 # Remove a character device backend
3437 # @id: the chardev's ID, must exist and not be in use
3439 # Returns: Nothing on success
3441 # Since: 1.4
3443 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3446 # @TpmModel:
3448 # An enumeration of TPM models
3450 # @tpm-tis: TPM TIS model
3452 # Since: 1.5
3454 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3457 # @query-tpm-models:
3459 # Return a list of supported TPM models
3461 # Returns: a list of TpmModel
3463 # Since: 1.5
3465 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3468 # @TpmType:
3470 # An enumeration of TPM types
3472 # @passthrough: TPM passthrough type
3474 # Since: 1.5
3476 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3479 # @query-tpm-types:
3481 # Return a list of supported TPM types
3483 # Returns: a list of TpmType
3485 # Since: 1.5
3487 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3490 # @TPMPassthroughOptions:
3492 # Information about the TPM passthrough type
3494 # @path: #optional string describing the path used for accessing the TPM device
3496 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3497 #               for cancellation of TPM commands while they are executing
3499 # Since: 1.5
3501 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3502                                              '*cancel-path' : 'str'} }
3505 # @TpmTypeOptions:
3507 # A union referencing different TPM backend types' configuration options
3509 # @passthrough: The configuration options for the TPM passthrough type
3511 # Since: 1.5
3513 { 'union': 'TpmTypeOptions',
3514    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3517 # @TpmInfo:
3519 # Information about the TPM
3521 # @id: The Id of the TPM
3523 # @model: The TPM frontend model
3525 # @options: The TPM (backend) type configuration options
3527 # Since: 1.5
3529 { 'type': 'TPMInfo',
3530   'data': {'id': 'str',
3531            'model': 'TpmModel',
3532            'options': 'TpmTypeOptions' } }
3535 # @query-tpm:
3537 # Return information about the TPM device
3539 # Returns: @TPMInfo on success
3541 # Since: 1.5
3543 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3546 # @AcpiTableOptions
3548 # Specify an ACPI table on the command line to load.
3550 # At most one of @file and @data can be specified. The list of files specified
3551 # by any one of them is loaded and concatenated in order. If both are omitted,
3552 # @data is implied.
3554 # Other fields / optargs can be used to override fields of the generic ACPI
3555 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3556 # Description Table Header. If a header field is not overridden, then the
3557 # corresponding value from the concatenated blob is used (in case of @file), or
3558 # it is filled in with a hard-coded value (in case of @data).
3560 # String fields are copied into the matching ACPI member from lowest address
3561 # upwards, and silently truncated / NUL-padded to length.
3563 # @sig: #optional table signature / identifier (4 bytes)
3565 # @rev: #optional table revision number (dependent on signature, 1 byte)
3567 # @oem_id: #optional OEM identifier (6 bytes)
3569 # @oem_table_id: #optional OEM table identifier (8 bytes)
3571 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3573 # @asl_compiler_id: #optional identifier of the utility that created the table
3574 #                   (4 bytes)
3576 # @asl_compiler_rev: #optional revision number of the utility that created the
3577 #                    table (4 bytes)
3579 # @file: #optional colon (:) separated list of pathnames to load and
3580 #        concatenate as table data. The resultant binary blob is expected to
3581 #        have an ACPI table header. At least one file is required. This field
3582 #        excludes @data.
3584 # @data: #optional colon (:) separated list of pathnames to load and
3585 #        concatenate as table data. The resultant binary blob must not have an
3586 #        ACPI table header. At least one file is required. This field excludes
3587 #        @file.
3589 # Since 1.5
3591 { 'type': 'AcpiTableOptions',
3592   'data': {
3593     '*sig':               'str',
3594     '*rev':               'uint8',
3595     '*oem_id':            'str',
3596     '*oem_table_id':      'str',
3597     '*oem_rev':           'uint32',
3598     '*asl_compiler_id':   'str',
3599     '*asl_compiler_rev':  'uint32',
3600     '*file':              'str',
3601     '*data':              'str' }}
3604 # @CommandLineParameterType:
3606 # Possible types for an option parameter.
3608 # @string: accepts a character string
3610 # @boolean: accepts "on" or "off"
3612 # @number: accepts a number
3614 # @size: accepts a number followed by an optional suffix (K)ilo,
3615 #        (M)ega, (G)iga, (T)era
3617 # Since 1.5
3619 { 'enum': 'CommandLineParameterType',
3620   'data': ['string', 'boolean', 'number', 'size'] }
3623 # @CommandLineParameterInfo:
3625 # Details about a single parameter of a command line option.
3627 # @name: parameter name
3629 # @type: parameter @CommandLineParameterType
3631 # @help: #optional human readable text string, not suitable for parsing.
3633 # Since 1.5
3635 { 'type': 'CommandLineParameterInfo',
3636   'data': { 'name': 'str',
3637             'type': 'CommandLineParameterType',
3638             '*help': 'str' } }
3641 # @CommandLineOptionInfo:
3643 # Details about a command line option, including its list of parameter details
3645 # @option: option name
3647 # @parameters: an array of @CommandLineParameterInfo
3649 # Since 1.5
3651 { 'type': 'CommandLineOptionInfo',
3652   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3655 # @query-command-line-options:
3657 # Query command line option schema.
3659 # @option: #optional option name
3661 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3662 #          @option).  Returns an error if the given @option doesn't exist.
3664 # Since 1.5
3666 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3667  'returns': ['CommandLineOptionInfo'] }
3670 # @X86CPURegister32
3672 # A X86 32-bit register
3674 # Since: 1.5
3676 { 'enum': 'X86CPURegister32',
3677   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3680 # @X86CPUFeatureWordInfo
3682 # Information about a X86 CPU feature word
3684 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3686 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3687 #                   feature word
3689 # @cpuid-register: Output register containing the feature bits
3691 # @features: value of output register, containing the feature bits
3693 # Since: 1.5
3695 { 'type': 'X86CPUFeatureWordInfo',
3696   'data': { 'cpuid-input-eax': 'int',
3697             '*cpuid-input-ecx': 'int',
3698             'cpuid-register': 'X86CPURegister32',
3699             'features': 'int' } }
3702 # @RxState:
3704 # Packets receiving state
3706 # @normal: filter assigned packets according to the mac-table
3708 # @none: don't receive any assigned packet
3710 # @all: receive all assigned packets
3712 # Since: 1.6
3714 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
3717 # @RxFilterInfo:
3719 # Rx-filter information for a NIC.
3721 # @name: net client name
3723 # @promiscuous: whether promiscuous mode is enabled
3725 # @multicast: multicast receive state
3727 # @unicast: unicast receive state
3729 # @broadcast-allowed: whether to receive broadcast
3731 # @multicast-overflow: multicast table is overflowed or not
3733 # @unicast-overflow: unicast table is overflowed or not
3735 # @main-mac: the main macaddr string
3737 # @vlan-table: a list of active vlan id
3739 # @unicast-table: a list of unicast macaddr string
3741 # @multicast-table: a list of multicast macaddr string
3743 # Since 1.6
3746 { 'type': 'RxFilterInfo',
3747   'data': {
3748     'name':               'str',
3749     'promiscuous':        'bool',
3750     'multicast':          'RxState',
3751     'unicast':            'RxState',
3752     'broadcast-allowed':  'bool',
3753     'multicast-overflow': 'bool',
3754     'unicast-overflow':   'bool',
3755     'main-mac':           'str',
3756     'vlan-table':         ['int'],
3757     'unicast-table':      ['str'],
3758     'multicast-table':    ['str'] }}
3761 # @query-rx-filter:
3763 # Return rx-filter information for all NICs (or for the given NIC).
3765 # @name: #optional net client name
3767 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
3768 #          Returns an error if the given @name doesn't exist, or given
3769 #          NIC doesn't support rx-filter querying, or given net client
3770 #          isn't a NIC.
3772 # Since: 1.6
3774 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
3775   'returns': ['RxFilterInfo'] }