qmp: Add QMP query-named-block-nodes to list the named BlockDriverState nodes.
[qemu/ar7.git] / qapi-schema.json
blobb619f019ee3ae86e666a27ee4f85e1530ecd0fef
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 # @ImageInfoSpecificQCow2:
215 # @compat: compatibility level
217 # @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
219 # Since: 1.7
221 { 'type': 'ImageInfoSpecificQCow2',
222   'data': {
223       'compat': 'str',
224       '*lazy-refcounts': 'bool'
225   } }
228 # @ImageInfoSpecificVmdk:
230 # @create-type: The create type of VMDK image
232 # @cid: Content id of image
234 # @parent-cid: Parent VMDK image's cid
236 # @extents: List of extent files
238 # Since: 1.7
240 { 'type': 'ImageInfoSpecificVmdk',
241   'data': {
242       'create-type': 'str',
243       'cid': 'int',
244       'parent-cid': 'int',
245       'extents': ['ImageInfo']
246   } }
249 # @ImageInfoSpecific:
251 # A discriminated record of image format specific information structures.
253 # Since: 1.7
256 { 'union': 'ImageInfoSpecific',
257   'data': {
258       'qcow2': 'ImageInfoSpecificQCow2',
259       'vmdk': 'ImageInfoSpecificVmdk'
260   } }
263 # @ImageInfo:
265 # Information about a QEMU image file
267 # @filename: name of the image file
269 # @format: format of the image file
271 # @virtual-size: maximum capacity in bytes of the image
273 # @actual-size: #optional actual size on disk in bytes of the image
275 # @dirty-flag: #optional true if image is not cleanly closed
277 # @cluster-size: #optional size of a cluster in bytes
279 # @encrypted: #optional true if the image is encrypted
281 # @compressed: #optional true if the image is compressed (Since 1.7)
283 # @backing-filename: #optional name of the backing file
285 # @full-backing-filename: #optional full path of the backing file
287 # @backing-filename-format: #optional the format of the backing file
289 # @snapshots: #optional list of VM snapshots
291 # @backing-image: #optional info of the backing image (since 1.6)
293 # @format-specific: #optional structure supplying additional format-specific
294 # information (since 1.7)
296 # Since: 1.3
300 { 'type': 'ImageInfo',
301   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
302            '*actual-size': 'int', 'virtual-size': 'int',
303            '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
304            '*backing-filename': 'str', '*full-backing-filename': 'str',
305            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
306            '*backing-image': 'ImageInfo',
307            '*format-specific': 'ImageInfoSpecific' } }
310 # @ImageCheck:
312 # Information about a QEMU image file check
314 # @filename: name of the image file checked
316 # @format: format of the image file checked
318 # @check-errors: number of unexpected errors occurred during check
320 # @image-end-offset: #optional offset (in bytes) where the image ends, this
321 #                    field is present if the driver for the image format
322 #                    supports it
324 # @corruptions: #optional number of corruptions found during the check if any
326 # @leaks: #optional number of leaks found during the check if any
328 # @corruptions-fixed: #optional number of corruptions fixed during the check
329 #                     if any
331 # @leaks-fixed: #optional number of leaks fixed during the check if any
333 # @total-clusters: #optional total number of clusters, this field is present
334 #                  if the driver for the image format supports it
336 # @allocated-clusters: #optional total number of allocated clusters, this
337 #                      field is present if the driver for the image format
338 #                      supports it
340 # @fragmented-clusters: #optional total number of fragmented clusters, this
341 #                       field is present if the driver for the image format
342 #                       supports it
344 # @compressed-clusters: #optional total number of compressed clusters, this
345 #                       field is present if the driver for the image format
346 #                       supports it
348 # Since: 1.4
352 { 'type': 'ImageCheck',
353   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
354            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
355            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
356            '*total-clusters': 'int', '*allocated-clusters': 'int',
357            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
360 # @StatusInfo:
362 # Information about VCPU run state
364 # @running: true if all VCPUs are runnable, false if not runnable
366 # @singlestep: true if VCPUs are in single-step mode
368 # @status: the virtual machine @RunState
370 # Since:  0.14.0
372 # Notes: @singlestep is enabled through the GDB stub
374 { 'type': 'StatusInfo',
375   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
378 # @query-status:
380 # Query the run status of all VCPUs
382 # Returns: @StatusInfo reflecting all VCPUs
384 # Since:  0.14.0
386 { 'command': 'query-status', 'returns': 'StatusInfo' }
389 # @UuidInfo:
391 # Guest UUID information.
393 # @UUID: the UUID of the guest
395 # Since: 0.14.0
397 # Notes: If no UUID was specified for the guest, a null UUID is returned.
399 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
402 # @query-uuid:
404 # Query the guest UUID information.
406 # Returns: The @UuidInfo for the guest
408 # Since 0.14.0
410 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
413 # @ChardevInfo:
415 # Information about a character device.
417 # @label: the label of the character device
419 # @filename: the filename of the character device
421 # Notes: @filename is encoded using the QEMU command line character device
422 #        encoding.  See the QEMU man page for details.
424 # Since: 0.14.0
426 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
429 # @query-chardev:
431 # Returns information about current character devices.
433 # Returns: a list of @ChardevInfo
435 # Since: 0.14.0
437 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
440 # @DataFormat:
442 # An enumeration of data format.
444 # @utf8: Data is a UTF-8 string (RFC 3629)
446 # @base64: Data is Base64 encoded binary (RFC 3548)
448 # Since: 1.4
450 { 'enum': 'DataFormat',
451   'data': [ 'utf8', 'base64' ] }
454 # @ringbuf-write:
456 # Write to a ring buffer character device.
458 # @device: the ring buffer character device name
460 # @data: data to write
462 # @format: #optional data encoding (default 'utf8').
463 #          - base64: data must be base64 encoded text.  Its binary
464 #            decoding gets written.
465 #            Bug: invalid base64 is currently not rejected.
466 #            Whitespace *is* invalid.
467 #          - utf8: data's UTF-8 encoding is written
468 #          - data itself is always Unicode regardless of format, like
469 #            any other string.
471 # Returns: Nothing on success
473 # Since: 1.4
475 { 'command': 'ringbuf-write',
476   'data': {'device': 'str', 'data': 'str',
477            '*format': 'DataFormat'} }
480 # @ringbuf-read:
482 # Read from a ring buffer character device.
484 # @device: the ring buffer character device name
486 # @size: how many bytes to read at most
488 # @format: #optional data encoding (default 'utf8').
489 #          - base64: the data read is returned in base64 encoding.
490 #          - utf8: the data read is interpreted as UTF-8.
491 #            Bug: can screw up when the buffer contains invalid UTF-8
492 #            sequences, NUL characters, after the ring buffer lost
493 #            data, and when reading stops because the size limit is
494 #            reached.
495 #          - The return value is always Unicode regardless of format,
496 #            like any other string.
498 # Returns: data read from the device
500 # Since: 1.4
502 { 'command': 'ringbuf-read',
503   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
504   'returns': 'str' }
507 # @CommandInfo:
509 # Information about a QMP command
511 # @name: The command name
513 # Since: 0.14.0
515 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
518 # @query-commands:
520 # Return a list of supported QMP commands by this server
522 # Returns: A list of @CommandInfo for all supported commands
524 # Since: 0.14.0
526 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
529 # @EventInfo:
531 # Information about a QMP event
533 # @name: The event name
535 # Since: 1.2.0
537 { 'type': 'EventInfo', 'data': {'name': 'str'} }
540 # @query-events:
542 # Return a list of supported QMP events by this server
544 # Returns: A list of @EventInfo for all supported events
546 # Since: 1.2.0
548 { 'command': 'query-events', 'returns': ['EventInfo'] }
551 # @MigrationStats
553 # Detailed migration status.
555 # @transferred: amount of bytes already transferred to the target VM
557 # @remaining: amount of bytes remaining to be transferred to the target VM
559 # @total: total amount of bytes involved in the migration process
561 # @duplicate: number of duplicate (zero) pages (since 1.2)
563 # @skipped: number of skipped zero pages (since 1.5)
565 # @normal : number of normal pages (since 1.2)
567 # @normal-bytes: number of normal bytes sent (since 1.2)
569 # @dirty-pages-rate: number of pages dirtied by second by the
570 #        guest (since 1.3)
572 # @mbps: throughput in megabits/sec. (since 1.6)
574 # Since: 0.14.0
576 { 'type': 'MigrationStats',
577   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
578            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
579            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
580            'mbps' : 'number' } }
583 # @XBZRLECacheStats
585 # Detailed XBZRLE migration cache statistics
587 # @cache-size: XBZRLE cache size
589 # @bytes: amount of bytes already transferred to the target VM
591 # @pages: amount of pages transferred to the target VM
593 # @cache-miss: number of cache miss
595 # @overflow: number of overflows
597 # Since: 1.2
599 { 'type': 'XBZRLECacheStats',
600   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
601            'cache-miss': 'int', 'overflow': 'int' } }
604 # @MigrationInfo
606 # Information about current migration process.
608 # @status: #optional string describing the current migration status.
609 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
610 #          'cancelled'. If this field is not returned, no migration process
611 #          has been initiated
613 # @ram: #optional @MigrationStats containing detailed migration
614 #       status, only returned if status is 'active' or
615 #       'completed'. 'comppleted' (since 1.2)
617 # @disk: #optional @MigrationStats containing detailed disk migration
618 #        status, only returned if status is 'active' and it is a block
619 #        migration
621 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
622 #                migration statistics, only returned if XBZRLE feature is on and
623 #                status is 'active' or 'completed' (since 1.2)
625 # @total-time: #optional total amount of milliseconds since migration started.
626 #        If migration has ended, it returns the total migration
627 #        time. (since 1.2)
629 # @downtime: #optional only present when migration finishes correctly
630 #        total downtime in milliseconds for the guest.
631 #        (since 1.3)
633 # @expected-downtime: #optional only present while migration is active
634 #        expected downtime in milliseconds for the guest in last walk
635 #        of the dirty bitmap. (since 1.3)
637 # @setup-time: #optional amount of setup time in milliseconds _before_ the
638 #        iterations begin but _after_ the QMP command is issued. This is designed
639 #        to provide an accounting of any activities (such as RDMA pinning) which
640 #        may be expensive, but do not actually occur during the iterative
641 #        migration rounds themselves. (since 1.6)
643 # Since: 0.14.0
645 { 'type': 'MigrationInfo',
646   'data': {'*status': 'str', '*ram': 'MigrationStats',
647            '*disk': 'MigrationStats',
648            '*xbzrle-cache': 'XBZRLECacheStats',
649            '*total-time': 'int',
650            '*expected-downtime': 'int',
651            '*downtime': 'int',
652            '*setup-time': 'int'} }
655 # @query-migrate
657 # Returns information about current migration process.
659 # Returns: @MigrationInfo
661 # Since: 0.14.0
663 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
666 # @MigrationCapability
668 # Migration capabilities enumeration
670 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
671 #          This feature allows us to minimize migration traffic for certain work
672 #          loads, by sending compressed difference of the pages
674 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
675 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
676 #          Disabled by default. Experimental: may (or may not) be renamed after
677 #          further testing is complete. (since 1.6)
679 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
680 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
681 #          source and target VM to support this feature. To enable it is sufficient
682 #          to enable the capability on the source VM. The feature is disabled by
683 #          default. (since 1.6)
685 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
686 #          to speed up convergence of RAM migration. (since 1.6)
688 # Since: 1.2
690 { 'enum': 'MigrationCapability',
691   'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
694 # @MigrationCapabilityStatus
696 # Migration capability information
698 # @capability: capability enum
700 # @state: capability state bool
702 # Since: 1.2
704 { 'type': 'MigrationCapabilityStatus',
705   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
708 # @migrate-set-capabilities
710 # Enable/Disable the following migration capabilities (like xbzrle)
712 # @capabilities: json array of capability modifications to make
714 # Since: 1.2
716 { 'command': 'migrate-set-capabilities',
717   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
720 # @query-migrate-capabilities
722 # Returns information about the current migration capabilities status
724 # Returns: @MigrationCapabilitiesStatus
726 # Since: 1.2
728 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
731 # @MouseInfo:
733 # Information about a mouse device.
735 # @name: the name of the mouse device
737 # @index: the index of the mouse device
739 # @current: true if this device is currently receiving mouse events
741 # @absolute: true if this device supports absolute coordinates as input
743 # Since: 0.14.0
745 { 'type': 'MouseInfo',
746   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
747            'absolute': 'bool'} }
750 # @query-mice:
752 # Returns information about each active mouse device
754 # Returns: a list of @MouseInfo for each device
756 # Since: 0.14.0
758 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
761 # @CpuInfo:
763 # Information about a virtual CPU
765 # @CPU: the index of the virtual CPU
767 # @current: this only exists for backwards compatible and should be ignored
769 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
770 #          to a processor specific low power mode.
772 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
773 #                pointer.
774 #                If the target is Sparc, this is the PC component of the
775 #                instruction pointer.
777 # @nip: #optional If the target is PPC, the instruction pointer
779 # @npc: #optional If the target is Sparc, the NPC component of the instruction
780 #                 pointer
782 # @PC: #optional If the target is MIPS, the instruction pointer
784 # @thread_id: ID of the underlying host thread
786 # Since: 0.14.0
788 # Notes: @halted is a transient state that changes frequently.  By the time the
789 #        data is sent to the client, the guest may no longer be halted.
791 { 'type': 'CpuInfo',
792   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
793            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
796 # @query-cpus:
798 # Returns a list of information about each virtual CPU.
800 # Returns: a list of @CpuInfo for each virtual CPU
802 # Since: 0.14.0
804 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
807 # @BlockDeviceInfo:
809 # Information about the backing device for a block device.
811 # @file: the filename of the backing device
813 # @node-name: #optional the name of the block driver node (Since 2.0)
815 # @ro: true if the backing device was open read-only
817 # @drv: the name of the block format used to open the backing device. As of
818 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
819 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
820 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
821 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
823 # @backing_file: #optional the name of the backing file (for copy-on-write)
825 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
827 # @encrypted: true if the backing device is encrypted
829 # @encryption_key_missing: true if the backing device is encrypted but an
830 #                          valid encryption key is missing
832 # @bps: total throughput limit in bytes per second is specified
834 # @bps_rd: read throughput limit in bytes per second is specified
836 # @bps_wr: write throughput limit in bytes per second is specified
838 # @iops: total I/O operations per second is specified
840 # @iops_rd: read I/O operations per second is specified
842 # @iops_wr: write I/O operations per second is specified
844 # @image: the info of image used (since: 1.6)
846 # @bps_max: #optional total max in bytes (Since 1.7)
848 # @bps_rd_max: #optional read max in bytes (Since 1.7)
850 # @bps_wr_max: #optional write max in bytes (Since 1.7)
852 # @iops_max: #optional total I/O operations max (Since 1.7)
854 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
856 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
858 # @iops_size: #optional an I/O size in bytes (Since 1.7)
860 # Since: 0.14.0
863 { 'type': 'BlockDeviceInfo',
864   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
865             '*backing_file': 'str', 'backing_file_depth': 'int',
866             'encrypted': 'bool', 'encryption_key_missing': 'bool',
867             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
868             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
869             'image': 'ImageInfo',
870             '*bps_max': 'int', '*bps_rd_max': 'int',
871             '*bps_wr_max': 'int', '*iops_max': 'int',
872             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
873             '*iops_size': 'int' } }
876 # @BlockDeviceIoStatus:
878 # An enumeration of block device I/O status.
880 # @ok: The last I/O operation has succeeded
882 # @failed: The last I/O operation has failed
884 # @nospace: The last I/O operation has failed due to a no-space condition
886 # Since: 1.0
888 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
891 # @BlockDeviceMapEntry:
893 # Entry in the metadata map of the device (returned by "qemu-img map")
895 # @start: Offset in the image of the first byte described by this entry
896 #         (in bytes)
898 # @length: Length of the range described by this entry (in bytes)
900 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
901 #         before reaching one for which the range is allocated.  The value is
902 #         in the range 0 to the depth of the image chain - 1.
904 # @zero: the sectors in this range read as zeros
906 # @data: reading the image will actually read data from a file (in particular,
907 #        if @offset is present this means that the sectors are not simply
908 #        preallocated, but contain actual data in raw format)
910 # @offset: if present, the image file stores the data for this range in
911 #          raw format at the given offset.
913 # Since 1.7
915 { 'type': 'BlockDeviceMapEntry',
916   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
917             'data': 'bool', '*offset': 'int' } }
920 # @BlockDirtyInfo:
922 # Block dirty bitmap information.
924 # @count: number of dirty bytes according to the dirty bitmap
926 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
928 # Since: 1.3
930 { 'type': 'BlockDirtyInfo',
931   'data': {'count': 'int', 'granularity': 'int'} }
934 # @BlockInfo:
936 # Block device information.  This structure describes a virtual device and
937 # the backing device associated with it.
939 # @device: The device name associated with the virtual device.
941 # @type: This field is returned only for compatibility reasons, it should
942 #        not be used (always returns 'unknown')
944 # @removable: True if the device supports removable media.
946 # @locked: True if the guest has locked this device from having its media
947 #          removed
949 # @tray_open: #optional True if the device has a tray and it is open
950 #             (only present if removable is true)
952 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
953 #                 driver has one or more dirty bitmaps) (Since 2.0)
955 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
956 #             supports it and the VM is configured to stop on errors
958 # @inserted: #optional @BlockDeviceInfo describing the device if media is
959 #            present
961 # Since:  0.14.0
963 { 'type': 'BlockInfo',
964   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
965            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
966            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
967            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
970 # @query-block:
972 # Get a list of BlockInfo for all virtual block devices.
974 # Returns: a list of @BlockInfo describing each virtual block device
976 # Since: 0.14.0
978 { 'command': 'query-block', 'returns': ['BlockInfo'] }
981 # @BlockDeviceStats:
983 # Statistics of a virtual block device or a block backing device.
985 # @rd_bytes:      The number of bytes read by the device.
987 # @wr_bytes:      The number of bytes written by the device.
989 # @rd_operations: The number of read operations performed by the device.
991 # @wr_operations: The number of write operations performed by the device.
993 # @flush_operations: The number of cache flush operations performed by the
994 #                    device (since 0.15.0)
996 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
997 #                       (since 0.15.0).
999 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1001 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1003 # @wr_highest_offset: The offset after the greatest byte written to the
1004 #                     device.  The intended use of this information is for
1005 #                     growable sparse files (like qcow2) that are used on top
1006 #                     of a physical device.
1008 # Since: 0.14.0
1010 { 'type': 'BlockDeviceStats',
1011   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1012            'wr_operations': 'int', 'flush_operations': 'int',
1013            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1014            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1017 # @BlockStats:
1019 # Statistics of a virtual block device or a block backing device.
1021 # @device: #optional If the stats are for a virtual block device, the name
1022 #          corresponding to the virtual block device.
1024 # @stats:  A @BlockDeviceStats for the device.
1026 # @parent: #optional This describes the file block device if it has one.
1028 # @backing: #optional This describes the backing block device if it has one.
1029 #           (Since 2.0)
1031 # Since: 0.14.0
1033 { 'type': 'BlockStats',
1034   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1035            '*parent': 'BlockStats',
1036            '*backing': 'BlockStats'} }
1039 # @query-blockstats:
1041 # Query the @BlockStats for all virtual block devices.
1043 # Returns: A list of @BlockStats for each virtual block devices.
1045 # Since: 0.14.0
1047 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1050 # @VncClientInfo:
1052 # Information about a connected VNC client.
1054 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1055 #        when possible.
1057 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1058 #          'ipv4' if the client is connected via IPv4 and TCP
1059 #          'unix' if the client is connected via a unix domain socket
1060 #          'unknown' otherwise
1062 # @service: The service name of the client's port.  This may depends on the
1063 #           host system's service database so symbolic names should not be
1064 #           relied on.
1066 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1067 #              Name of the client.
1069 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1070 #                 used for authentication.
1072 # Since: 0.14.0
1074 { 'type': 'VncClientInfo',
1075   'data': {'host': 'str', 'family': 'str', 'service': 'str',
1076            '*x509_dname': 'str', '*sasl_username': 'str'} }
1079 # @VncInfo:
1081 # Information about the VNC session.
1083 # @enabled: true if the VNC server is enabled, false otherwise
1085 # @host: #optional The hostname the VNC server is bound to.  This depends on
1086 #        the name resolution on the host and may be an IP address.
1088 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1089 #                    'ipv4' if the host is listening for IPv4 connections
1090 #                    'unix' if the host is listening on a unix domain socket
1091 #                    'unknown' otherwise
1093 # @service: #optional The service name of the server's port.  This may depends
1094 #           on the host system's service database so symbolic names should not
1095 #           be relied on.
1097 # @auth: #optional the current authentication type used by the server
1098 #        'none' if no authentication is being used
1099 #        'vnc' if VNC authentication is being used
1100 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1101 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1102 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1103 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1104 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1105 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1106 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1107 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1108 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1110 # @clients: a list of @VncClientInfo of all currently connected clients
1112 # Since: 0.14.0
1114 { 'type': 'VncInfo',
1115   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1116            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1119 # @query-vnc:
1121 # Returns information about the current VNC server
1123 # Returns: @VncInfo
1125 # Since: 0.14.0
1127 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1130 # @SpiceChannel
1132 # Information about a SPICE client channel.
1134 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1135 #        when possible.
1137 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1138 #          'ipv4' if the client is connected via IPv4 and TCP
1139 #          'unix' if the client is connected via a unix domain socket
1140 #          'unknown' otherwise
1142 # @port: The client's port number.
1144 # @connection-id: SPICE connection id number.  All channels with the same id
1145 #                 belong to the same SPICE session.
1147 # @connection-type: SPICE channel type number.  "1" is the main control
1148 #                   channel, filter for this one if you want to track spice
1149 #                   sessions only
1151 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1152 #              multiple channels of the same type exist, such as multiple
1153 #              display channels in a multihead setup
1155 # @tls: true if the channel is encrypted, false otherwise.
1157 # Since: 0.14.0
1159 { 'type': 'SpiceChannel',
1160   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1161            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1162            'tls': 'bool'} }
1165 # @SpiceQueryMouseMode
1167 # An enumeration of Spice mouse states.
1169 # @client: Mouse cursor position is determined by the client.
1171 # @server: Mouse cursor position is determined by the server.
1173 # @unknown: No information is available about mouse mode used by
1174 #           the spice server.
1176 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1178 # Since: 1.1
1180 { 'enum': 'SpiceQueryMouseMode',
1181   'data': [ 'client', 'server', 'unknown' ] }
1184 # @SpiceInfo
1186 # Information about the SPICE session.
1188 # @enabled: true if the SPICE server is enabled, false otherwise
1190 # @migrated: true if the last guest migration completed and spice
1191 #            migration had completed as well. false otherwise.
1193 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1194 #        the name resolution on the host and may be an IP address.
1196 # @port: #optional The SPICE server's port number.
1198 # @compiled-version: #optional SPICE server version.
1200 # @tls-port: #optional The SPICE server's TLS port number.
1202 # @auth: #optional the current authentication type used by the server
1203 #        'none'  if no authentication is being used
1204 #        'spice' uses SASL or direct TLS authentication, depending on command
1205 #                line options
1207 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1208 #              be determined by the client or the server, or unknown if spice
1209 #              server doesn't provide this information.
1211 #              Since: 1.1
1213 # @channels: a list of @SpiceChannel for each active spice channel
1215 # Since: 0.14.0
1217 { 'type': 'SpiceInfo',
1218   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1219            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1220            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1223 # @query-spice
1225 # Returns information about the current SPICE server
1227 # Returns: @SpiceInfo
1229 # Since: 0.14.0
1231 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1234 # @BalloonInfo:
1236 # Information about the guest balloon device.
1238 # @actual: the number of bytes the balloon currently contains
1240 # Since: 0.14.0
1243 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1246 # @query-balloon:
1248 # Return information about the balloon device.
1250 # Returns: @BalloonInfo on success
1251 #          If the balloon driver is enabled but not functional because the KVM
1252 #          kernel module cannot support it, KvmMissingCap
1253 #          If no balloon device is present, DeviceNotActive
1255 # Since: 0.14.0
1257 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1260 # @PciMemoryRange:
1262 # A PCI device memory region
1264 # @base: the starting address (guest physical)
1266 # @limit: the ending address (guest physical)
1268 # Since: 0.14.0
1270 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1273 # @PciMemoryRegion
1275 # Information about a PCI device I/O region.
1277 # @bar: the index of the Base Address Register for this region
1279 # @type: 'io' if the region is a PIO region
1280 #        'memory' if the region is a MMIO region
1282 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1284 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1286 # Since: 0.14.0
1288 { 'type': 'PciMemoryRegion',
1289   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1290            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1293 # @PciBridgeInfo:
1295 # Information about a PCI Bridge device
1297 # @bus.number: primary bus interface number.  This should be the number of the
1298 #              bus the device resides on.
1300 # @bus.secondary: secondary bus interface number.  This is the number of the
1301 #                 main bus for the bridge
1303 # @bus.subordinate: This is the highest number bus that resides below the
1304 #                   bridge.
1306 # @bus.io_range: The PIO range for all devices on this bridge
1308 # @bus.memory_range: The MMIO range for all devices on this bridge
1310 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1311 #                          this bridge
1313 # @devices: a list of @PciDeviceInfo for each device on this bridge
1315 # Since: 0.14.0
1317 { 'type': 'PciBridgeInfo',
1318   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1319                     'io_range': 'PciMemoryRange',
1320                     'memory_range': 'PciMemoryRange',
1321                     'prefetchable_range': 'PciMemoryRange' },
1322            '*devices': ['PciDeviceInfo']} }
1325 # @PciDeviceInfo:
1327 # Information about a PCI device
1329 # @bus: the bus number of the device
1331 # @slot: the slot the device is located in
1333 # @function: the function of the slot used by the device
1335 # @class_info.desc: #optional a string description of the device's class
1337 # @class_info.class: the class code of the device
1339 # @id.device: the PCI device id
1341 # @id.vendor: the PCI vendor id
1343 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1345 # @qdev_id: the device name of the PCI device
1347 # @pci_bridge: if the device is a PCI bridge, the bridge information
1349 # @regions: a list of the PCI I/O regions associated with the device
1351 # Notes: the contents of @class_info.desc are not stable and should only be
1352 #        treated as informational.
1354 # Since: 0.14.0
1356 { 'type': 'PciDeviceInfo',
1357   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1358            'class_info': {'*desc': 'str', 'class': 'int'},
1359            'id': {'device': 'int', 'vendor': 'int'},
1360            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1361            'regions': ['PciMemoryRegion']} }
1364 # @PciInfo:
1366 # Information about a PCI bus
1368 # @bus: the bus index
1370 # @devices: a list of devices on this bus
1372 # Since: 0.14.0
1374 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1377 # @query-pci:
1379 # Return information about the PCI bus topology of the guest.
1381 # Returns: a list of @PciInfo for each PCI bus
1383 # Since: 0.14.0
1385 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1388 # @BlockdevOnError:
1390 # An enumeration of possible behaviors for errors on I/O operations.
1391 # The exact meaning depends on whether the I/O was initiated by a guest
1392 # or by a block job
1394 # @report: for guest operations, report the error to the guest;
1395 #          for jobs, cancel the job
1397 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1398 #          or BLOCK_JOB_ERROR)
1400 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1402 # @stop: for guest operations, stop the virtual machine;
1403 #        for jobs, pause the job
1405 # Since: 1.3
1407 { 'enum': 'BlockdevOnError',
1408   'data': ['report', 'ignore', 'enospc', 'stop'] }
1411 # @MirrorSyncMode:
1413 # An enumeration of possible behaviors for the initial synchronization
1414 # phase of storage mirroring.
1416 # @top: copies data in the topmost image to the destination
1418 # @full: copies data from all images to the destination
1420 # @none: only copy data written from now on
1422 # Since: 1.3
1424 { 'enum': 'MirrorSyncMode',
1425   'data': ['top', 'full', 'none'] }
1428 # @BlockJobType:
1430 # Type of a block job.
1432 # @commit: block commit job type, see "block-commit"
1434 # @stream: block stream job type, see "block-stream"
1436 # @mirror: drive mirror job type, see "drive-mirror"
1438 # @backup: drive backup job type, see "drive-backup"
1440 # Since: 1.7
1442 { 'enum': 'BlockJobType',
1443   'data': ['commit', 'stream', 'mirror', 'backup'] }
1446 # @BlockJobInfo:
1448 # Information about a long-running block device operation.
1450 # @type: the job type ('stream' for image streaming)
1452 # @device: the block device name
1454 # @len: the maximum progress value
1456 # @busy: false if the job is known to be in a quiescent state, with
1457 #        no pending I/O.  Since 1.3.
1459 # @paused: whether the job is paused or, if @busy is true, will
1460 #          pause itself as soon as possible.  Since 1.3.
1462 # @offset: the current progress value
1464 # @speed: the rate limit, bytes per second
1466 # @io-status: the status of the job (since 1.3)
1468 # Since: 1.1
1470 { 'type': 'BlockJobInfo',
1471   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1472            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1473            'io-status': 'BlockDeviceIoStatus'} }
1476 # @query-block-jobs:
1478 # Return information about long-running block device operations.
1480 # Returns: a list of @BlockJobInfo for each active block job
1482 # Since: 1.1
1484 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1487 # @quit:
1489 # This command will cause the QEMU process to exit gracefully.  While every
1490 # attempt is made to send the QMP response before terminating, this is not
1491 # guaranteed.  When using this interface, a premature EOF would not be
1492 # unexpected.
1494 # Since: 0.14.0
1496 { 'command': 'quit' }
1499 # @stop:
1501 # Stop all guest VCPU execution.
1503 # Since:  0.14.0
1505 # Notes:  This function will succeed even if the guest is already in the stopped
1506 #         state.  In "inmigrate" state, it will ensure that the guest
1507 #         remains paused once migration finishes, as if the -S option was
1508 #         passed on the command line.
1510 { 'command': 'stop' }
1513 # @system_reset:
1515 # Performs a hard reset of a guest.
1517 # Since: 0.14.0
1519 { 'command': 'system_reset' }
1522 # @system_powerdown:
1524 # Requests that a guest perform a powerdown operation.
1526 # Since: 0.14.0
1528 # Notes: A guest may or may not respond to this command.  This command
1529 #        returning does not indicate that a guest has accepted the request or
1530 #        that it has shut down.  Many guests will respond to this command by
1531 #        prompting the user in some way.
1533 { 'command': 'system_powerdown' }
1536 # @cpu:
1538 # This command is a nop that is only provided for the purposes of compatibility.
1540 # Since: 0.14.0
1542 # Notes: Do not use this command.
1544 { 'command': 'cpu', 'data': {'index': 'int'} }
1547 # @cpu-add
1549 # Adds CPU with specified ID
1551 # @id: ID of CPU to be created, valid values [0..max_cpus)
1553 # Returns: Nothing on success
1555 # Since 1.5
1557 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1560 # @memsave:
1562 # Save a portion of guest memory to a file.
1564 # @val: the virtual address of the guest to start from
1566 # @size: the size of memory region to save
1568 # @filename: the file to save the memory to as binary data
1570 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1571 #                       virtual address (defaults to CPU 0)
1573 # Returns: Nothing on success
1575 # Since: 0.14.0
1577 # Notes: Errors were not reliably returned until 1.1
1579 { 'command': 'memsave',
1580   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1583 # @pmemsave:
1585 # Save a portion of guest physical memory to a file.
1587 # @val: the physical address of the guest to start from
1589 # @size: the size of memory region to save
1591 # @filename: the file to save the memory to as binary data
1593 # Returns: Nothing on success
1595 # Since: 0.14.0
1597 # Notes: Errors were not reliably returned until 1.1
1599 { 'command': 'pmemsave',
1600   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1603 # @cont:
1605 # Resume guest VCPU execution.
1607 # Since:  0.14.0
1609 # Returns:  If successful, nothing
1610 #           If QEMU was started with an encrypted block device and a key has
1611 #              not yet been set, DeviceEncrypted.
1613 # Notes:  This command will succeed if the guest is currently running.  It
1614 #         will also succeed if the guest is in the "inmigrate" state; in
1615 #         this case, the effect of the command is to make sure the guest
1616 #         starts once migration finishes, removing the effect of the -S
1617 #         command line option if it was passed.
1619 { 'command': 'cont' }
1622 # @system_wakeup:
1624 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1626 # Since:  1.1
1628 # Returns:  nothing.
1630 { 'command': 'system_wakeup' }
1633 # @inject-nmi:
1635 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1637 # Returns:  If successful, nothing
1639 # Since:  0.14.0
1641 # Notes: Only x86 Virtual Machines support this command.
1643 { 'command': 'inject-nmi' }
1646 # @set_link:
1648 # Sets the link status of a virtual network adapter.
1650 # @name: the device name of the virtual network adapter
1652 # @up: true to set the link status to be up
1654 # Returns: Nothing on success
1655 #          If @name is not a valid network device, DeviceNotFound
1657 # Since: 0.14.0
1659 # Notes: Not all network adapters support setting link status.  This command
1660 #        will succeed even if the network adapter does not support link status
1661 #        notification.
1663 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1666 # @block_passwd:
1668 # This command sets the password of a block device that has not been open
1669 # with a password and requires one.
1671 # The two cases where this can happen are a block device is created through
1672 # QEMU's initial command line or a block device is changed through the legacy
1673 # @change interface.
1675 # In the event that the block device is created through the initial command
1676 # line, the VM will start in the stopped state regardless of whether '-S' is
1677 # used.  The intention is for a management tool to query the block devices to
1678 # determine which ones are encrypted, set the passwords with this command, and
1679 # then start the guest with the @cont command.
1681 # @device:   the name of the device to set the password on
1683 # @password: the password to use for the device
1685 # Returns: nothing on success
1686 #          If @device is not a valid block device, DeviceNotFound
1687 #          If @device is not encrypted, DeviceNotEncrypted
1689 # Notes:  Not all block formats support encryption and some that do are not
1690 #         able to validate that a password is correct.  Disk corruption may
1691 #         occur if an invalid password is specified.
1693 # Since: 0.14.0
1695 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1698 # @balloon:
1700 # Request the balloon driver to change its balloon size.
1702 # @value: the target size of the balloon in bytes
1704 # Returns: Nothing on success
1705 #          If the balloon driver is enabled but not functional because the KVM
1706 #            kernel module cannot support it, KvmMissingCap
1707 #          If no balloon device is present, DeviceNotActive
1709 # Notes: This command just issues a request to the guest.  When it returns,
1710 #        the balloon size may not have changed.  A guest can change the balloon
1711 #        size independent of this command.
1713 # Since: 0.14.0
1715 { 'command': 'balloon', 'data': {'value': 'int'} }
1718 # @block_resize
1720 # Resize a block image while a guest is running.
1722 # @device:  the name of the device to get the image resized
1724 # @size:  new image size in bytes
1726 # Returns: nothing on success
1727 #          If @device is not a valid block device, DeviceNotFound
1729 # Since: 0.14.0
1731 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1734 # @NewImageMode
1736 # An enumeration that tells QEMU how to set the backing file path in
1737 # a new image file.
1739 # @existing: QEMU should look for an existing image file.
1741 # @absolute-paths: QEMU should create a new image with absolute paths
1742 # for the backing file. If there is no backing file available, the new
1743 # image will not be backed either.
1745 # Since: 1.1
1747 { 'enum': 'NewImageMode',
1748   'data': [ 'existing', 'absolute-paths' ] }
1751 # @BlockdevSnapshot
1753 # @device:  the name of the device to generate the snapshot from.
1755 # @snapshot-file: the target of the new image. A new file will be created.
1757 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1759 # @mode: #optional whether and how QEMU should create a new image, default is
1760 #        'absolute-paths'.
1762 { 'type': 'BlockdevSnapshot',
1763   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1764             '*mode': 'NewImageMode' } }
1767 # @BlockdevSnapshotInternal
1769 # @device: the name of the device to generate the snapshot from
1771 # @name: the name of the internal snapshot to be created
1773 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1774 #        exists, the operation will fail. Only some image formats support it,
1775 #        for example, qcow2, rbd, and sheepdog.
1777 # Since: 1.7
1779 { 'type': 'BlockdevSnapshotInternal',
1780   'data': { 'device': 'str', 'name': 'str' } }
1783 # @DriveBackup
1785 # @device: the name of the device which should be copied.
1787 # @target: the target of the new image. If the file exists, or if it
1788 #          is a device, the existing file/device will be used as the new
1789 #          destination.  If it does not exist, a new file will be created.
1791 # @format: #optional the format of the new destination, default is to
1792 #          probe if @mode is 'existing', else the format of the source
1794 # @sync: what parts of the disk image should be copied to the destination
1795 #        (all the disk, only the sectors allocated in the topmost image, or
1796 #        only new I/O).
1798 # @mode: #optional whether and how QEMU should create a new image, default is
1799 #        'absolute-paths'.
1801 # @speed: #optional the maximum speed, in bytes per second
1803 # @on-source-error: #optional the action to take on an error on the source,
1804 #                   default 'report'.  'stop' and 'enospc' can only be used
1805 #                   if the block device supports io-status (see BlockInfo).
1807 # @on-target-error: #optional the action to take on an error on the target,
1808 #                   default 'report' (no limitations, since this applies to
1809 #                   a different block device than @device).
1811 # Note that @on-source-error and @on-target-error only affect background I/O.
1812 # If an error occurs during a guest write request, the device's rerror/werror
1813 # actions will be used.
1815 # Since: 1.6
1817 { 'type': 'DriveBackup',
1818   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1819             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1820             '*speed': 'int',
1821             '*on-source-error': 'BlockdevOnError',
1822             '*on-target-error': 'BlockdevOnError' } }
1825 # @Abort
1827 # This action can be used to test transaction failure.
1829 # Since: 1.6
1831 { 'type': 'Abort',
1832   'data': { } }
1835 # @TransactionAction
1837 # A discriminated record of operations that can be performed with
1838 # @transaction.
1840 { 'union': 'TransactionAction',
1841   'data': {
1842        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1843        'drive-backup': 'DriveBackup',
1844        'abort': 'Abort',
1845        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1846    } }
1849 # @transaction
1851 # Executes a number of transactionable QMP commands atomically. If any
1852 # operation fails, then the entire set of actions will be abandoned and the
1853 # appropriate error returned.
1855 #  List of:
1856 #  @TransactionAction: information needed for the respective operation
1858 # Returns: nothing on success
1859 #          Errors depend on the operations of the transaction
1861 # Note: The transaction aborts on the first failure.  Therefore, there will be
1862 # information on only one failed operation returned in an error condition, and
1863 # subsequent actions will not have been attempted.
1865 # Since 1.1
1867 { 'command': 'transaction',
1868   'data': { 'actions': [ 'TransactionAction' ] } }
1871 # @blockdev-snapshot-sync
1873 # Generates a synchronous snapshot of a block device.
1875 # For the arguments, see the documentation of BlockdevSnapshot.
1877 # Returns: nothing on success
1878 #          If @device is not a valid block device, DeviceNotFound
1880 # Since 0.14.0
1882 { 'command': 'blockdev-snapshot-sync',
1883   'data': 'BlockdevSnapshot' }
1886 # @blockdev-snapshot-internal-sync
1888 # Synchronously take an internal snapshot of a block device, when the format
1889 # of the image used supports it.
1891 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1893 # Returns: nothing on success
1894 #          If @device is not a valid block device, DeviceNotFound
1895 #          If any snapshot matching @name exists, or @name is empty,
1896 #          GenericError
1897 #          If the format of the image used does not support it,
1898 #          BlockFormatFeatureNotSupported
1900 # Since 1.7
1902 { 'command': 'blockdev-snapshot-internal-sync',
1903   'data': 'BlockdevSnapshotInternal' }
1906 # @blockdev-snapshot-delete-internal-sync
1908 # Synchronously delete an internal snapshot of a block device, when the format
1909 # of the image used support it. The snapshot is identified by name or id or
1910 # both. One of the name or id is required. Return SnapshotInfo for the
1911 # successfully deleted snapshot.
1913 # @device: the name of the device to delete the snapshot from
1915 # @id: optional the snapshot's ID to be deleted
1917 # @name: optional the snapshot's name to be deleted
1919 # Returns: SnapshotInfo on success
1920 #          If @device is not a valid block device, DeviceNotFound
1921 #          If snapshot not found, GenericError
1922 #          If the format of the image used does not support it,
1923 #          BlockFormatFeatureNotSupported
1924 #          If @id and @name are both not specified, GenericError
1926 # Since 1.7
1928 { 'command': 'blockdev-snapshot-delete-internal-sync',
1929   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
1930   'returns': 'SnapshotInfo' }
1933 # @human-monitor-command:
1935 # Execute a command on the human monitor and return the output.
1937 # @command-line: the command to execute in the human monitor
1939 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1941 # Returns: the output of the command as a string
1943 # Since: 0.14.0
1945 # Notes: This command only exists as a stop-gap.  Its use is highly
1946 #        discouraged.  The semantics of this command are not guaranteed.
1948 #        Known limitations:
1950 #        o This command is stateless, this means that commands that depend
1951 #          on state information (such as getfd) might not work
1953 #       o Commands that prompt the user for data (eg. 'cont' when the block
1954 #         device is encrypted) don't currently work
1956 { 'command': 'human-monitor-command',
1957   'data': {'command-line': 'str', '*cpu-index': 'int'},
1958   'returns': 'str' }
1961 # @block-commit
1963 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1964 # writes data between 'top' and 'base' into 'base'.
1966 # @device:  the name of the device
1968 # @base:   #optional The file name of the backing image to write data into.
1969 #                    If not specified, this is the deepest backing image
1971 # @top:              The file name of the backing image within the image chain,
1972 #                    which contains the topmost data to be committed down.
1974 #                    If top == base, that is an error.
1975 #                    If top == active, the job will not be completed by itself,
1976 #                    user needs to complete the job with the block-job-complete
1977 #                    command after getting the ready event. (Since 2.0)
1980 # @speed:  #optional the maximum speed, in bytes per second
1982 # Returns: Nothing on success
1983 #          If commit or stream is already active on this device, DeviceInUse
1984 #          If @device does not exist, DeviceNotFound
1985 #          If image commit is not supported by this device, NotSupported
1986 #          If @base or @top is invalid, a generic error is returned
1987 #          If @speed is invalid, InvalidParameter
1989 # Since: 1.3
1992 { 'command': 'block-commit',
1993   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1994             '*speed': 'int' } }
1997 # @drive-backup
1999 # Start a point-in-time copy of a block device to a new destination.  The
2000 # status of ongoing drive-backup operations can be checked with
2001 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
2002 # The operation can be stopped before it has completed using the
2003 # block-job-cancel command.
2005 # For the arguments, see the documentation of DriveBackup.
2007 # Returns: nothing on success
2008 #          If @device is not a valid block device, DeviceNotFound
2010 # Since 1.6
2012 { 'command': 'drive-backup', 'data': 'DriveBackup' }
2015 # @query-named-block-nodes
2017 # Get the named block driver list
2019 # Returns: the list of BlockDeviceInfo
2021 # Since 2.0
2023 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
2026 # @drive-mirror
2028 # Start mirroring a block device's writes to a new destination.
2030 # @device:  the name of the device whose writes should be mirrored.
2032 # @target: the target of the new image. If the file exists, or if it
2033 #          is a device, the existing file/device will be used as the new
2034 #          destination.  If it does not exist, a new file will be created.
2036 # @format: #optional the format of the new destination, default is to
2037 #          probe if @mode is 'existing', else the format of the source
2039 # @mode: #optional whether and how QEMU should create a new image, default is
2040 #        'absolute-paths'.
2042 # @speed:  #optional the maximum speed, in bytes per second
2044 # @sync: what parts of the disk image should be copied to the destination
2045 #        (all the disk, only the sectors allocated in the topmost image, or
2046 #        only new I/O).
2048 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2049 #               if the image format doesn't have clusters, 4K if the clusters
2050 #               are smaller than that, else the cluster size.  Must be a
2051 #               power of 2 between 512 and 64M (since 1.4).
2053 # @buf-size: #optional maximum amount of data in flight from source to
2054 #            target (since 1.4).
2056 # @on-source-error: #optional the action to take on an error on the source,
2057 #                   default 'report'.  'stop' and 'enospc' can only be used
2058 #                   if the block device supports io-status (see BlockInfo).
2060 # @on-target-error: #optional the action to take on an error on the target,
2061 #                   default 'report' (no limitations, since this applies to
2062 #                   a different block device than @device).
2064 # Returns: nothing on success
2065 #          If @device is not a valid block device, DeviceNotFound
2067 # Since 1.3
2069 { 'command': 'drive-mirror',
2070   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2071             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2072             '*speed': 'int', '*granularity': 'uint32',
2073             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2074             '*on-target-error': 'BlockdevOnError' } }
2077 # @migrate_cancel
2079 # Cancel the current executing migration process.
2081 # Returns: nothing on success
2083 # Notes: This command succeeds even if there is no migration process running.
2085 # Since: 0.14.0
2087 { 'command': 'migrate_cancel' }
2090 # @migrate_set_downtime
2092 # Set maximum tolerated downtime for migration.
2094 # @value: maximum downtime in seconds
2096 # Returns: nothing on success
2098 # Since: 0.14.0
2100 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2103 # @migrate_set_speed
2105 # Set maximum speed for migration.
2107 # @value: maximum speed in bytes.
2109 # Returns: nothing on success
2111 # Notes: A value lesser than zero will be automatically round up to zero.
2113 # Since: 0.14.0
2115 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2118 # @migrate-set-cache-size
2120 # Set XBZRLE cache size
2122 # @value: cache size in bytes
2124 # The size will be rounded down to the nearest power of 2.
2125 # The cache size can be modified before and during ongoing migration
2127 # Returns: nothing on success
2129 # Since: 1.2
2131 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2134 # @query-migrate-cache-size
2136 # query XBZRLE cache size
2138 # Returns: XBZRLE cache size in bytes
2140 # Since: 1.2
2142 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2145 # @ObjectPropertyInfo:
2147 # @name: the name of the property
2149 # @type: the type of the property.  This will typically come in one of four
2150 #        forms:
2152 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2153 #           These types are mapped to the appropriate JSON type.
2155 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
2156 #           legacy qdev typename.  These types are always treated as strings.
2158 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
2159 #           device type name.  Child properties create the composition tree.
2161 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
2162 #           device type name.  Link properties form the device model graph.
2164 # Since: 1.2
2166 { 'type': 'ObjectPropertyInfo',
2167   'data': { 'name': 'str', 'type': 'str' } }
2170 # @qom-list:
2172 # This command will list any properties of a object given a path in the object
2173 # model.
2175 # @path: the path within the object model.  See @qom-get for a description of
2176 #        this parameter.
2178 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2179 #          object.
2181 # Since: 1.2
2183 { 'command': 'qom-list',
2184   'data': { 'path': 'str' },
2185   'returns': [ 'ObjectPropertyInfo' ] }
2188 # @qom-get:
2190 # This command will get a property from a object model path and return the
2191 # value.
2193 # @path: The path within the object model.  There are two forms of supported
2194 #        paths--absolute and partial paths.
2196 #        Absolute paths are derived from the root object and can follow child<>
2197 #        or link<> properties.  Since they can follow link<> properties, they
2198 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2199 #        and are prefixed  with a leading slash.
2201 #        Partial paths look like relative filenames.  They do not begin
2202 #        with a prefix.  The matching rules for partial paths are subtle but
2203 #        designed to make specifying objects easy.  At each level of the
2204 #        composition tree, the partial path is matched as an absolute path.
2205 #        The first match is not returned.  At least two matches are searched
2206 #        for.  A successful result is only returned if only one match is
2207 #        found.  If more than one match is found, a flag is return to
2208 #        indicate that the match was ambiguous.
2210 # @property: The property name to read
2212 # Returns: The property value.  The type depends on the property type.  legacy<>
2213 #          properties are returned as #str.  child<> and link<> properties are
2214 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2215 #          are returned as #int.
2217 # Since: 1.2
2219 { 'command': 'qom-get',
2220   'data': { 'path': 'str', 'property': 'str' },
2221   'returns': 'visitor',
2222   'gen': 'no' }
2225 # @qom-set:
2227 # This command will set a property from a object model path.
2229 # @path: see @qom-get for a description of this parameter
2231 # @property: the property name to set
2233 # @value: a value who's type is appropriate for the property type.  See @qom-get
2234 #         for a description of type mapping.
2236 # Since: 1.2
2238 { 'command': 'qom-set',
2239   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2240   'gen': 'no' }
2243 # @set_password:
2245 # Sets the password of a remote display session.
2247 # @protocol: `vnc' to modify the VNC server password
2248 #            `spice' to modify the Spice server password
2250 # @password: the new password
2252 # @connected: #optional how to handle existing clients when changing the
2253 #                       password.  If nothing is specified, defaults to `keep'
2254 #                       `fail' to fail the command if clients are connected
2255 #                       `disconnect' to disconnect existing clients
2256 #                       `keep' to maintain existing clients
2258 # Returns: Nothing on success
2259 #          If Spice is not enabled, DeviceNotFound
2261 # Since: 0.14.0
2263 { 'command': 'set_password',
2264   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2267 # @expire_password:
2269 # Expire the password of a remote display server.
2271 # @protocol: the name of the remote display protocol `vnc' or `spice'
2273 # @time: when to expire the password.
2274 #        `now' to expire the password immediately
2275 #        `never' to cancel password expiration
2276 #        `+INT' where INT is the number of seconds from now (integer)
2277 #        `INT' where INT is the absolute time in seconds
2279 # Returns: Nothing on success
2280 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2282 # Since: 0.14.0
2284 # Notes: Time is relative to the server and currently there is no way to
2285 #        coordinate server time with client time.  It is not recommended to
2286 #        use the absolute time version of the @time parameter unless you're
2287 #        sure you are on the same machine as the QEMU instance.
2289 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2292 # @eject:
2294 # Ejects a device from a removable drive.
2296 # @device:  The name of the device
2298 # @force:   @optional If true, eject regardless of whether the drive is locked.
2299 #           If not specified, the default value is false.
2301 # Returns:  Nothing on success
2302 #           If @device is not a valid block device, DeviceNotFound
2304 # Notes:    Ejecting a device will no media results in success
2306 # Since: 0.14.0
2308 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2311 # @change-vnc-password:
2313 # Change the VNC server password.
2315 # @target:  the new password to use with VNC authentication
2317 # Since: 1.1
2319 # Notes:  An empty password in this command will set the password to the empty
2320 #         string.  Existing clients are unaffected by executing this command.
2322 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2325 # @change:
2327 # This command is multiple commands multiplexed together.
2329 # @device: This is normally the name of a block device but it may also be 'vnc'.
2330 #          when it's 'vnc', then sub command depends on @target
2332 # @target: If @device is a block device, then this is the new filename.
2333 #          If @device is 'vnc', then if the value 'password' selects the vnc
2334 #          change password command.   Otherwise, this specifies a new server URI
2335 #          address to listen to for VNC connections.
2337 # @arg:    If @device is a block device, then this is an optional format to open
2338 #          the device with.
2339 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2340 #          password to set.  If this argument is an empty string, then no future
2341 #          logins will be allowed.
2343 # Returns: Nothing on success.
2344 #          If @device is not a valid block device, DeviceNotFound
2345 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2346 #          if this error is returned, the device has been opened successfully
2347 #          and an additional call to @block_passwd is required to set the
2348 #          device's password.  The behavior of reads and writes to the block
2349 #          device between when these calls are executed is undefined.
2351 # Notes:  It is strongly recommended that this interface is not used especially
2352 #         for changing block devices.
2354 # Since: 0.14.0
2356 { 'command': 'change',
2357   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2360 # @block_set_io_throttle:
2362 # Change I/O throttle limits for a block drive.
2364 # @device: The name of the device
2366 # @bps: total throughput limit in bytes per second
2368 # @bps_rd: read throughput limit in bytes per second
2370 # @bps_wr: write throughput limit in bytes per second
2372 # @iops: total I/O operations per second
2374 # @ops_rd: read I/O operations per second
2376 # @iops_wr: write I/O operations per second
2378 # @bps_max: #optional total max in bytes (Since 1.7)
2380 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2382 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2384 # @iops_max: #optional total I/O operations max (Since 1.7)
2386 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2388 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2390 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2392 # Returns: Nothing on success
2393 #          If @device is not a valid block device, DeviceNotFound
2395 # Since: 1.1
2397 { 'command': 'block_set_io_throttle',
2398   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2399             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2400             '*bps_max': 'int', '*bps_rd_max': 'int',
2401             '*bps_wr_max': 'int', '*iops_max': 'int',
2402             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2403             '*iops_size': 'int' } }
2406 # @block-stream:
2408 # Copy data from a backing file into a block device.
2410 # The block streaming operation is performed in the background until the entire
2411 # backing file has been copied.  This command returns immediately once streaming
2412 # has started.  The status of ongoing block streaming operations can be checked
2413 # with query-block-jobs.  The operation can be stopped before it has completed
2414 # using the block-job-cancel command.
2416 # If a base file is specified then sectors are not copied from that base file and
2417 # its backing chain.  When streaming completes the image file will have the base
2418 # file as its backing file.  This can be used to stream a subset of the backing
2419 # file chain instead of flattening the entire image.
2421 # On successful completion the image file is updated to drop the backing file
2422 # and the BLOCK_JOB_COMPLETED event is emitted.
2424 # @device: the device name
2426 # @base:   #optional the common backing file name
2428 # @speed:  #optional the maximum speed, in bytes per second
2430 # @on-error: #optional the action to take on an error (default report).
2431 #            'stop' and 'enospc' can only be used if the block device
2432 #            supports io-status (see BlockInfo).  Since 1.3.
2434 # Returns: Nothing on success
2435 #          If @device does not exist, DeviceNotFound
2437 # Since: 1.1
2439 { 'command': 'block-stream',
2440   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2441             '*on-error': 'BlockdevOnError' } }
2444 # @block-job-set-speed:
2446 # Set maximum speed for a background block operation.
2448 # This command can only be issued when there is an active block job.
2450 # Throttling can be disabled by setting the speed to 0.
2452 # @device: the device name
2454 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2455 #          Defaults to 0.
2457 # Returns: Nothing on success
2458 #          If no background operation is active on this device, DeviceNotActive
2460 # Since: 1.1
2462 { 'command': 'block-job-set-speed',
2463   'data': { 'device': 'str', 'speed': 'int' } }
2466 # @block-job-cancel:
2468 # Stop an active background block operation.
2470 # This command returns immediately after marking the active background block
2471 # operation for cancellation.  It is an error to call this command if no
2472 # operation is in progress.
2474 # The operation will cancel as soon as possible and then emit the
2475 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2476 # enumerated using query-block-jobs.
2478 # For streaming, the image file retains its backing file unless the streaming
2479 # operation happens to complete just as it is being cancelled.  A new streaming
2480 # operation can be started at a later time to finish copying all data from the
2481 # backing file.
2483 # @device: the device name
2485 # @force: #optional whether to allow cancellation of a paused job (default
2486 #         false).  Since 1.3.
2488 # Returns: Nothing on success
2489 #          If no background operation is active on this device, DeviceNotActive
2491 # Since: 1.1
2493 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2496 # @block-job-pause:
2498 # Pause an active background block operation.
2500 # This command returns immediately after marking the active background block
2501 # operation for pausing.  It is an error to call this command if no
2502 # operation is in progress.  Pausing an already paused job has no cumulative
2503 # effect; a single block-job-resume command will resume the job.
2505 # The operation will pause as soon as possible.  No event is emitted when
2506 # the operation is actually paused.  Cancelling a paused job automatically
2507 # resumes it.
2509 # @device: the device name
2511 # Returns: Nothing on success
2512 #          If no background operation is active on this device, DeviceNotActive
2514 # Since: 1.3
2516 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2519 # @block-job-resume:
2521 # Resume an active background block operation.
2523 # This command returns immediately after resuming a paused background block
2524 # operation.  It is an error to call this command if no operation is in
2525 # progress.  Resuming an already running job is not an error.
2527 # This command also clears the error status of the job.
2529 # @device: the device name
2531 # Returns: Nothing on success
2532 #          If no background operation is active on this device, DeviceNotActive
2534 # Since: 1.3
2536 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2539 # @block-job-complete:
2541 # Manually trigger completion of an active background block operation.  This
2542 # is supported for drive mirroring, where it also switches the device to
2543 # write to the target path only.  The ability to complete is signaled with
2544 # a BLOCK_JOB_READY event.
2546 # This command completes an active background block operation synchronously.
2547 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2548 # is not defined.  Note that if an I/O error occurs during the processing of
2549 # this command: 1) the command itself will fail; 2) the error will be processed
2550 # according to the rerror/werror arguments that were specified when starting
2551 # the operation.
2553 # A cancelled or paused job cannot be completed.
2555 # @device: the device name
2557 # Returns: Nothing on success
2558 #          If no background operation is active on this device, DeviceNotActive
2560 # Since: 1.3
2562 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2565 # @ObjectTypeInfo:
2567 # This structure describes a search result from @qom-list-types
2569 # @name: the type name found in the search
2571 # Since: 1.1
2573 # Notes: This command is experimental and may change syntax in future releases.
2575 { 'type': 'ObjectTypeInfo',
2576   'data': { 'name': 'str' } }
2579 # @qom-list-types:
2581 # This command will return a list of types given search parameters
2583 # @implements: if specified, only return types that implement this type name
2585 # @abstract: if true, include abstract types in the results
2587 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2589 # Since: 1.1
2591 { 'command': 'qom-list-types',
2592   'data': { '*implements': 'str', '*abstract': 'bool' },
2593   'returns': [ 'ObjectTypeInfo' ] }
2596 # @DevicePropertyInfo:
2598 # Information about device properties.
2600 # @name: the name of the property
2601 # @type: the typename of the property
2603 # Since: 1.2
2605 { 'type': 'DevicePropertyInfo',
2606   'data': { 'name': 'str', 'type': 'str' } }
2609 # @device-list-properties:
2611 # List properties associated with a device.
2613 # @typename: the type name of a device
2615 # Returns: a list of DevicePropertyInfo describing a devices properties
2617 # Since: 1.2
2619 { 'command': 'device-list-properties',
2620   'data': { 'typename': 'str'},
2621   'returns': [ 'DevicePropertyInfo' ] }
2624 # @migrate
2626 # Migrates the current running guest to another Virtual Machine.
2628 # @uri: the Uniform Resource Identifier of the destination VM
2630 # @blk: #optional do block migration (full disk copy)
2632 # @inc: #optional incremental disk copy migration
2634 # @detach: this argument exists only for compatibility reasons and
2635 #          is ignored by QEMU
2637 # Returns: nothing on success
2639 # Since: 0.14.0
2641 { 'command': 'migrate',
2642   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2644 # @xen-save-devices-state:
2646 # Save the state of all devices to file. The RAM and the block devices
2647 # of the VM are not saved by this command.
2649 # @filename: the file to save the state of the devices to as binary
2650 # data. See xen-save-devices-state.txt for a description of the binary
2651 # format.
2653 # Returns: Nothing on success
2655 # Since: 1.1
2657 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2660 # @xen-set-global-dirty-log
2662 # Enable or disable the global dirty log mode.
2664 # @enable: true to enable, false to disable.
2666 # Returns: nothing
2668 # Since: 1.3
2670 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2673 # @device_del:
2675 # Remove a device from a guest
2677 # @id: the name of the device
2679 # Returns: Nothing on success
2680 #          If @id is not a valid device, DeviceNotFound
2682 # Notes: When this command completes, the device may not be removed from the
2683 #        guest.  Hot removal is an operation that requires guest cooperation.
2684 #        This command merely requests that the guest begin the hot removal
2685 #        process.  Completion of the device removal process is signaled with a
2686 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2687 #        for all devices.
2689 # Since: 0.14.0
2691 { 'command': 'device_del', 'data': {'id': 'str'} }
2694 # @dump-guest-memory
2696 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2697 # very long depending on the amount of guest memory. This command is only
2698 # supported on i386 and x86_64.
2700 # @paging: if true, do paging to get guest's memory mapping. This allows
2701 #          using gdb to process the core file.
2703 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2704 #                     of RAM. This can happen for a large guest, or a
2705 #                     malicious guest pretending to be large.
2707 #          Also, paging=true has the following limitations:
2709 #             1. The guest may be in a catastrophic state or can have corrupted
2710 #                memory, which cannot be trusted
2711 #             2. The guest can be in real-mode even if paging is enabled. For
2712 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2713 #                goes in real-mode
2715 # @protocol: the filename or file descriptor of the vmcore. The supported
2716 #            protocols are:
2718 #            1. file: the protocol starts with "file:", and the following
2719 #               string is the file's path.
2720 #            2. fd: the protocol starts with "fd:", and the following string
2721 #               is the fd's name.
2723 # @begin: #optional if specified, the starting physical address.
2725 # @length: #optional if specified, the memory size, in bytes. If you don't
2726 #          want to dump all guest's memory, please specify the start @begin
2727 #          and @length
2729 # Returns: nothing on success
2731 # Since: 1.2
2733 { 'command': 'dump-guest-memory',
2734   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2735             '*length': 'int' } }
2738 # @netdev_add:
2740 # Add a network backend.
2742 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2743 #        'vde', 'socket', 'dump' and 'bridge'
2745 # @id: the name of the new network backend
2747 # @props: #optional a list of properties to be passed to the backend in
2748 #         the format 'name=value', like 'ifname=tap0,script=no'
2750 # Notes: The semantics of @props is not well defined.  Future commands will be
2751 #        introduced that provide stronger typing for backend creation.
2753 # Since: 0.14.0
2755 # Returns: Nothing on success
2756 #          If @type is not a valid network backend, DeviceNotFound
2758 { 'command': 'netdev_add',
2759   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2760   'gen': 'no' }
2763 # @netdev_del:
2765 # Remove a network backend.
2767 # @id: the name of the network backend to remove
2769 # Returns: Nothing on success
2770 #          If @id is not a valid network backend, DeviceNotFound
2772 # Since: 0.14.0
2774 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2777 # @object-add:
2779 # Create a QOM object.
2781 # @qom-type: the class name for the object to be created
2783 # @id: the name of the new object
2785 # @props: #optional a dictionary of properties to be passed to the backend
2787 # Returns: Nothing on success
2788 #          Error if @qom-type is not a valid class name
2790 # Since: 2.0
2792 { 'command': 'object-add',
2793   'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
2794   'gen': 'no' }
2797 # @object-del:
2799 # Remove a QOM object.
2801 # @id: the name of the QOM object to remove
2803 # Returns: Nothing on success
2804 #          Error if @id is not a valid id for a QOM object
2806 # Since: 2.0
2808 { 'command': 'object-del', 'data': {'id': 'str'} }
2811 # @NetdevNoneOptions
2813 # Use it alone to have zero network devices.
2815 # Since 1.2
2817 { 'type': 'NetdevNoneOptions',
2818   'data': { } }
2821 # @NetLegacyNicOptions
2823 # Create a new Network Interface Card.
2825 # @netdev: #optional id of -netdev to connect to
2827 # @macaddr: #optional MAC address
2829 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2831 # @addr: #optional PCI device address
2833 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2835 # Since 1.2
2837 { 'type': 'NetLegacyNicOptions',
2838   'data': {
2839     '*netdev':  'str',
2840     '*macaddr': 'str',
2841     '*model':   'str',
2842     '*addr':    'str',
2843     '*vectors': 'uint32' } }
2846 # @String
2848 # A fat type wrapping 'str', to be embedded in lists.
2850 # Since 1.2
2852 { 'type': 'String',
2853   'data': {
2854     'str': 'str' } }
2857 # @NetdevUserOptions
2859 # Use the user mode network stack which requires no administrator privilege to
2860 # run.
2862 # @hostname: #optional client hostname reported by the builtin DHCP server
2864 # @restrict: #optional isolate the guest from the host
2866 # @ip: #optional legacy parameter, use net= instead
2868 # @net: #optional IP address and optional netmask
2870 # @host: #optional guest-visible address of the host
2872 # @tftp: #optional root directory of the built-in TFTP server
2874 # @bootfile: #optional BOOTP filename, for use with tftp=
2876 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2877 #             assign
2879 # @dns: #optional guest-visible address of the virtual nameserver
2881 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2882 #             to the guest
2884 # @smb: #optional root directory of the built-in SMB server
2886 # @smbserver: #optional IP address of the built-in SMB server
2888 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2889 #           endpoints
2891 # @guestfwd: #optional forward guest TCP connections
2893 # Since 1.2
2895 { 'type': 'NetdevUserOptions',
2896   'data': {
2897     '*hostname':  'str',
2898     '*restrict':  'bool',
2899     '*ip':        'str',
2900     '*net':       'str',
2901     '*host':      'str',
2902     '*tftp':      'str',
2903     '*bootfile':  'str',
2904     '*dhcpstart': 'str',
2905     '*dns':       'str',
2906     '*dnssearch': ['String'],
2907     '*smb':       'str',
2908     '*smbserver': 'str',
2909     '*hostfwd':   ['String'],
2910     '*guestfwd':  ['String'] } }
2913 # @NetdevTapOptions
2915 # Connect the host TAP network interface name to the VLAN.
2917 # @ifname: #optional interface name
2919 # @fd: #optional file descriptor of an already opened tap
2921 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2922 # tap
2924 # @script: #optional script to initialize the interface
2926 # @downscript: #optional script to shut down the interface
2928 # @helper: #optional command to execute to configure bridge
2930 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2932 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2934 # @vhost: #optional enable vhost-net network accelerator
2936 # @vhostfd: #optional file descriptor of an already opened vhost net device
2938 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2939 # devices
2941 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2943 # @queues: #optional number of queues to be created for multiqueue capable tap
2945 # Since 1.2
2947 { 'type': 'NetdevTapOptions',
2948   'data': {
2949     '*ifname':     'str',
2950     '*fd':         'str',
2951     '*fds':        'str',
2952     '*script':     'str',
2953     '*downscript': 'str',
2954     '*helper':     'str',
2955     '*sndbuf':     'size',
2956     '*vnet_hdr':   'bool',
2957     '*vhost':      'bool',
2958     '*vhostfd':    'str',
2959     '*vhostfds':   'str',
2960     '*vhostforce': 'bool',
2961     '*queues':     'uint32'} }
2964 # @NetdevSocketOptions
2966 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2967 # socket connection.
2969 # @fd: #optional file descriptor of an already opened socket
2971 # @listen: #optional port number, and optional hostname, to listen on
2973 # @connect: #optional port number, and optional hostname, to connect to
2975 # @mcast: #optional UDP multicast address and port number
2977 # @localaddr: #optional source address and port for multicast and udp packets
2979 # @udp: #optional UDP unicast address and port number
2981 # Since 1.2
2983 { 'type': 'NetdevSocketOptions',
2984   'data': {
2985     '*fd':        'str',
2986     '*listen':    'str',
2987     '*connect':   'str',
2988     '*mcast':     'str',
2989     '*localaddr': 'str',
2990     '*udp':       'str' } }
2993 # @NetdevVdeOptions
2995 # Connect the VLAN to a vde switch running on the host.
2997 # @sock: #optional socket path
2999 # @port: #optional port number
3001 # @group: #optional group owner of socket
3003 # @mode: #optional permissions for socket
3005 # Since 1.2
3007 { 'type': 'NetdevVdeOptions',
3008   'data': {
3009     '*sock':  'str',
3010     '*port':  'uint16',
3011     '*group': 'str',
3012     '*mode':  'uint16' } }
3015 # @NetdevDumpOptions
3017 # Dump VLAN network traffic to a file.
3019 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3020 # suffixes.
3022 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3024 # Since 1.2
3026 { 'type': 'NetdevDumpOptions',
3027   'data': {
3028     '*len':  'size',
3029     '*file': 'str' } }
3032 # @NetdevBridgeOptions
3034 # Connect a host TAP network interface to a host bridge device.
3036 # @br: #optional bridge name
3038 # @helper: #optional command to execute to configure bridge
3040 # Since 1.2
3042 { 'type': 'NetdevBridgeOptions',
3043   'data': {
3044     '*br':     'str',
3045     '*helper': 'str' } }
3048 # @NetdevHubPortOptions
3050 # Connect two or more net clients through a software hub.
3052 # @hubid: hub identifier number
3054 # Since 1.2
3056 { 'type': 'NetdevHubPortOptions',
3057   'data': {
3058     'hubid':     'int32' } }
3061 # @NetdevNetmapOptions
3063 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3065 # @ifname: Either the name of an existing network interface supported by
3066 #          netmap, or the name of a VALE port (created on the fly).
3067 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3068 #          YYY are non-negative integers. XXX identifies a switch and
3069 #          YYY identifies a port of the switch. VALE ports having the
3070 #          same XXX are therefore connected to the same switch.
3072 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3074 # Since 2.0
3076 { 'type': 'NetdevNetmapOptions',
3077   'data': {
3078     'ifname':     'str',
3079     '*devname':    'str' } }
3082 # @NetClientOptions
3084 # A discriminated record of network device traits.
3086 # Since 1.2
3088 { 'union': 'NetClientOptions',
3089   'data': {
3090     'none':     'NetdevNoneOptions',
3091     'nic':      'NetLegacyNicOptions',
3092     'user':     'NetdevUserOptions',
3093     'tap':      'NetdevTapOptions',
3094     'socket':   'NetdevSocketOptions',
3095     'vde':      'NetdevVdeOptions',
3096     'dump':     'NetdevDumpOptions',
3097     'bridge':   'NetdevBridgeOptions',
3098     'hubport':  'NetdevHubPortOptions',
3099     'netmap':   'NetdevNetmapOptions' } }
3102 # @NetLegacy
3104 # Captures the configuration of a network device; legacy.
3106 # @vlan: #optional vlan number
3108 # @id: #optional identifier for monitor commands
3110 # @name: #optional identifier for monitor commands, ignored if @id is present
3112 # @opts: device type specific properties (legacy)
3114 # Since 1.2
3116 { 'type': 'NetLegacy',
3117   'data': {
3118     '*vlan': 'int32',
3119     '*id':   'str',
3120     '*name': 'str',
3121     'opts':  'NetClientOptions' } }
3124 # @Netdev
3126 # Captures the configuration of a network device.
3128 # @id: identifier for monitor commands.
3130 # @opts: device type specific properties
3132 # Since 1.2
3134 { 'type': 'Netdev',
3135   'data': {
3136     'id':   'str',
3137     'opts': 'NetClientOptions' } }
3140 # @InetSocketAddress
3142 # Captures a socket address or address range in the Internet namespace.
3144 # @host: host part of the address
3146 # @port: port part of the address, or lowest port if @to is present
3148 # @to: highest port to try
3150 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3151 #        #optional
3153 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3154 #        #optional
3156 # Since 1.3
3158 { 'type': 'InetSocketAddress',
3159   'data': {
3160     'host': 'str',
3161     'port': 'str',
3162     '*to': 'uint16',
3163     '*ipv4': 'bool',
3164     '*ipv6': 'bool' } }
3167 # @UnixSocketAddress
3169 # Captures a socket address in the local ("Unix socket") namespace.
3171 # @path: filesystem path to use
3173 # Since 1.3
3175 { 'type': 'UnixSocketAddress',
3176   'data': {
3177     'path': 'str' } }
3180 # @SocketAddress
3182 # Captures the address of a socket, which could also be a named file descriptor
3184 # Since 1.3
3186 { 'union': 'SocketAddress',
3187   'data': {
3188     'inet': 'InetSocketAddress',
3189     'unix': 'UnixSocketAddress',
3190     'fd': 'String' } }
3193 # @getfd:
3195 # Receive a file descriptor via SCM rights and assign it a name
3197 # @fdname: file descriptor name
3199 # Returns: Nothing on success
3201 # Since: 0.14.0
3203 # Notes: If @fdname already exists, the file descriptor assigned to
3204 #        it will be closed and replaced by the received file
3205 #        descriptor.
3206 #        The 'closefd' command can be used to explicitly close the
3207 #        file descriptor when it is no longer needed.
3209 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3212 # @closefd:
3214 # Close a file descriptor previously passed via SCM rights
3216 # @fdname: file descriptor name
3218 # Returns: Nothing on success
3220 # Since: 0.14.0
3222 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3225 # @MachineInfo:
3227 # Information describing a machine.
3229 # @name: the name of the machine
3231 # @alias: #optional an alias for the machine name
3233 # @default: #optional whether the machine is default
3235 # @cpu-max: maximum number of CPUs supported by the machine type
3236 #           (since 1.5.0)
3238 # Since: 1.2.0
3240 { 'type': 'MachineInfo',
3241   'data': { 'name': 'str', '*alias': 'str',
3242             '*is-default': 'bool', 'cpu-max': 'int' } }
3245 # @query-machines:
3247 # Return a list of supported machines
3249 # Returns: a list of MachineInfo
3251 # Since: 1.2.0
3253 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3256 # @CpuDefinitionInfo:
3258 # Virtual CPU definition.
3260 # @name: the name of the CPU definition
3262 # Since: 1.2.0
3264 { 'type': 'CpuDefinitionInfo',
3265   'data': { 'name': 'str' } }
3268 # @query-cpu-definitions:
3270 # Return a list of supported virtual CPU definitions
3272 # Returns: a list of CpuDefInfo
3274 # Since: 1.2.0
3276 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3278 # @AddfdInfo:
3280 # Information about a file descriptor that was added to an fd set.
3282 # @fdset-id: The ID of the fd set that @fd was added to.
3284 # @fd: The file descriptor that was received via SCM rights and
3285 #      added to the fd set.
3287 # Since: 1.2.0
3289 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3292 # @add-fd:
3294 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3296 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3298 # @opaque: #optional A free-form string that can be used to describe the fd.
3300 # Returns: @AddfdInfo on success
3301 #          If file descriptor was not received, FdNotSupplied
3302 #          If @fdset-id is a negative value, InvalidParameterValue
3304 # Notes: The list of fd sets is shared by all monitor connections.
3306 #        If @fdset-id is not specified, a new fd set will be created.
3308 # Since: 1.2.0
3310 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3311   'returns': 'AddfdInfo' }
3314 # @remove-fd:
3316 # Remove a file descriptor from an fd set.
3318 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3320 # @fd: #optional The file descriptor that is to be removed.
3322 # Returns: Nothing on success
3323 #          If @fdset-id or @fd is not found, FdNotFound
3325 # Since: 1.2.0
3327 # Notes: The list of fd sets is shared by all monitor connections.
3329 #        If @fd is not specified, all file descriptors in @fdset-id
3330 #        will be removed.
3332 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3335 # @FdsetFdInfo:
3337 # Information about a file descriptor that belongs to an fd set.
3339 # @fd: The file descriptor value.
3341 # @opaque: #optional A free-form string that can be used to describe the fd.
3343 # Since: 1.2.0
3345 { 'type': 'FdsetFdInfo',
3346   'data': {'fd': 'int', '*opaque': 'str'} }
3349 # @FdsetInfo:
3351 # Information about an fd set.
3353 # @fdset-id: The ID of the fd set.
3355 # @fds: A list of file descriptors that belong to this fd set.
3357 # Since: 1.2.0
3359 { 'type': 'FdsetInfo',
3360   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3363 # @query-fdsets:
3365 # Return information describing all fd sets.
3367 # Returns: A list of @FdsetInfo
3369 # Since: 1.2.0
3371 # Note: The list of fd sets is shared by all monitor connections.
3374 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3377 # @TargetInfo:
3379 # Information describing the QEMU target.
3381 # @arch: the target architecture (eg "x86_64", "i386", etc)
3383 # Since: 1.2.0
3385 { 'type': 'TargetInfo',
3386   'data': { 'arch': 'str' } }
3389 # @query-target:
3391 # Return information about the target for this QEMU
3393 # Returns: TargetInfo
3395 # Since: 1.2.0
3397 { 'command': 'query-target', 'returns': 'TargetInfo' }
3400 # @QKeyCode:
3402 # An enumeration of key name.
3404 # This is used by the send-key command.
3406 # Since: 1.3.0
3408 { 'enum': 'QKeyCode',
3409   'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3410             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3411             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3412             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3413             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3414             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3415             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3416             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3417             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3418             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3419             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3420             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3421             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3422             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3423              'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3426 # @KeyValue
3428 # Represents a keyboard key.
3430 # Since: 1.3.0
3432 { 'union': 'KeyValue',
3433   'data': {
3434     'number': 'int',
3435     'qcode': 'QKeyCode' } }
3438 # @send-key:
3440 # Send keys to guest.
3442 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3443 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3444 #        directly to the guest, while @KeyValue.qcode must be a valid
3445 #        @QKeyCode value
3447 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3448 #             to 100
3450 # Returns: Nothing on success
3451 #          If key is unknown or redundant, InvalidParameter
3453 # Since: 1.3.0
3456 { 'command': 'send-key',
3457   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3460 # @screendump:
3462 # Write a PPM of the VGA screen to a file.
3464 # @filename: the path of a new PPM file to store the image
3466 # Returns: Nothing on success
3468 # Since: 0.14.0
3470 { 'command': 'screendump', 'data': {'filename': 'str'} }
3473 # @nbd-server-start:
3475 # Start an NBD server listening on the given host and port.  Block
3476 # devices can then be exported using @nbd-server-add.  The NBD
3477 # server will present them as named exports; for example, another
3478 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3480 # @addr: Address on which to listen.
3482 # Returns: error if the server is already running.
3484 # Since: 1.3.0
3486 { 'command': 'nbd-server-start',
3487   'data': { 'addr': 'SocketAddress' } }
3490 # @nbd-server-add:
3492 # Export a device to QEMU's embedded NBD server.
3494 # @device: Block device to be exported
3496 # @writable: Whether clients should be able to write to the device via the
3497 #     NBD connection (default false). #optional
3499 # Returns: error if the device is already marked for export.
3501 # Since: 1.3.0
3503 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3506 # @nbd-server-stop:
3508 # Stop QEMU's embedded NBD server, and unregister all devices previously
3509 # added via @nbd-server-add.
3511 # Since: 1.3.0
3513 { 'command': 'nbd-server-stop' }
3516 # @ChardevFile:
3518 # Configuration info for file chardevs.
3520 # @in:  #optional The name of the input file
3521 # @out: The name of the output file
3523 # Since: 1.4
3525 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3526                                    'out' : 'str' } }
3529 # @ChardevHostdev:
3531 # Configuration info for device and pipe chardevs.
3533 # @device: The name of the special file for the device,
3534 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3535 # @type: What kind of device this is.
3537 # Since: 1.4
3539 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3542 # @ChardevSocket:
3544 # Configuration info for (stream) socket chardevs.
3546 # @addr: socket address to listen on (server=true)
3547 #        or connect to (server=false)
3548 # @server: #optional create server socket (default: true)
3549 # @wait: #optional wait for incoming connection on server
3550 #        sockets (default: false).
3551 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3552 # @telnet: #optional enable telnet protocol on server
3553 #          sockets (default: false)
3555 # Since: 1.4
3557 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3558                                      '*server'  : 'bool',
3559                                      '*wait'    : 'bool',
3560                                      '*nodelay' : 'bool',
3561                                      '*telnet'  : 'bool' } }
3564 # @ChardevUdp:
3566 # Configuration info for datagram socket chardevs.
3568 # @remote: remote address
3569 # @local: #optional local address
3571 # Since: 1.5
3573 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3574                                   '*local' : 'SocketAddress' } }
3577 # @ChardevMux:
3579 # Configuration info for mux chardevs.
3581 # @chardev: name of the base chardev.
3583 # Since: 1.5
3585 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3588 # @ChardevStdio:
3590 # Configuration info for stdio chardevs.
3592 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3593 #          be delivered to qemu.  Default: true in -nographic mode,
3594 #          false otherwise.
3596 # Since: 1.5
3598 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3601 # @ChardevSpiceChannel:
3603 # Configuration info for spice vm channel chardevs.
3605 # @type: kind of channel (for example vdagent).
3607 # Since: 1.5
3609 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3612 # @ChardevSpicePort:
3614 # Configuration info for spice port chardevs.
3616 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3618 # Since: 1.5
3620 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3623 # @ChardevVC:
3625 # Configuration info for virtual console chardevs.
3627 # @width:  console width,  in pixels
3628 # @height: console height, in pixels
3629 # @cols:   console width,  in chars
3630 # @rows:   console height, in chars
3632 # Since: 1.5
3634 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3635                                  '*height' : 'int',
3636                                  '*cols'   : 'int',
3637                                  '*rows'   : 'int' } }
3640 # @ChardevRingbuf:
3642 # Configuration info for ring buffer chardevs.
3644 # @size: #optional ring buffer size, must be power of two, default is 65536
3646 # Since: 1.5
3648 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3651 # @ChardevBackend:
3653 # Configuration info for the new chardev backend.
3655 # Since: 1.4
3657 { 'type': 'ChardevDummy', 'data': { } }
3659 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3660                                        'serial' : 'ChardevHostdev',
3661                                        'parallel': 'ChardevHostdev',
3662                                        'pipe'   : 'ChardevHostdev',
3663                                        'socket' : 'ChardevSocket',
3664                                        'udp'    : 'ChardevUdp',
3665                                        'pty'    : 'ChardevDummy',
3666                                        'null'   : 'ChardevDummy',
3667                                        'mux'    : 'ChardevMux',
3668                                        'msmouse': 'ChardevDummy',
3669                                        'braille': 'ChardevDummy',
3670                                        'stdio'  : 'ChardevStdio',
3671                                        'console': 'ChardevDummy',
3672                                        'spicevmc' : 'ChardevSpiceChannel',
3673                                        'spiceport' : 'ChardevSpicePort',
3674                                        'vc'     : 'ChardevVC',
3675                                        'ringbuf': 'ChardevRingbuf',
3676                                        # next one is just for compatibility
3677                                        'memory' : 'ChardevRingbuf' } }
3680 # @ChardevReturn:
3682 # Return info about the chardev backend just created.
3684 # @pty: #optional name of the slave pseudoterminal device, present if
3685 #       and only if a chardev of type 'pty' was created
3687 # Since: 1.4
3689 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3692 # @chardev-add:
3694 # Add a character device backend
3696 # @id: the chardev's ID, must be unique
3697 # @backend: backend type and parameters
3699 # Returns: ChardevReturn.
3701 # Since: 1.4
3703 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3704                                      'backend' : 'ChardevBackend' },
3705   'returns': 'ChardevReturn' }
3708 # @chardev-remove:
3710 # Remove a character device backend
3712 # @id: the chardev's ID, must exist and not be in use
3714 # Returns: Nothing on success
3716 # Since: 1.4
3718 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3721 # @TpmModel:
3723 # An enumeration of TPM models
3725 # @tpm-tis: TPM TIS model
3727 # Since: 1.5
3729 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3732 # @query-tpm-models:
3734 # Return a list of supported TPM models
3736 # Returns: a list of TpmModel
3738 # Since: 1.5
3740 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3743 # @TpmType:
3745 # An enumeration of TPM types
3747 # @passthrough: TPM passthrough type
3749 # Since: 1.5
3751 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3754 # @query-tpm-types:
3756 # Return a list of supported TPM types
3758 # Returns: a list of TpmType
3760 # Since: 1.5
3762 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3765 # @TPMPassthroughOptions:
3767 # Information about the TPM passthrough type
3769 # @path: #optional string describing the path used for accessing the TPM device
3771 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3772 #               for cancellation of TPM commands while they are executing
3774 # Since: 1.5
3776 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3777                                              '*cancel-path' : 'str'} }
3780 # @TpmTypeOptions:
3782 # A union referencing different TPM backend types' configuration options
3784 # @passthrough: The configuration options for the TPM passthrough type
3786 # Since: 1.5
3788 { 'union': 'TpmTypeOptions',
3789    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3792 # @TpmInfo:
3794 # Information about the TPM
3796 # @id: The Id of the TPM
3798 # @model: The TPM frontend model
3800 # @options: The TPM (backend) type configuration options
3802 # Since: 1.5
3804 { 'type': 'TPMInfo',
3805   'data': {'id': 'str',
3806            'model': 'TpmModel',
3807            'options': 'TpmTypeOptions' } }
3810 # @query-tpm:
3812 # Return information about the TPM device
3814 # Returns: @TPMInfo on success
3816 # Since: 1.5
3818 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3821 # @AcpiTableOptions
3823 # Specify an ACPI table on the command line to load.
3825 # At most one of @file and @data can be specified. The list of files specified
3826 # by any one of them is loaded and concatenated in order. If both are omitted,
3827 # @data is implied.
3829 # Other fields / optargs can be used to override fields of the generic ACPI
3830 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3831 # Description Table Header. If a header field is not overridden, then the
3832 # corresponding value from the concatenated blob is used (in case of @file), or
3833 # it is filled in with a hard-coded value (in case of @data).
3835 # String fields are copied into the matching ACPI member from lowest address
3836 # upwards, and silently truncated / NUL-padded to length.
3838 # @sig: #optional table signature / identifier (4 bytes)
3840 # @rev: #optional table revision number (dependent on signature, 1 byte)
3842 # @oem_id: #optional OEM identifier (6 bytes)
3844 # @oem_table_id: #optional OEM table identifier (8 bytes)
3846 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3848 # @asl_compiler_id: #optional identifier of the utility that created the table
3849 #                   (4 bytes)
3851 # @asl_compiler_rev: #optional revision number of the utility that created the
3852 #                    table (4 bytes)
3854 # @file: #optional colon (:) separated list of pathnames to load and
3855 #        concatenate as table data. The resultant binary blob is expected to
3856 #        have an ACPI table header. At least one file is required. This field
3857 #        excludes @data.
3859 # @data: #optional colon (:) separated list of pathnames to load and
3860 #        concatenate as table data. The resultant binary blob must not have an
3861 #        ACPI table header. At least one file is required. This field excludes
3862 #        @file.
3864 # Since 1.5
3866 { 'type': 'AcpiTableOptions',
3867   'data': {
3868     '*sig':               'str',
3869     '*rev':               'uint8',
3870     '*oem_id':            'str',
3871     '*oem_table_id':      'str',
3872     '*oem_rev':           'uint32',
3873     '*asl_compiler_id':   'str',
3874     '*asl_compiler_rev':  'uint32',
3875     '*file':              'str',
3876     '*data':              'str' }}
3879 # @CommandLineParameterType:
3881 # Possible types for an option parameter.
3883 # @string: accepts a character string
3885 # @boolean: accepts "on" or "off"
3887 # @number: accepts a number
3889 # @size: accepts a number followed by an optional suffix (K)ilo,
3890 #        (M)ega, (G)iga, (T)era
3892 # Since 1.5
3894 { 'enum': 'CommandLineParameterType',
3895   'data': ['string', 'boolean', 'number', 'size'] }
3898 # @CommandLineParameterInfo:
3900 # Details about a single parameter of a command line option.
3902 # @name: parameter name
3904 # @type: parameter @CommandLineParameterType
3906 # @help: #optional human readable text string, not suitable for parsing.
3908 # Since 1.5
3910 { 'type': 'CommandLineParameterInfo',
3911   'data': { 'name': 'str',
3912             'type': 'CommandLineParameterType',
3913             '*help': 'str' } }
3916 # @CommandLineOptionInfo:
3918 # Details about a command line option, including its list of parameter details
3920 # @option: option name
3922 # @parameters: an array of @CommandLineParameterInfo
3924 # Since 1.5
3926 { 'type': 'CommandLineOptionInfo',
3927   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3930 # @query-command-line-options:
3932 # Query command line option schema.
3934 # @option: #optional option name
3936 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3937 #          @option).  Returns an error if the given @option doesn't exist.
3939 # Since 1.5
3941 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3942  'returns': ['CommandLineOptionInfo'] }
3945 # @X86CPURegister32
3947 # A X86 32-bit register
3949 # Since: 1.5
3951 { 'enum': 'X86CPURegister32',
3952   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3955 # @X86CPUFeatureWordInfo
3957 # Information about a X86 CPU feature word
3959 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3961 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3962 #                   feature word
3964 # @cpuid-register: Output register containing the feature bits
3966 # @features: value of output register, containing the feature bits
3968 # Since: 1.5
3970 { 'type': 'X86CPUFeatureWordInfo',
3971   'data': { 'cpuid-input-eax': 'int',
3972             '*cpuid-input-ecx': 'int',
3973             'cpuid-register': 'X86CPURegister32',
3974             'features': 'int' } }
3977 # @RxState:
3979 # Packets receiving state
3981 # @normal: filter assigned packets according to the mac-table
3983 # @none: don't receive any assigned packet
3985 # @all: receive all assigned packets
3987 # Since: 1.6
3989 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
3992 # @RxFilterInfo:
3994 # Rx-filter information for a NIC.
3996 # @name: net client name
3998 # @promiscuous: whether promiscuous mode is enabled
4000 # @multicast: multicast receive state
4002 # @unicast: unicast receive state
4004 # @broadcast-allowed: whether to receive broadcast
4006 # @multicast-overflow: multicast table is overflowed or not
4008 # @unicast-overflow: unicast table is overflowed or not
4010 # @main-mac: the main macaddr string
4012 # @vlan-table: a list of active vlan id
4014 # @unicast-table: a list of unicast macaddr string
4016 # @multicast-table: a list of multicast macaddr string
4018 # Since 1.6
4021 { 'type': 'RxFilterInfo',
4022   'data': {
4023     'name':               'str',
4024     'promiscuous':        'bool',
4025     'multicast':          'RxState',
4026     'unicast':            'RxState',
4027     'broadcast-allowed':  'bool',
4028     'multicast-overflow': 'bool',
4029     'unicast-overflow':   'bool',
4030     'main-mac':           'str',
4031     'vlan-table':         ['int'],
4032     'unicast-table':      ['str'],
4033     'multicast-table':    ['str'] }}
4036 # @query-rx-filter:
4038 # Return rx-filter information for all NICs (or for the given NIC).
4040 # @name: #optional net client name
4042 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4043 #          Returns an error if the given @name doesn't exist, or given
4044 #          NIC doesn't support rx-filter querying, or given net client
4045 #          isn't a NIC.
4047 # Since: 1.6
4049 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4050   'returns': ['RxFilterInfo'] }
4054 # @BlockdevDiscardOptions
4056 # Determines how to handle discard requests.
4058 # @ignore:      Ignore the request
4059 # @unmap:       Forward as an unmap request
4061 # Since: 1.7
4063 { 'enum': 'BlockdevDiscardOptions',
4064   'data': [ 'ignore', 'unmap' ] }
4067 # @BlockdevAioOptions
4069 # Selects the AIO backend to handle I/O requests
4071 # @threads:     Use qemu's thread pool
4072 # @native:      Use native AIO backend (only Linux and Windows)
4074 # Since: 1.7
4076 { 'enum': 'BlockdevAioOptions',
4077   'data': [ 'threads', 'native' ] }
4080 # @BlockdevCacheOptions
4082 # Includes cache-related options for block devices
4084 # @writeback:   #optional enables writeback mode for any caches (default: true)
4085 # @direct:      #optional enables use of O_DIRECT (bypass the host page cache;
4086 #               default: false)
4087 # @no-flush:    #optional ignore any flush requests for the device (default:
4088 #               false)
4090 # Since: 1.7
4092 { 'type': 'BlockdevCacheOptions',
4093   'data': { '*writeback': 'bool',
4094             '*direct': 'bool',
4095             '*no-flush': 'bool' } }
4098 # @BlockdevOptionsBase
4100 # Options that are available for all block devices, independent of the block
4101 # driver.
4103 # @driver:      block driver name
4104 # @id:          #optional id by which the new block device can be referred to.
4105 #               This is a required option on the top level of blockdev-add, and
4106 #               currently not allowed on any other level.
4107 # @node-name:   #optional the name of a block driver state node (Since 2.0)
4108 # @discard:     #optional discard-related options (default: ignore)
4109 # @cache:       #optional cache-related options
4110 # @aio:         #optional AIO backend (default: threads)
4111 # @rerror:      #optional how to handle read errors on the device
4112 #               (default: report)
4113 # @werror:      #optional how to handle write errors on the device
4114 #               (default: enospc)
4115 # @read-only:   #optional whether the block device should be read-only
4116 #               (default: false)
4118 # Since: 1.7
4120 { 'type': 'BlockdevOptionsBase',
4121   'data': { 'driver': 'str',
4122             '*id': 'str',
4123             '*node-name': 'str',
4124             '*discard': 'BlockdevDiscardOptions',
4125             '*cache': 'BlockdevCacheOptions',
4126             '*aio': 'BlockdevAioOptions',
4127             '*rerror': 'BlockdevOnError',
4128             '*werror': 'BlockdevOnError',
4129             '*read-only': 'bool' } }
4132 # @BlockdevOptionsFile
4134 # Driver specific block device options for the file backend and similar
4135 # protocols.
4137 # @filename:    path to the image file
4139 # Since: 1.7
4141 { 'type': 'BlockdevOptionsFile',
4142   'data': { 'filename': 'str' } }
4145 # @BlockdevOptionsVVFAT
4147 # Driver specific block device options for the vvfat protocol.
4149 # @dir:         directory to be exported as FAT image
4150 # @fat-type:    #optional FAT type: 12, 16 or 32
4151 # @floppy:      #optional whether to export a floppy image (true) or
4152 #               partitioned hard disk (false; default)
4153 # @rw:          #optional whether to allow write operations (default: false)
4155 # Since: 1.7
4157 { 'type': 'BlockdevOptionsVVFAT',
4158   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4159             '*rw': 'bool' } }
4162 # @BlockdevOptionsGenericFormat
4164 # Driver specific block device options for image format that have no option
4165 # besides their data source.
4167 # @file:        reference to or definition of the data source block device
4169 # Since: 1.7
4171 { 'type': 'BlockdevOptionsGenericFormat',
4172   'data': { 'file': 'BlockdevRef' } }
4175 # @BlockdevOptionsGenericCOWFormat
4177 # Driver specific block device options for image format that have no option
4178 # besides their data source and an optional backing file.
4180 # @backing:     #optional reference to or definition of the backing file block
4181 #               device (if missing, taken from the image file content). It is
4182 #               allowed to pass an empty string here in order to disable the
4183 #               default backing file.
4185 # Since: 1.7
4187 { 'type': 'BlockdevOptionsGenericCOWFormat',
4188   'base': 'BlockdevOptionsGenericFormat',
4189   'data': { '*backing': 'BlockdevRef' } }
4192 # @BlockdevOptionsQcow2
4194 # Driver specific block device options for qcow2.
4196 # @lazy-refcounts:        #optional whether to enable the lazy refcounts
4197 #                         feature (default is taken from the image file)
4199 # @pass-discard-request:  #optional whether discard requests to the qcow2
4200 #                         device should be forwarded to the data source
4202 # @pass-discard-snapshot: #optional whether discard requests for the data source
4203 #                         should be issued when a snapshot operation (e.g.
4204 #                         deleting a snapshot) frees clusters in the qcow2 file
4206 # @pass-discard-other:    #optional whether discard requests for the data source
4207 #                         should be issued on other occasions where a cluster
4208 #                         gets freed
4210 # Since: 1.7
4212 { 'type': 'BlockdevOptionsQcow2',
4213   'base': 'BlockdevOptionsGenericCOWFormat',
4214   'data': { '*lazy-refcounts': 'bool',
4215             '*pass-discard-request': 'bool',
4216             '*pass-discard-snapshot': 'bool',
4217             '*pass-discard-other': 'bool' } }
4220 # @BlkdebugEvent
4222 # Trigger events supported by blkdebug.
4224 { 'enum': 'BlkdebugEvent',
4225   'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
4226             'l1_grow.activate_table', 'l2_load', 'l2_update',
4227             'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
4228             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
4229             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
4230             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
4231             'refblock_load', 'refblock_update', 'refblock_update_part',
4232             'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
4233             'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
4234             'refblock_alloc.switch_table', 'cluster_alloc',
4235             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
4236             'flush_to_disk' ] }
4239 # @BlkdebugInjectErrorOptions
4241 # Describes a single error injection for blkdebug.
4243 # @event:       trigger event
4245 # @state:       #optional the state identifier blkdebug needs to be in to
4246 #               actually trigger the event; defaults to "any"
4248 # @errno:       #optional error identifier (errno) to be returned; defaults to
4249 #               EIO
4251 # @sector:      #optional specifies the sector index which has to be affected
4252 #               in order to actually trigger the event; defaults to "any
4253 #               sector"
4255 # @once:        #optional disables further events after this one has been
4256 #               triggered; defaults to false
4258 # @immediately: #optional fail immediately; defaults to false
4260 # Since: 2.0
4262 { 'type': 'BlkdebugInjectErrorOptions',
4263   'data': { 'event': 'BlkdebugEvent',
4264             '*state': 'int',
4265             '*errno': 'int',
4266             '*sector': 'int',
4267             '*once': 'bool',
4268             '*immediately': 'bool' } }
4271 # @BlkdebugSetStateOptions
4273 # Describes a single state-change event for blkdebug.
4275 # @event:       trigger event
4277 # @state:       #optional the current state identifier blkdebug needs to be in;
4278 #               defaults to "any"
4280 # @new_state:   the state identifier blkdebug is supposed to assume if
4281 #               this event is triggered
4283 # Since: 2.0
4285 { 'type': 'BlkdebugSetStateOptions',
4286   'data': { 'event': 'BlkdebugEvent',
4287             '*state': 'int',
4288             'new_state': 'int' } }
4291 # @BlockdevOptionsBlkdebug
4293 # Driver specific block device options for blkdebug.
4295 # @image:           underlying raw block device (or image file)
4297 # @config:          #optional filename of the configuration file
4299 # @inject-error:    #optional array of error injection descriptions
4301 # @set-state:       #optional array of state-change descriptions
4303 # Since: 2.0
4305 { 'type': 'BlockdevOptionsBlkdebug',
4306   'data': { 'image': 'BlockdevRef',
4307             '*config': 'str',
4308             '*inject-error': ['BlkdebugInjectErrorOptions'],
4309             '*set-state': ['BlkdebugSetStateOptions'] } }
4312 # @BlockdevOptionsBlkverify
4314 # Driver specific block device options for blkverify.
4316 # @test:    block device to be tested
4318 # @raw:     raw image used for verification
4320 # Since: 2.0
4322 { 'type': 'BlockdevOptionsBlkverify',
4323   'data': { 'test': 'BlockdevRef',
4324             'raw': 'BlockdevRef' } }
4327 # @BlockdevOptions
4329 # Options for creating a block device.
4331 # Since: 1.7
4333 { 'union': 'BlockdevOptions',
4334   'base': 'BlockdevOptionsBase',
4335   'discriminator': 'driver',
4336   'data': {
4337       'file':       'BlockdevOptionsFile',
4338       'http':       'BlockdevOptionsFile',
4339       'https':      'BlockdevOptionsFile',
4340       'ftp':        'BlockdevOptionsFile',
4341       'ftps':       'BlockdevOptionsFile',
4342       'tftp':       'BlockdevOptionsFile',
4343 # TODO gluster: Wait for structured options
4344 # TODO iscsi: Wait for structured options
4345 # TODO nbd: Should take InetSocketAddress for 'host'?
4346 # TODO rbd: Wait for structured options
4347 # TODO sheepdog: Wait for structured options
4348 # TODO ssh: Should take InetSocketAddress for 'host'?
4349       'vvfat':      'BlockdevOptionsVVFAT',
4350       'blkdebug':   'BlockdevOptionsBlkdebug',
4351       'blkverify':  'BlockdevOptionsBlkverify',
4352       'bochs':      'BlockdevOptionsGenericFormat',
4353       'cloop':      'BlockdevOptionsGenericFormat',
4354       'cow':        'BlockdevOptionsGenericCOWFormat',
4355       'dmg':        'BlockdevOptionsGenericFormat',
4356       'parallels':  'BlockdevOptionsGenericFormat',
4357       'qcow':       'BlockdevOptionsGenericCOWFormat',
4358       'qcow2':      'BlockdevOptionsQcow2',
4359       'qed':        'BlockdevOptionsGenericCOWFormat',
4360       'raw':        'BlockdevOptionsGenericFormat',
4361       'vdi':        'BlockdevOptionsGenericFormat',
4362       'vhdx':       'BlockdevOptionsGenericFormat',
4363       'vmdk':       'BlockdevOptionsGenericCOWFormat',
4364       'vpc':        'BlockdevOptionsGenericFormat'
4365   } }
4368 # @BlockdevRef
4370 # Reference to a block device.
4372 # @definition:      defines a new block device inline
4373 # @reference:       references the ID of an existing block device. An
4374 #                   empty string means that no block device should be
4375 #                   referenced.
4377 # Since: 1.7
4379 { 'union': 'BlockdevRef',
4380   'discriminator': {},
4381   'data': { 'definition': 'BlockdevOptions',
4382             'reference': 'str' } }
4385 # @blockdev-add:
4387 # Creates a new block device.
4389 # @options: block device options for the new device
4391 # Since: 1.7
4393 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }