misc: Spelling and grammar fixes in comments
[qemu/ar7.git] / qapi-schema.json
bloba003aa176340c9100de85d458ce6442e979314ae
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 # @ImageInfoSpecific:
230 # A discriminated record of image format specific information structures.
232 # Since: 1.7
235 { 'union': 'ImageInfoSpecific',
236   'data': {
237       'qcow2': 'ImageInfoSpecificQCow2'
238   } }
241 # @ImageInfo:
243 # Information about a QEMU image file
245 # @filename: name of the image file
247 # @format: format of the image file
249 # @virtual-size: maximum capacity in bytes of the image
251 # @actual-size: #optional actual size on disk in bytes of the image
253 # @dirty-flag: #optional true if image is not cleanly closed
255 # @cluster-size: #optional size of a cluster in bytes
257 # @encrypted: #optional true if the image is encrypted
259 # @backing-filename: #optional name of the backing file
261 # @full-backing-filename: #optional full path of the backing file
263 # @backing-filename-format: #optional the format of the backing file
265 # @snapshots: #optional list of VM snapshots
267 # @backing-image: #optional info of the backing image (since 1.6)
269 # @format-specific: #optional structure supplying additional format-specific
270 # information (since 1.7)
272 # Since: 1.3
276 { 'type': 'ImageInfo',
277   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
278            '*actual-size': 'int', 'virtual-size': 'int',
279            '*cluster-size': 'int', '*encrypted': 'bool',
280            '*backing-filename': 'str', '*full-backing-filename': 'str',
281            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
282            '*backing-image': 'ImageInfo',
283            '*format-specific': 'ImageInfoSpecific' } }
286 # @ImageCheck:
288 # Information about a QEMU image file check
290 # @filename: name of the image file checked
292 # @format: format of the image file checked
294 # @check-errors: number of unexpected errors occurred during check
296 # @image-end-offset: #optional offset (in bytes) where the image ends, this
297 #                    field is present if the driver for the image format
298 #                    supports it
300 # @corruptions: #optional number of corruptions found during the check if any
302 # @leaks: #optional number of leaks found during the check if any
304 # @corruptions-fixed: #optional number of corruptions fixed during the check
305 #                     if any
307 # @leaks-fixed: #optional number of leaks fixed during the check if any
309 # @total-clusters: #optional total number of clusters, this field is present
310 #                  if the driver for the image format supports it
312 # @allocated-clusters: #optional total number of allocated clusters, this
313 #                      field is present if the driver for the image format
314 #                      supports it
316 # @fragmented-clusters: #optional total number of fragmented clusters, this
317 #                       field is present if the driver for the image format
318 #                       supports it
320 # @compressed-clusters: #optional total number of compressed clusters, this
321 #                       field is present if the driver for the image format
322 #                       supports it
324 # Since: 1.4
328 { 'type': 'ImageCheck',
329   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
330            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
331            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
332            '*total-clusters': 'int', '*allocated-clusters': 'int',
333            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
336 # @StatusInfo:
338 # Information about VCPU run state
340 # @running: true if all VCPUs are runnable, false if not runnable
342 # @singlestep: true if VCPUs are in single-step mode
344 # @status: the virtual machine @RunState
346 # Since:  0.14.0
348 # Notes: @singlestep is enabled through the GDB stub
350 { 'type': 'StatusInfo',
351   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
354 # @query-status:
356 # Query the run status of all VCPUs
358 # Returns: @StatusInfo reflecting all VCPUs
360 # Since:  0.14.0
362 { 'command': 'query-status', 'returns': 'StatusInfo' }
365 # @UuidInfo:
367 # Guest UUID information.
369 # @UUID: the UUID of the guest
371 # Since: 0.14.0
373 # Notes: If no UUID was specified for the guest, a null UUID is returned.
375 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
378 # @query-uuid:
380 # Query the guest UUID information.
382 # Returns: The @UuidInfo for the guest
384 # Since 0.14.0
386 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
389 # @ChardevInfo:
391 # Information about a character device.
393 # @label: the label of the character device
395 # @filename: the filename of the character device
397 # Notes: @filename is encoded using the QEMU command line character device
398 #        encoding.  See the QEMU man page for details.
400 # Since: 0.14.0
402 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
405 # @query-chardev:
407 # Returns information about current character devices.
409 # Returns: a list of @ChardevInfo
411 # Since: 0.14.0
413 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
416 # @DataFormat:
418 # An enumeration of data format.
420 # @utf8: Data is a UTF-8 string (RFC 3629)
422 # @base64: Data is Base64 encoded binary (RFC 3548)
424 # Since: 1.4
426 { 'enum': 'DataFormat',
427   'data': [ 'utf8', 'base64' ] }
430 # @ringbuf-write:
432 # Write to a ring buffer character device.
434 # @device: the ring buffer character device name
436 # @data: data to write
438 # @format: #optional data encoding (default 'utf8').
439 #          - base64: data must be base64 encoded text.  Its binary
440 #            decoding gets written.
441 #            Bug: invalid base64 is currently not rejected.
442 #            Whitespace *is* invalid.
443 #          - utf8: data's UTF-8 encoding is written
444 #          - data itself is always Unicode regardless of format, like
445 #            any other string.
447 # Returns: Nothing on success
449 # Since: 1.4
451 { 'command': 'ringbuf-write',
452   'data': {'device': 'str', 'data': 'str',
453            '*format': 'DataFormat'} }
456 # @ringbuf-read:
458 # Read from a ring buffer character device.
460 # @device: the ring buffer character device name
462 # @size: how many bytes to read at most
464 # @format: #optional data encoding (default 'utf8').
465 #          - base64: the data read is returned in base64 encoding.
466 #          - utf8: the data read is interpreted as UTF-8.
467 #            Bug: can screw up when the buffer contains invalid UTF-8
468 #            sequences, NUL characters, after the ring buffer lost
469 #            data, and when reading stops because the size limit is
470 #            reached.
471 #          - The return value is always Unicode regardless of format,
472 #            like any other string.
474 # Returns: data read from the device
476 # Since: 1.4
478 { 'command': 'ringbuf-read',
479   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
480   'returns': 'str' }
483 # @CommandInfo:
485 # Information about a QMP command
487 # @name: The command name
489 # Since: 0.14.0
491 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
494 # @query-commands:
496 # Return a list of supported QMP commands by this server
498 # Returns: A list of @CommandInfo for all supported commands
500 # Since: 0.14.0
502 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
505 # @EventInfo:
507 # Information about a QMP event
509 # @name: The event name
511 # Since: 1.2.0
513 { 'type': 'EventInfo', 'data': {'name': 'str'} }
516 # @query-events:
518 # Return a list of supported QMP events by this server
520 # Returns: A list of @EventInfo for all supported events
522 # Since: 1.2.0
524 { 'command': 'query-events', 'returns': ['EventInfo'] }
527 # @MigrationStats
529 # Detailed migration status.
531 # @transferred: amount of bytes already transferred to the target VM
533 # @remaining: amount of bytes remaining to be transferred to the target VM
535 # @total: total amount of bytes involved in the migration process
537 # @duplicate: number of duplicate (zero) pages (since 1.2)
539 # @skipped: number of skipped zero pages (since 1.5)
541 # @normal : number of normal pages (since 1.2)
543 # @normal-bytes: number of normal bytes sent (since 1.2)
545 # @dirty-pages-rate: number of pages dirtied by second by the
546 #        guest (since 1.3)
548 # @mbps: throughput in megabits/sec. (since 1.6)
550 # Since: 0.14.0
552 { 'type': 'MigrationStats',
553   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
554            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
555            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
556            'mbps' : 'number' } }
559 # @XBZRLECacheStats
561 # Detailed XBZRLE migration cache statistics
563 # @cache-size: XBZRLE cache size
565 # @bytes: amount of bytes already transferred to the target VM
567 # @pages: amount of pages transferred to the target VM
569 # @cache-miss: number of cache miss
571 # @overflow: number of overflows
573 # Since: 1.2
575 { 'type': 'XBZRLECacheStats',
576   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
577            'cache-miss': 'int', 'overflow': 'int' } }
580 # @MigrationInfo
582 # Information about current migration process.
584 # @status: #optional string describing the current migration status.
585 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
586 #          'cancelled'. If this field is not returned, no migration process
587 #          has been initiated
589 # @ram: #optional @MigrationStats containing detailed migration
590 #       status, only returned if status is 'active' or
591 #       'completed'. 'comppleted' (since 1.2)
593 # @disk: #optional @MigrationStats containing detailed disk migration
594 #        status, only returned if status is 'active' and it is a block
595 #        migration
597 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
598 #                migration statistics, only returned if XBZRLE feature is on and
599 #                status is 'active' or 'completed' (since 1.2)
601 # @total-time: #optional total amount of milliseconds since migration started.
602 #        If migration has ended, it returns the total migration
603 #        time. (since 1.2)
605 # @downtime: #optional only present when migration finishes correctly
606 #        total downtime in milliseconds for the guest.
607 #        (since 1.3)
609 # @expected-downtime: #optional only present while migration is active
610 #        expected downtime in milliseconds for the guest in last walk
611 #        of the dirty bitmap. (since 1.3)
613 # @setup-time: #optional amount of setup time in milliseconds _before_ the
614 #        iterations begin but _after_ the QMP command is issued. This is designed
615 #        to provide an accounting of any activities (such as RDMA pinning) which
616 #        may be expensive, but do not actually occur during the iterative
617 #        migration rounds themselves. (since 1.6)
619 # Since: 0.14.0
621 { 'type': 'MigrationInfo',
622   'data': {'*status': 'str', '*ram': 'MigrationStats',
623            '*disk': 'MigrationStats',
624            '*xbzrle-cache': 'XBZRLECacheStats',
625            '*total-time': 'int',
626            '*expected-downtime': 'int',
627            '*downtime': 'int',
628            '*setup-time': 'int'} }
631 # @query-migrate
633 # Returns information about current migration process.
635 # Returns: @MigrationInfo
637 # Since: 0.14.0
639 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
642 # @MigrationCapability
644 # Migration capabilities enumeration
646 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
647 #          This feature allows us to minimize migration traffic for certain work
648 #          loads, by sending compressed difference of the pages
650 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
651 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
652 #          Disabled by default. Experimental: may (or may not) be renamed after
653 #          further testing is complete. (since 1.6)
655 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
656 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
657 #          source and target VM to support this feature. To enable it is sufficient
658 #          to enable the capability on the source VM. The feature is disabled by
659 #          default. (since 1.6)
661 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
662 #          to speed up convergence of RAM migration. (since 1.6)
664 # Since: 1.2
666 { 'enum': 'MigrationCapability',
667   'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
670 # @MigrationCapabilityStatus
672 # Migration capability information
674 # @capability: capability enum
676 # @state: capability state bool
678 # Since: 1.2
680 { 'type': 'MigrationCapabilityStatus',
681   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
684 # @migrate-set-capabilities
686 # Enable/Disable the following migration capabilities (like xbzrle)
688 # @capabilities: json array of capability modifications to make
690 # Since: 1.2
692 { 'command': 'migrate-set-capabilities',
693   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
696 # @query-migrate-capabilities
698 # Returns information about the current migration capabilities status
700 # Returns: @MigrationCapabilitiesStatus
702 # Since: 1.2
704 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
707 # @MouseInfo:
709 # Information about a mouse device.
711 # @name: the name of the mouse device
713 # @index: the index of the mouse device
715 # @current: true if this device is currently receiving mouse events
717 # @absolute: true if this device supports absolute coordinates as input
719 # Since: 0.14.0
721 { 'type': 'MouseInfo',
722   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
723            'absolute': 'bool'} }
726 # @query-mice:
728 # Returns information about each active mouse device
730 # Returns: a list of @MouseInfo for each device
732 # Since: 0.14.0
734 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
737 # @CpuInfo:
739 # Information about a virtual CPU
741 # @CPU: the index of the virtual CPU
743 # @current: this only exists for backwards compatible and should be ignored
745 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
746 #          to a processor specific low power mode.
748 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
749 #                pointer.
750 #                If the target is Sparc, this is the PC component of the
751 #                instruction pointer.
753 # @nip: #optional If the target is PPC, the instruction pointer
755 # @npc: #optional If the target is Sparc, the NPC component of the instruction
756 #                 pointer
758 # @PC: #optional If the target is MIPS, the instruction pointer
760 # @thread_id: ID of the underlying host thread
762 # Since: 0.14.0
764 # Notes: @halted is a transient state that changes frequently.  By the time the
765 #        data is sent to the client, the guest may no longer be halted.
767 { 'type': 'CpuInfo',
768   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
769            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
772 # @query-cpus:
774 # Returns a list of information about each virtual CPU.
776 # Returns: a list of @CpuInfo for each virtual CPU
778 # Since: 0.14.0
780 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
783 # @BlockDeviceInfo:
785 # Information about the backing device for a block device.
787 # @file: the filename of the backing device
789 # @ro: true if the backing device was open read-only
791 # @drv: the name of the block format used to open the backing device. As of
792 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
793 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
794 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
795 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
797 # @backing_file: #optional the name of the backing file (for copy-on-write)
799 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
801 # @encrypted: true if the backing device is encrypted
803 # @encryption_key_missing: true if the backing device is encrypted but an
804 #                          valid encryption key is missing
806 # @bps: total throughput limit in bytes per second is specified
808 # @bps_rd: read throughput limit in bytes per second is specified
810 # @bps_wr: write throughput limit in bytes per second is specified
812 # @iops: total I/O operations per second is specified
814 # @iops_rd: read I/O operations per second is specified
816 # @iops_wr: write I/O operations per second is specified
818 # @image: the info of image used (since: 1.6)
820 # @bps_max: #optional total max in bytes (Since 1.7)
822 # @bps_rd_max: #optional read max in bytes (Since 1.7)
824 # @bps_wr_max: #optional write max in bytes (Since 1.7)
826 # @iops_max: #optional total I/O operations max (Since 1.7)
828 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
830 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
832 # @iops_size: #optional an I/O size in bytes (Since 1.7)
834 # Since: 0.14.0
836 # Notes: This interface is only found in @BlockInfo.
838 { 'type': 'BlockDeviceInfo',
839   'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
840             '*backing_file': 'str', 'backing_file_depth': 'int',
841             'encrypted': 'bool', 'encryption_key_missing': 'bool',
842             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
843             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
844             'image': 'ImageInfo',
845             '*bps_max': 'int', '*bps_rd_max': 'int',
846             '*bps_wr_max': 'int', '*iops_max': 'int',
847             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
848             '*iops_size': 'int' } }
851 # @BlockDeviceIoStatus:
853 # An enumeration of block device I/O status.
855 # @ok: The last I/O operation has succeeded
857 # @failed: The last I/O operation has failed
859 # @nospace: The last I/O operation has failed due to a no-space condition
861 # Since: 1.0
863 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
866 # @BlockDeviceMapEntry:
868 # Entry in the metadata map of the device (returned by "qemu-img map")
870 # @start: Offset in the image of the first byte described by this entry
871 #         (in bytes)
873 # @length: Length of the range described by this entry (in bytes)
875 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
876 #         before reaching one for which the range is allocated.  The value is
877 #         in the range 0 to the depth of the image chain - 1.
879 # @zero: the sectors in this range read as zeros
881 # @data: reading the image will actually read data from a file (in particular,
882 #        if @offset is present this means that the sectors are not simply
883 #        preallocated, but contain actual data in raw format)
885 # @offset: if present, the image file stores the data for this range in
886 #          raw format at the given offset.
888 # Since 1.7
890 { 'type': 'BlockDeviceMapEntry',
891   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
892             'data': 'bool', '*offset': 'int' } }
895 # @BlockDirtyInfo:
897 # Block dirty bitmap information.
899 # @count: number of dirty bytes according to the dirty bitmap
901 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
903 # Since: 1.3
905 { 'type': 'BlockDirtyInfo',
906   'data': {'count': 'int', 'granularity': 'int'} }
909 # @BlockInfo:
911 # Block device information.  This structure describes a virtual device and
912 # the backing device associated with it.
914 # @device: The device name associated with the virtual device.
916 # @type: This field is returned only for compatibility reasons, it should
917 #        not be used (always returns 'unknown')
919 # @removable: True if the device supports removable media.
921 # @locked: True if the guest has locked this device from having its media
922 #          removed
924 # @tray_open: #optional True if the device has a tray and it is open
925 #             (only present if removable is true)
927 # @dirty: #optional dirty bitmap information (only present if the dirty
928 #         bitmap is enabled)
930 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
931 #             supports it and the VM is configured to stop on errors
933 # @inserted: #optional @BlockDeviceInfo describing the device if media is
934 #            present
936 # Since:  0.14.0
938 { 'type': 'BlockInfo',
939   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
940            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
941            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
942            '*dirty': 'BlockDirtyInfo' } }
945 # @query-block:
947 # Get a list of BlockInfo for all virtual block devices.
949 # Returns: a list of @BlockInfo describing each virtual block device
951 # Since: 0.14.0
953 { 'command': 'query-block', 'returns': ['BlockInfo'] }
956 # @BlockDeviceStats:
958 # Statistics of a virtual block device or a block backing device.
960 # @rd_bytes:      The number of bytes read by the device.
962 # @wr_bytes:      The number of bytes written by the device.
964 # @rd_operations: The number of read operations performed by the device.
966 # @wr_operations: The number of write operations performed by the device.
968 # @flush_operations: The number of cache flush operations performed by the
969 #                    device (since 0.15.0)
971 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
972 #                       (since 0.15.0).
974 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
976 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
978 # @wr_highest_offset: The offset after the greatest byte written to the
979 #                     device.  The intended use of this information is for
980 #                     growable sparse files (like qcow2) that are used on top
981 #                     of a physical device.
983 # Since: 0.14.0
985 { 'type': 'BlockDeviceStats',
986   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
987            'wr_operations': 'int', 'flush_operations': 'int',
988            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
989            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
992 # @BlockStats:
994 # Statistics of a virtual block device or a block backing device.
996 # @device: #optional If the stats are for a virtual block device, the name
997 #          corresponding to the virtual block device.
999 # @stats:  A @BlockDeviceStats for the device.
1001 # @parent: #optional This may point to the backing block device if this is a
1002 #          a virtual block device.  If it's a backing block, this will point
1003 #          to the backing file is one is present.
1005 # Since: 0.14.0
1007 { 'type': 'BlockStats',
1008   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1009            '*parent': 'BlockStats'} }
1012 # @query-blockstats:
1014 # Query the @BlockStats for all virtual block devices.
1016 # Returns: A list of @BlockStats for each virtual block devices.
1018 # Since: 0.14.0
1020 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1023 # @VncClientInfo:
1025 # Information about a connected VNC client.
1027 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1028 #        when possible.
1030 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1031 #          'ipv4' if the client is connected via IPv4 and TCP
1032 #          'unix' if the client is connected via a unix domain socket
1033 #          'unknown' otherwise
1035 # @service: The service name of the client's port.  This may depends on the
1036 #           host system's service database so symbolic names should not be
1037 #           relied on.
1039 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1040 #              Name of the client.
1042 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1043 #                 used for authentication.
1045 # Since: 0.14.0
1047 { 'type': 'VncClientInfo',
1048   'data': {'host': 'str', 'family': 'str', 'service': 'str',
1049            '*x509_dname': 'str', '*sasl_username': 'str'} }
1052 # @VncInfo:
1054 # Information about the VNC session.
1056 # @enabled: true if the VNC server is enabled, false otherwise
1058 # @host: #optional The hostname the VNC server is bound to.  This depends on
1059 #        the name resolution on the host and may be an IP address.
1061 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1062 #                    'ipv4' if the host is listening for IPv4 connections
1063 #                    'unix' if the host is listening on a unix domain socket
1064 #                    'unknown' otherwise
1066 # @service: #optional The service name of the server's port.  This may depends
1067 #           on the host system's service database so symbolic names should not
1068 #           be relied on.
1070 # @auth: #optional the current authentication type used by the server
1071 #        'none' if no authentication is being used
1072 #        'vnc' if VNC authentication is being used
1073 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1074 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1075 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1076 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1077 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1078 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1079 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1080 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1081 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1083 # @clients: a list of @VncClientInfo of all currently connected clients
1085 # Since: 0.14.0
1087 { 'type': 'VncInfo',
1088   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1089            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1092 # @query-vnc:
1094 # Returns information about the current VNC server
1096 # Returns: @VncInfo
1098 # Since: 0.14.0
1100 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1103 # @SpiceChannel
1105 # Information about a SPICE client channel.
1107 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1108 #        when possible.
1110 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1111 #          'ipv4' if the client is connected via IPv4 and TCP
1112 #          'unix' if the client is connected via a unix domain socket
1113 #          'unknown' otherwise
1115 # @port: The client's port number.
1117 # @connection-id: SPICE connection id number.  All channels with the same id
1118 #                 belong to the same SPICE session.
1120 # @connection-type: SPICE channel type number.  "1" is the main control
1121 #                   channel, filter for this one if you want to track spice
1122 #                   sessions only
1124 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1125 #              multiple channels of the same type exist, such as multiple
1126 #              display channels in a multihead setup
1128 # @tls: true if the channel is encrypted, false otherwise.
1130 # Since: 0.14.0
1132 { 'type': 'SpiceChannel',
1133   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1134            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1135            'tls': 'bool'} }
1138 # @SpiceQueryMouseMode
1140 # An enumeration of Spice mouse states.
1142 # @client: Mouse cursor position is determined by the client.
1144 # @server: Mouse cursor position is determined by the server.
1146 # @unknown: No information is available about mouse mode used by
1147 #           the spice server.
1149 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1151 # Since: 1.1
1153 { 'enum': 'SpiceQueryMouseMode',
1154   'data': [ 'client', 'server', 'unknown' ] }
1157 # @SpiceInfo
1159 # Information about the SPICE session.
1161 # @enabled: true if the SPICE server is enabled, false otherwise
1163 # @migrated: true if the last guest migration completed and spice
1164 #            migration had completed as well. false otherwise.
1166 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1167 #        the name resolution on the host and may be an IP address.
1169 # @port: #optional The SPICE server's port number.
1171 # @compiled-version: #optional SPICE server version.
1173 # @tls-port: #optional The SPICE server's TLS port number.
1175 # @auth: #optional the current authentication type used by the server
1176 #        'none'  if no authentication is being used
1177 #        'spice' uses SASL or direct TLS authentication, depending on command
1178 #                line options
1180 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1181 #              be determined by the client or the server, or unknown if spice
1182 #              server doesn't provide this information.
1184 #              Since: 1.1
1186 # @channels: a list of @SpiceChannel for each active spice channel
1188 # Since: 0.14.0
1190 { 'type': 'SpiceInfo',
1191   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1192            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1193            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1196 # @query-spice
1198 # Returns information about the current SPICE server
1200 # Returns: @SpiceInfo
1202 # Since: 0.14.0
1204 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1207 # @BalloonInfo:
1209 # Information about the guest balloon device.
1211 # @actual: the number of bytes the balloon currently contains
1213 # Since: 0.14.0
1216 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1219 # @query-balloon:
1221 # Return information about the balloon device.
1223 # Returns: @BalloonInfo on success
1224 #          If the balloon driver is enabled but not functional because the KVM
1225 #          kernel module cannot support it, KvmMissingCap
1226 #          If no balloon device is present, DeviceNotActive
1228 # Since: 0.14.0
1230 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1233 # @PciMemoryRange:
1235 # A PCI device memory region
1237 # @base: the starting address (guest physical)
1239 # @limit: the ending address (guest physical)
1241 # Since: 0.14.0
1243 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1246 # @PciMemoryRegion
1248 # Information about a PCI device I/O region.
1250 # @bar: the index of the Base Address Register for this region
1252 # @type: 'io' if the region is a PIO region
1253 #        'memory' if the region is a MMIO region
1255 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1257 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1259 # Since: 0.14.0
1261 { 'type': 'PciMemoryRegion',
1262   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1263            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1266 # @PciBridgeInfo:
1268 # Information about a PCI Bridge device
1270 # @bus.number: primary bus interface number.  This should be the number of the
1271 #              bus the device resides on.
1273 # @bus.secondary: secondary bus interface number.  This is the number of the
1274 #                 main bus for the bridge
1276 # @bus.subordinate: This is the highest number bus that resides below the
1277 #                   bridge.
1279 # @bus.io_range: The PIO range for all devices on this bridge
1281 # @bus.memory_range: The MMIO range for all devices on this bridge
1283 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1284 #                          this bridge
1286 # @devices: a list of @PciDeviceInfo for each device on this bridge
1288 # Since: 0.14.0
1290 { 'type': 'PciBridgeInfo',
1291   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1292                     'io_range': 'PciMemoryRange',
1293                     'memory_range': 'PciMemoryRange',
1294                     'prefetchable_range': 'PciMemoryRange' },
1295            '*devices': ['PciDeviceInfo']} }
1298 # @PciDeviceInfo:
1300 # Information about a PCI device
1302 # @bus: the bus number of the device
1304 # @slot: the slot the device is located in
1306 # @function: the function of the slot used by the device
1308 # @class_info.desc: #optional a string description of the device's class
1310 # @class_info.class: the class code of the device
1312 # @id.device: the PCI device id
1314 # @id.vendor: the PCI vendor id
1316 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1318 # @qdev_id: the device name of the PCI device
1320 # @pci_bridge: if the device is a PCI bridge, the bridge information
1322 # @regions: a list of the PCI I/O regions associated with the device
1324 # Notes: the contents of @class_info.desc are not stable and should only be
1325 #        treated as informational.
1327 # Since: 0.14.0
1329 { 'type': 'PciDeviceInfo',
1330   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1331            'class_info': {'*desc': 'str', 'class': 'int'},
1332            'id': {'device': 'int', 'vendor': 'int'},
1333            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1334            'regions': ['PciMemoryRegion']} }
1337 # @PciInfo:
1339 # Information about a PCI bus
1341 # @bus: the bus index
1343 # @devices: a list of devices on this bus
1345 # Since: 0.14.0
1347 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1350 # @query-pci:
1352 # Return information about the PCI bus topology of the guest.
1354 # Returns: a list of @PciInfo for each PCI bus
1356 # Since: 0.14.0
1358 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1361 # @BlockdevOnError:
1363 # An enumeration of possible behaviors for errors on I/O operations.
1364 # The exact meaning depends on whether the I/O was initiated by a guest
1365 # or by a block job
1367 # @report: for guest operations, report the error to the guest;
1368 #          for jobs, cancel the job
1370 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1371 #          or BLOCK_JOB_ERROR)
1373 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1375 # @stop: for guest operations, stop the virtual machine;
1376 #        for jobs, pause the job
1378 # Since: 1.3
1380 { 'enum': 'BlockdevOnError',
1381   'data': ['report', 'ignore', 'enospc', 'stop'] }
1384 # @MirrorSyncMode:
1386 # An enumeration of possible behaviors for the initial synchronization
1387 # phase of storage mirroring.
1389 # @top: copies data in the topmost image to the destination
1391 # @full: copies data from all images to the destination
1393 # @none: only copy data written from now on
1395 # Since: 1.3
1397 { 'enum': 'MirrorSyncMode',
1398   'data': ['top', 'full', 'none'] }
1401 # @BlockJobType:
1403 # Type of a block job.
1405 # @commit: block commit job type, see "block-commit"
1407 # @stream: block stream job type, see "block-stream"
1409 # @mirror: drive mirror job type, see "drive-mirror"
1411 # @backup: drive backup job type, see "drive-backup"
1413 # Since: 1.7
1415 { 'enum': 'BlockJobType',
1416   'data': ['commit', 'stream', 'mirror', 'backup'] }
1419 # @BlockJobInfo:
1421 # Information about a long-running block device operation.
1423 # @type: the job type ('stream' for image streaming)
1425 # @device: the block device name
1427 # @len: the maximum progress value
1429 # @busy: false if the job is known to be in a quiescent state, with
1430 #        no pending I/O.  Since 1.3.
1432 # @paused: whether the job is paused or, if @busy is true, will
1433 #          pause itself as soon as possible.  Since 1.3.
1435 # @offset: the current progress value
1437 # @speed: the rate limit, bytes per second
1439 # @io-status: the status of the job (since 1.3)
1441 # Since: 1.1
1443 { 'type': 'BlockJobInfo',
1444   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1445            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1446            'io-status': 'BlockDeviceIoStatus'} }
1449 # @query-block-jobs:
1451 # Return information about long-running block device operations.
1453 # Returns: a list of @BlockJobInfo for each active block job
1455 # Since: 1.1
1457 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1460 # @quit:
1462 # This command will cause the QEMU process to exit gracefully.  While every
1463 # attempt is made to send the QMP response before terminating, this is not
1464 # guaranteed.  When using this interface, a premature EOF would not be
1465 # unexpected.
1467 # Since: 0.14.0
1469 { 'command': 'quit' }
1472 # @stop:
1474 # Stop all guest VCPU execution.
1476 # Since:  0.14.0
1478 # Notes:  This function will succeed even if the guest is already in the stopped
1479 #         state.  In "inmigrate" state, it will ensure that the guest
1480 #         remains paused once migration finishes, as if the -S option was
1481 #         passed on the command line.
1483 { 'command': 'stop' }
1486 # @system_reset:
1488 # Performs a hard reset of a guest.
1490 # Since: 0.14.0
1492 { 'command': 'system_reset' }
1495 # @system_powerdown:
1497 # Requests that a guest perform a powerdown operation.
1499 # Since: 0.14.0
1501 # Notes: A guest may or may not respond to this command.  This command
1502 #        returning does not indicate that a guest has accepted the request or
1503 #        that it has shut down.  Many guests will respond to this command by
1504 #        prompting the user in some way.
1506 { 'command': 'system_powerdown' }
1509 # @cpu:
1511 # This command is a nop that is only provided for the purposes of compatibility.
1513 # Since: 0.14.0
1515 # Notes: Do not use this command.
1517 { 'command': 'cpu', 'data': {'index': 'int'} }
1520 # @cpu-add
1522 # Adds CPU with specified ID
1524 # @id: ID of CPU to be created, valid values [0..max_cpus)
1526 # Returns: Nothing on success
1528 # Since 1.5
1530 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1533 # @memsave:
1535 # Save a portion of guest memory to a file.
1537 # @val: the virtual address of the guest to start from
1539 # @size: the size of memory region to save
1541 # @filename: the file to save the memory to as binary data
1543 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1544 #                       virtual address (defaults to CPU 0)
1546 # Returns: Nothing on success
1548 # Since: 0.14.0
1550 # Notes: Errors were not reliably returned until 1.1
1552 { 'command': 'memsave',
1553   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1556 # @pmemsave:
1558 # Save a portion of guest physical memory to a file.
1560 # @val: the physical address of the guest to start from
1562 # @size: the size of memory region to save
1564 # @filename: the file to save the memory to as binary data
1566 # Returns: Nothing on success
1568 # Since: 0.14.0
1570 # Notes: Errors were not reliably returned until 1.1
1572 { 'command': 'pmemsave',
1573   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1576 # @cont:
1578 # Resume guest VCPU execution.
1580 # Since:  0.14.0
1582 # Returns:  If successful, nothing
1583 #           If QEMU was started with an encrypted block device and a key has
1584 #              not yet been set, DeviceEncrypted.
1586 # Notes:  This command will succeed if the guest is currently running.  It
1587 #         will also succeed if the guest is in the "inmigrate" state; in
1588 #         this case, the effect of the command is to make sure the guest
1589 #         starts once migration finishes, removing the effect of the -S
1590 #         command line option if it was passed.
1592 { 'command': 'cont' }
1595 # @system_wakeup:
1597 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1599 # Since:  1.1
1601 # Returns:  nothing.
1603 { 'command': 'system_wakeup' }
1606 # @inject-nmi:
1608 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1610 # Returns:  If successful, nothing
1612 # Since:  0.14.0
1614 # Notes: Only x86 Virtual Machines support this command.
1616 { 'command': 'inject-nmi' }
1619 # @set_link:
1621 # Sets the link status of a virtual network adapter.
1623 # @name: the device name of the virtual network adapter
1625 # @up: true to set the link status to be up
1627 # Returns: Nothing on success
1628 #          If @name is not a valid network device, DeviceNotFound
1630 # Since: 0.14.0
1632 # Notes: Not all network adapters support setting link status.  This command
1633 #        will succeed even if the network adapter does not support link status
1634 #        notification.
1636 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1639 # @block_passwd:
1641 # This command sets the password of a block device that has not been open
1642 # with a password and requires one.
1644 # The two cases where this can happen are a block device is created through
1645 # QEMU's initial command line or a block device is changed through the legacy
1646 # @change interface.
1648 # In the event that the block device is created through the initial command
1649 # line, the VM will start in the stopped state regardless of whether '-S' is
1650 # used.  The intention is for a management tool to query the block devices to
1651 # determine which ones are encrypted, set the passwords with this command, and
1652 # then start the guest with the @cont command.
1654 # @device:   the name of the device to set the password on
1656 # @password: the password to use for the device
1658 # Returns: nothing on success
1659 #          If @device is not a valid block device, DeviceNotFound
1660 #          If @device is not encrypted, DeviceNotEncrypted
1662 # Notes:  Not all block formats support encryption and some that do are not
1663 #         able to validate that a password is correct.  Disk corruption may
1664 #         occur if an invalid password is specified.
1666 # Since: 0.14.0
1668 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1671 # @balloon:
1673 # Request the balloon driver to change its balloon size.
1675 # @value: the target size of the balloon in bytes
1677 # Returns: Nothing on success
1678 #          If the balloon driver is enabled but not functional because the KVM
1679 #            kernel module cannot support it, KvmMissingCap
1680 #          If no balloon device is present, DeviceNotActive
1682 # Notes: This command just issues a request to the guest.  When it returns,
1683 #        the balloon size may not have changed.  A guest can change the balloon
1684 #        size independent of this command.
1686 # Since: 0.14.0
1688 { 'command': 'balloon', 'data': {'value': 'int'} }
1691 # @block_resize
1693 # Resize a block image while a guest is running.
1695 # @device:  the name of the device to get the image resized
1697 # @size:  new image size in bytes
1699 # Returns: nothing on success
1700 #          If @device is not a valid block device, DeviceNotFound
1702 # Since: 0.14.0
1704 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1707 # @NewImageMode
1709 # An enumeration that tells QEMU how to set the backing file path in
1710 # a new image file.
1712 # @existing: QEMU should look for an existing image file.
1714 # @absolute-paths: QEMU should create a new image with absolute paths
1715 # for the backing file.
1717 # Since: 1.1
1719 { 'enum': 'NewImageMode',
1720   'data': [ 'existing', 'absolute-paths' ] }
1723 # @BlockdevSnapshot
1725 # @device:  the name of the device to generate the snapshot from.
1727 # @snapshot-file: the target of the new image. A new file will be created.
1729 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1731 # @mode: #optional whether and how QEMU should create a new image, default is
1732 #        'absolute-paths'.
1734 { 'type': 'BlockdevSnapshot',
1735   'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1736             '*mode': 'NewImageMode' } }
1739 # @BlockdevSnapshotInternal
1741 # @device: the name of the device to generate the snapshot from
1743 # @name: the name of the internal snapshot to be created
1745 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1746 #        exists, the operation will fail. Only some image formats support it,
1747 #        for example, qcow2, rbd, and sheepdog.
1749 # Since: 1.7
1751 { 'type': 'BlockdevSnapshotInternal',
1752   'data': { 'device': 'str', 'name': 'str' } }
1755 # @DriveBackup
1757 # @device: the name of the device which should be copied.
1759 # @target: the target of the new image. If the file exists, or if it
1760 #          is a device, the existing file/device will be used as the new
1761 #          destination.  If it does not exist, a new file will be created.
1763 # @format: #optional the format of the new destination, default is to
1764 #          probe if @mode is 'existing', else the format of the source
1766 # @sync: what parts of the disk image should be copied to the destination
1767 #        (all the disk, only the sectors allocated in the topmost image, or
1768 #        only new I/O).
1770 # @mode: #optional whether and how QEMU should create a new image, default is
1771 #        'absolute-paths'.
1773 # @speed: #optional the maximum speed, in bytes per second
1775 # @on-source-error: #optional the action to take on an error on the source,
1776 #                   default 'report'.  'stop' and 'enospc' can only be used
1777 #                   if the block device supports io-status (see BlockInfo).
1779 # @on-target-error: #optional the action to take on an error on the target,
1780 #                   default 'report' (no limitations, since this applies to
1781 #                   a different block device than @device).
1783 # Note that @on-source-error and @on-target-error only affect background I/O.
1784 # If an error occurs during a guest write request, the device's rerror/werror
1785 # actions will be used.
1787 # Since: 1.6
1789 { 'type': 'DriveBackup',
1790   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1791             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1792             '*speed': 'int',
1793             '*on-source-error': 'BlockdevOnError',
1794             '*on-target-error': 'BlockdevOnError' } }
1797 # @Abort
1799 # This action can be used to test transaction failure.
1801 # Since: 1.6
1803 { 'type': 'Abort',
1804   'data': { } }
1807 # @TransactionAction
1809 # A discriminated record of operations that can be performed with
1810 # @transaction.
1812 { 'union': 'TransactionAction',
1813   'data': {
1814        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1815        'drive-backup': 'DriveBackup',
1816        'abort': 'Abort',
1817        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1818    } }
1821 # @transaction
1823 # Executes a number of transactionable QMP commands atomically. If any
1824 # operation fails, then the entire set of actions will be abandoned and the
1825 # appropriate error returned.
1827 #  List of:
1828 #  @TransactionAction: information needed for the respective operation
1830 # Returns: nothing on success
1831 #          Errors depend on the operations of the transaction
1833 # Note: The transaction aborts on the first failure.  Therefore, there will be
1834 # information on only one failed operation returned in an error condition, and
1835 # subsequent actions will not have been attempted.
1837 # Since 1.1
1839 { 'command': 'transaction',
1840   'data': { 'actions': [ 'TransactionAction' ] } }
1843 # @blockdev-snapshot-sync
1845 # Generates a synchronous snapshot of a block device.
1847 # For the arguments, see the documentation of BlockdevSnapshot.
1849 # Returns: nothing on success
1850 #          If @device is not a valid block device, DeviceNotFound
1852 # Since 0.14.0
1854 { 'command': 'blockdev-snapshot-sync',
1855   'data': 'BlockdevSnapshot' }
1858 # @blockdev-snapshot-internal-sync
1860 # Synchronously take an internal snapshot of a block device, when the format
1861 # of the image used supports it.
1863 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1865 # Returns: nothing on success
1866 #          If @device is not a valid block device, DeviceNotFound
1867 #          If any snapshot matching @name exists, or @name is empty,
1868 #          GenericError
1869 #          If the format of the image used does not support it,
1870 #          BlockFormatFeatureNotSupported
1872 # Since 1.7
1874 { 'command': 'blockdev-snapshot-internal-sync',
1875   'data': 'BlockdevSnapshotInternal' }
1878 # @blockdev-snapshot-delete-internal-sync
1880 # Synchronously delete an internal snapshot of a block device, when the format
1881 # of the image used support it. The snapshot is identified by name or id or
1882 # both. One of the name or id is required. Return SnapshotInfo for the
1883 # successfully deleted snapshot.
1885 # @device: the name of the device to delete the snapshot from
1887 # @id: optional the snapshot's ID to be deleted
1889 # @name: optional the snapshot's name to be deleted
1891 # Returns: SnapshotInfo on success
1892 #          If @device is not a valid block device, DeviceNotFound
1893 #          If snapshot not found, GenericError
1894 #          If the format of the image used does not support it,
1895 #          BlockFormatFeatureNotSupported
1896 #          If @id and @name are both not specified, GenericError
1898 # Since 1.7
1900 { 'command': 'blockdev-snapshot-delete-internal-sync',
1901   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
1902   'returns': 'SnapshotInfo' }
1905 # @human-monitor-command:
1907 # Execute a command on the human monitor and return the output.
1909 # @command-line: the command to execute in the human monitor
1911 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1913 # Returns: the output of the command as a string
1915 # Since: 0.14.0
1917 # Notes: This command only exists as a stop-gap.  Its use is highly
1918 #        discouraged.  The semantics of this command are not guaranteed.
1920 #        Known limitations:
1922 #        o This command is stateless, this means that commands that depend
1923 #          on state information (such as getfd) might not work
1925 #       o Commands that prompt the user for data (eg. 'cont' when the block
1926 #         device is encrypted) don't currently work
1928 { 'command': 'human-monitor-command',
1929   'data': {'command-line': 'str', '*cpu-index': 'int'},
1930   'returns': 'str' }
1933 # @block-commit
1935 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1936 # writes data between 'top' and 'base' into 'base'.
1938 # @device:  the name of the device
1940 # @base:   #optional The file name of the backing image to write data into.
1941 #                    If not specified, this is the deepest backing image
1943 # @top:              The file name of the backing image within the image chain,
1944 #                    which contains the topmost data to be committed down.
1945 #                    Note, the active layer as 'top' is currently unsupported.
1947 #                    If top == base, that is an error.
1950 # @speed:  #optional the maximum speed, in bytes per second
1952 # Returns: Nothing on success
1953 #          If commit or stream is already active on this device, DeviceInUse
1954 #          If @device does not exist, DeviceNotFound
1955 #          If image commit is not supported by this device, NotSupported
1956 #          If @base or @top is invalid, a generic error is returned
1957 #          If @top is the active layer, or omitted, a generic error is returned
1958 #          If @speed is invalid, InvalidParameter
1960 # Since: 1.3
1963 { 'command': 'block-commit',
1964   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1965             '*speed': 'int' } }
1968 # @drive-backup
1970 # Start a point-in-time copy of a block device to a new destination.  The
1971 # status of ongoing drive-backup operations can be checked with
1972 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1973 # The operation can be stopped before it has completed using the
1974 # block-job-cancel command.
1976 # For the arguments, see the documentation of DriveBackup.
1978 # Returns: nothing on success
1979 #          If @device is not a valid block device, DeviceNotFound
1981 # Since 1.6
1983 { 'command': 'drive-backup', 'data': 'DriveBackup' }
1986 # @drive-mirror
1988 # Start mirroring a block device's writes to a new destination.
1990 # @device:  the name of the device whose writes should be mirrored.
1992 # @target: the target of the new image. If the file exists, or if it
1993 #          is a device, the existing file/device will be used as the new
1994 #          destination.  If it does not exist, a new file will be created.
1996 # @format: #optional the format of the new destination, default is to
1997 #          probe if @mode is 'existing', else the format of the source
1999 # @mode: #optional whether and how QEMU should create a new image, default is
2000 #        'absolute-paths'.
2002 # @speed:  #optional the maximum speed, in bytes per second
2004 # @sync: what parts of the disk image should be copied to the destination
2005 #        (all the disk, only the sectors allocated in the topmost image, or
2006 #        only new I/O).
2008 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2009 #               if the image format doesn't have clusters, 4K if the clusters
2010 #               are smaller than that, else the cluster size.  Must be a
2011 #               power of 2 between 512 and 64M (since 1.4).
2013 # @buf-size: #optional maximum amount of data in flight from source to
2014 #            target (since 1.4).
2016 # @on-source-error: #optional the action to take on an error on the source,
2017 #                   default 'report'.  'stop' and 'enospc' can only be used
2018 #                   if the block device supports io-status (see BlockInfo).
2020 # @on-target-error: #optional the action to take on an error on the target,
2021 #                   default 'report' (no limitations, since this applies to
2022 #                   a different block device than @device).
2024 # Returns: nothing on success
2025 #          If @device is not a valid block device, DeviceNotFound
2027 # Since 1.3
2029 { 'command': 'drive-mirror',
2030   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2031             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2032             '*speed': 'int', '*granularity': 'uint32',
2033             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2034             '*on-target-error': 'BlockdevOnError' } }
2037 # @migrate_cancel
2039 # Cancel the current executing migration process.
2041 # Returns: nothing on success
2043 # Notes: This command succeeds even if there is no migration process running.
2045 # Since: 0.14.0
2047 { 'command': 'migrate_cancel' }
2050 # @migrate_set_downtime
2052 # Set maximum tolerated downtime for migration.
2054 # @value: maximum downtime in seconds
2056 # Returns: nothing on success
2058 # Since: 0.14.0
2060 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2063 # @migrate_set_speed
2065 # Set maximum speed for migration.
2067 # @value: maximum speed in bytes.
2069 # Returns: nothing on success
2071 # Notes: A value lesser than zero will be automatically round up to zero.
2073 # Since: 0.14.0
2075 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2078 # @migrate-set-cache-size
2080 # Set XBZRLE cache size
2082 # @value: cache size in bytes
2084 # The size will be rounded down to the nearest power of 2.
2085 # The cache size can be modified before and during ongoing migration
2087 # Returns: nothing on success
2089 # Since: 1.2
2091 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2094 # @query-migrate-cache-size
2096 # query XBZRLE cache size
2098 # Returns: XBZRLE cache size in bytes
2100 # Since: 1.2
2102 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2105 # @ObjectPropertyInfo:
2107 # @name: the name of the property
2109 # @type: the type of the property.  This will typically come in one of four
2110 #        forms:
2112 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2113 #           These types are mapped to the appropriate JSON type.
2115 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
2116 #           legacy qdev typename.  These types are always treated as strings.
2118 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
2119 #           device type name.  Child properties create the composition tree.
2121 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
2122 #           device type name.  Link properties form the device model graph.
2124 # Since: 1.2
2126 { 'type': 'ObjectPropertyInfo',
2127   'data': { 'name': 'str', 'type': 'str' } }
2130 # @qom-list:
2132 # This command will list any properties of a object given a path in the object
2133 # model.
2135 # @path: the path within the object model.  See @qom-get for a description of
2136 #        this parameter.
2138 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2139 #          object.
2141 # Since: 1.2
2143 { 'command': 'qom-list',
2144   'data': { 'path': 'str' },
2145   'returns': [ 'ObjectPropertyInfo' ] }
2148 # @qom-get:
2150 # This command will get a property from a object model path and return the
2151 # value.
2153 # @path: The path within the object model.  There are two forms of supported
2154 #        paths--absolute and partial paths.
2156 #        Absolute paths are derived from the root object and can follow child<>
2157 #        or link<> properties.  Since they can follow link<> properties, they
2158 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2159 #        and are prefixed  with a leading slash.
2161 #        Partial paths look like relative filenames.  They do not begin
2162 #        with a prefix.  The matching rules for partial paths are subtle but
2163 #        designed to make specifying objects easy.  At each level of the
2164 #        composition tree, the partial path is matched as an absolute path.
2165 #        The first match is not returned.  At least two matches are searched
2166 #        for.  A successful result is only returned if only one match is
2167 #        found.  If more than one match is found, a flag is return to
2168 #        indicate that the match was ambiguous.
2170 # @property: The property name to read
2172 # Returns: The property value.  The type depends on the property type.  legacy<>
2173 #          properties are returned as #str.  child<> and link<> properties are
2174 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2175 #          are returned as #int.
2177 # Since: 1.2
2179 { 'command': 'qom-get',
2180   'data': { 'path': 'str', 'property': 'str' },
2181   'returns': 'visitor',
2182   'gen': 'no' }
2185 # @qom-set:
2187 # This command will set a property from a object model path.
2189 # @path: see @qom-get for a description of this parameter
2191 # @property: the property name to set
2193 # @value: a value who's type is appropriate for the property type.  See @qom-get
2194 #         for a description of type mapping.
2196 # Since: 1.2
2198 { 'command': 'qom-set',
2199   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2200   'gen': 'no' }
2203 # @set_password:
2205 # Sets the password of a remote display session.
2207 # @protocol: `vnc' to modify the VNC server password
2208 #            `spice' to modify the Spice server password
2210 # @password: the new password
2212 # @connected: #optional how to handle existing clients when changing the
2213 #                       password.  If nothing is specified, defaults to `keep'
2214 #                       `fail' to fail the command if clients are connected
2215 #                       `disconnect' to disconnect existing clients
2216 #                       `keep' to maintain existing clients
2218 # Returns: Nothing on success
2219 #          If Spice is not enabled, DeviceNotFound
2221 # Since: 0.14.0
2223 { 'command': 'set_password',
2224   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2227 # @expire_password:
2229 # Expire the password of a remote display server.
2231 # @protocol: the name of the remote display protocol `vnc' or `spice'
2233 # @time: when to expire the password.
2234 #        `now' to expire the password immediately
2235 #        `never' to cancel password expiration
2236 #        `+INT' where INT is the number of seconds from now (integer)
2237 #        `INT' where INT is the absolute time in seconds
2239 # Returns: Nothing on success
2240 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2242 # Since: 0.14.0
2244 # Notes: Time is relative to the server and currently there is no way to
2245 #        coordinate server time with client time.  It is not recommended to
2246 #        use the absolute time version of the @time parameter unless you're
2247 #        sure you are on the same machine as the QEMU instance.
2249 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2252 # @eject:
2254 # Ejects a device from a removable drive.
2256 # @device:  The name of the device
2258 # @force:   @optional If true, eject regardless of whether the drive is locked.
2259 #           If not specified, the default value is false.
2261 # Returns:  Nothing on success
2262 #           If @device is not a valid block device, DeviceNotFound
2264 # Notes:    Ejecting a device will no media results in success
2266 # Since: 0.14.0
2268 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2271 # @change-vnc-password:
2273 # Change the VNC server password.
2275 # @target:  the new password to use with VNC authentication
2277 # Since: 1.1
2279 # Notes:  An empty password in this command will set the password to the empty
2280 #         string.  Existing clients are unaffected by executing this command.
2282 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2285 # @change:
2287 # This command is multiple commands multiplexed together.
2289 # @device: This is normally the name of a block device but it may also be 'vnc'.
2290 #          when it's 'vnc', then sub command depends on @target
2292 # @target: If @device is a block device, then this is the new filename.
2293 #          If @device is 'vnc', then if the value 'password' selects the vnc
2294 #          change password command.   Otherwise, this specifies a new server URI
2295 #          address to listen to for VNC connections.
2297 # @arg:    If @device is a block device, then this is an optional format to open
2298 #          the device with.
2299 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2300 #          password to set.  If this argument is an empty string, then no future
2301 #          logins will be allowed.
2303 # Returns: Nothing on success.
2304 #          If @device is not a valid block device, DeviceNotFound
2305 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2306 #          if this error is returned, the device has been opened successfully
2307 #          and an additional call to @block_passwd is required to set the
2308 #          device's password.  The behavior of reads and writes to the block
2309 #          device between when these calls are executed is undefined.
2311 # Notes:  It is strongly recommended that this interface is not used especially
2312 #         for changing block devices.
2314 # Since: 0.14.0
2316 { 'command': 'change',
2317   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2320 # @block_set_io_throttle:
2322 # Change I/O throttle limits for a block drive.
2324 # @device: The name of the device
2326 # @bps: total throughput limit in bytes per second
2328 # @bps_rd: read throughput limit in bytes per second
2330 # @bps_wr: write throughput limit in bytes per second
2332 # @iops: total I/O operations per second
2334 # @ops_rd: read I/O operations per second
2336 # @iops_wr: write I/O operations per second
2338 # @bps_max: #optional total max in bytes (Since 1.7)
2340 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2342 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2344 # @iops_max: #optional total I/O operations max (Since 1.7)
2346 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2348 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2350 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2352 # Returns: Nothing on success
2353 #          If @device is not a valid block device, DeviceNotFound
2355 # Since: 1.1
2357 { 'command': 'block_set_io_throttle',
2358   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2359             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2360             '*bps_max': 'int', '*bps_rd_max': 'int',
2361             '*bps_wr_max': 'int', '*iops_max': 'int',
2362             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2363             '*iops_size': 'int' } }
2366 # @block-stream:
2368 # Copy data from a backing file into a block device.
2370 # The block streaming operation is performed in the background until the entire
2371 # backing file has been copied.  This command returns immediately once streaming
2372 # has started.  The status of ongoing block streaming operations can be checked
2373 # with query-block-jobs.  The operation can be stopped before it has completed
2374 # using the block-job-cancel command.
2376 # If a base file is specified then sectors are not copied from that base file and
2377 # its backing chain.  When streaming completes the image file will have the base
2378 # file as its backing file.  This can be used to stream a subset of the backing
2379 # file chain instead of flattening the entire image.
2381 # On successful completion the image file is updated to drop the backing file
2382 # and the BLOCK_JOB_COMPLETED event is emitted.
2384 # @device: the device name
2386 # @base:   #optional the common backing file name
2388 # @speed:  #optional the maximum speed, in bytes per second
2390 # @on-error: #optional the action to take on an error (default report).
2391 #            'stop' and 'enospc' can only be used if the block device
2392 #            supports io-status (see BlockInfo).  Since 1.3.
2394 # Returns: Nothing on success
2395 #          If @device does not exist, DeviceNotFound
2397 # Since: 1.1
2399 { 'command': 'block-stream',
2400   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2401             '*on-error': 'BlockdevOnError' } }
2404 # @block-job-set-speed:
2406 # Set maximum speed for a background block operation.
2408 # This command can only be issued when there is an active block job.
2410 # Throttling can be disabled by setting the speed to 0.
2412 # @device: the device name
2414 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2415 #          Defaults to 0.
2417 # Returns: Nothing on success
2418 #          If no background operation is active on this device, DeviceNotActive
2420 # Since: 1.1
2422 { 'command': 'block-job-set-speed',
2423   'data': { 'device': 'str', 'speed': 'int' } }
2426 # @block-job-cancel:
2428 # Stop an active background block operation.
2430 # This command returns immediately after marking the active background block
2431 # operation for cancellation.  It is an error to call this command if no
2432 # operation is in progress.
2434 # The operation will cancel as soon as possible and then emit the
2435 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2436 # enumerated using query-block-jobs.
2438 # For streaming, the image file retains its backing file unless the streaming
2439 # operation happens to complete just as it is being cancelled.  A new streaming
2440 # operation can be started at a later time to finish copying all data from the
2441 # backing file.
2443 # @device: the device name
2445 # @force: #optional whether to allow cancellation of a paused job (default
2446 #         false).  Since 1.3.
2448 # Returns: Nothing on success
2449 #          If no background operation is active on this device, DeviceNotActive
2451 # Since: 1.1
2453 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2456 # @block-job-pause:
2458 # Pause an active background block operation.
2460 # This command returns immediately after marking the active background block
2461 # operation for pausing.  It is an error to call this command if no
2462 # operation is in progress.  Pausing an already paused job has no cumulative
2463 # effect; a single block-job-resume command will resume the job.
2465 # The operation will pause as soon as possible.  No event is emitted when
2466 # the operation is actually paused.  Cancelling a paused job automatically
2467 # resumes it.
2469 # @device: the device name
2471 # Returns: Nothing on success
2472 #          If no background operation is active on this device, DeviceNotActive
2474 # Since: 1.3
2476 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2479 # @block-job-resume:
2481 # Resume an active background block operation.
2483 # This command returns immediately after resuming a paused background block
2484 # operation.  It is an error to call this command if no operation is in
2485 # progress.  Resuming an already running job is not an error.
2487 # This command also clears the error status of the job.
2489 # @device: the device name
2491 # Returns: Nothing on success
2492 #          If no background operation is active on this device, DeviceNotActive
2494 # Since: 1.3
2496 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2499 # @block-job-complete:
2501 # Manually trigger completion of an active background block operation.  This
2502 # is supported for drive mirroring, where it also switches the device to
2503 # write to the target path only.  The ability to complete is signaled with
2504 # a BLOCK_JOB_READY event.
2506 # This command completes an active background block operation synchronously.
2507 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2508 # is not defined.  Note that if an I/O error occurs during the processing of
2509 # this command: 1) the command itself will fail; 2) the error will be processed
2510 # according to the rerror/werror arguments that were specified when starting
2511 # the operation.
2513 # A cancelled or paused job cannot be completed.
2515 # @device: the device name
2517 # Returns: Nothing on success
2518 #          If no background operation is active on this device, DeviceNotActive
2520 # Since: 1.3
2522 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2525 # @ObjectTypeInfo:
2527 # This structure describes a search result from @qom-list-types
2529 # @name: the type name found in the search
2531 # Since: 1.1
2533 # Notes: This command is experimental and may change syntax in future releases.
2535 { 'type': 'ObjectTypeInfo',
2536   'data': { 'name': 'str' } }
2539 # @qom-list-types:
2541 # This command will return a list of types given search parameters
2543 # @implements: if specified, only return types that implement this type name
2545 # @abstract: if true, include abstract types in the results
2547 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2549 # Since: 1.1
2551 { 'command': 'qom-list-types',
2552   'data': { '*implements': 'str', '*abstract': 'bool' },
2553   'returns': [ 'ObjectTypeInfo' ] }
2556 # @DevicePropertyInfo:
2558 # Information about device properties.
2560 # @name: the name of the property
2561 # @type: the typename of the property
2563 # Since: 1.2
2565 { 'type': 'DevicePropertyInfo',
2566   'data': { 'name': 'str', 'type': 'str' } }
2569 # @device-list-properties:
2571 # List properties associated with a device.
2573 # @typename: the type name of a device
2575 # Returns: a list of DevicePropertyInfo describing a devices properties
2577 # Since: 1.2
2579 { 'command': 'device-list-properties',
2580   'data': { 'typename': 'str'},
2581   'returns': [ 'DevicePropertyInfo' ] }
2584 # @migrate
2586 # Migrates the current running guest to another Virtual Machine.
2588 # @uri: the Uniform Resource Identifier of the destination VM
2590 # @blk: #optional do block migration (full disk copy)
2592 # @inc: #optional incremental disk copy migration
2594 # @detach: this argument exists only for compatibility reasons and
2595 #          is ignored by QEMU
2597 # Returns: nothing on success
2599 # Since: 0.14.0
2601 { 'command': 'migrate',
2602   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2604 # @xen-save-devices-state:
2606 # Save the state of all devices to file. The RAM and the block devices
2607 # of the VM are not saved by this command.
2609 # @filename: the file to save the state of the devices to as binary
2610 # data. See xen-save-devices-state.txt for a description of the binary
2611 # format.
2613 # Returns: Nothing on success
2615 # Since: 1.1
2617 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2620 # @xen-set-global-dirty-log
2622 # Enable or disable the global dirty log mode.
2624 # @enable: true to enable, false to disable.
2626 # Returns: nothing
2628 # Since: 1.3
2630 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2633 # @device_del:
2635 # Remove a device from a guest
2637 # @id: the name of the device
2639 # Returns: Nothing on success
2640 #          If @id is not a valid device, DeviceNotFound
2642 # Notes: When this command completes, the device may not be removed from the
2643 #        guest.  Hot removal is an operation that requires guest cooperation.
2644 #        This command merely requests that the guest begin the hot removal
2645 #        process.  Completion of the device removal process is signaled with a
2646 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2647 #        for all devices.
2649 # Since: 0.14.0
2651 { 'command': 'device_del', 'data': {'id': 'str'} }
2654 # @dump-guest-memory
2656 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2657 # very long depending on the amount of guest memory. This command is only
2658 # supported on i386 and x86_64.
2660 # @paging: if true, do paging to get guest's memory mapping. This allows
2661 #          using gdb to process the core file.
2663 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2664 #                     of RAM. This can happen for a large guest, or a
2665 #                     malicious guest pretending to be large.
2667 #          Also, paging=true has the following limitations:
2669 #             1. The guest may be in a catastrophic state or can have corrupted
2670 #                memory, which cannot be trusted
2671 #             2. The guest can be in real-mode even if paging is enabled. For
2672 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2673 #                goes in real-mode
2675 # @protocol: the filename or file descriptor of the vmcore. The supported
2676 #            protocols are:
2678 #            1. file: the protocol starts with "file:", and the following
2679 #               string is the file's path.
2680 #            2. fd: the protocol starts with "fd:", and the following string
2681 #               is the fd's name.
2683 # @begin: #optional if specified, the starting physical address.
2685 # @length: #optional if specified, the memory size, in bytes. If you don't
2686 #          want to dump all guest's memory, please specify the start @begin
2687 #          and @length
2689 # Returns: nothing on success
2691 # Since: 1.2
2693 { 'command': 'dump-guest-memory',
2694   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2695             '*length': 'int' } }
2698 # @netdev_add:
2700 # Add a network backend.
2702 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2703 #        'vde', 'socket', 'dump' and 'bridge'
2705 # @id: the name of the new network backend
2707 # @props: #optional a list of properties to be passed to the backend in
2708 #         the format 'name=value', like 'ifname=tap0,script=no'
2710 # Notes: The semantics of @props is not well defined.  Future commands will be
2711 #        introduced that provide stronger typing for backend creation.
2713 # Since: 0.14.0
2715 # Returns: Nothing on success
2716 #          If @type is not a valid network backend, DeviceNotFound
2718 { 'command': 'netdev_add',
2719   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2720   'gen': 'no' }
2723 # @netdev_del:
2725 # Remove a network backend.
2727 # @id: the name of the network backend to remove
2729 # Returns: Nothing on success
2730 #          If @id is not a valid network backend, DeviceNotFound
2732 # Since: 0.14.0
2734 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2737 # @NetdevNoneOptions
2739 # Use it alone to have zero network devices.
2741 # Since 1.2
2743 { 'type': 'NetdevNoneOptions',
2744   'data': { } }
2747 # @NetLegacyNicOptions
2749 # Create a new Network Interface Card.
2751 # @netdev: #optional id of -netdev to connect to
2753 # @macaddr: #optional MAC address
2755 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2757 # @addr: #optional PCI device address
2759 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2761 # Since 1.2
2763 { 'type': 'NetLegacyNicOptions',
2764   'data': {
2765     '*netdev':  'str',
2766     '*macaddr': 'str',
2767     '*model':   'str',
2768     '*addr':    'str',
2769     '*vectors': 'uint32' } }
2772 # @String
2774 # A fat type wrapping 'str', to be embedded in lists.
2776 # Since 1.2
2778 { 'type': 'String',
2779   'data': {
2780     'str': 'str' } }
2783 # @NetdevUserOptions
2785 # Use the user mode network stack which requires no administrator privilege to
2786 # run.
2788 # @hostname: #optional client hostname reported by the builtin DHCP server
2790 # @restrict: #optional isolate the guest from the host
2792 # @ip: #optional legacy parameter, use net= instead
2794 # @net: #optional IP address and optional netmask
2796 # @host: #optional guest-visible address of the host
2798 # @tftp: #optional root directory of the built-in TFTP server
2800 # @bootfile: #optional BOOTP filename, for use with tftp=
2802 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2803 #             assign
2805 # @dns: #optional guest-visible address of the virtual nameserver
2807 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2808 #             to the guest
2810 # @smb: #optional root directory of the built-in SMB server
2812 # @smbserver: #optional IP address of the built-in SMB server
2814 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2815 #           endpoints
2817 # @guestfwd: #optional forward guest TCP connections
2819 # Since 1.2
2821 { 'type': 'NetdevUserOptions',
2822   'data': {
2823     '*hostname':  'str',
2824     '*restrict':  'bool',
2825     '*ip':        'str',
2826     '*net':       'str',
2827     '*host':      'str',
2828     '*tftp':      'str',
2829     '*bootfile':  'str',
2830     '*dhcpstart': 'str',
2831     '*dns':       'str',
2832     '*dnssearch': ['String'],
2833     '*smb':       'str',
2834     '*smbserver': 'str',
2835     '*hostfwd':   ['String'],
2836     '*guestfwd':  ['String'] } }
2839 # @NetdevTapOptions
2841 # Connect the host TAP network interface name to the VLAN.
2843 # @ifname: #optional interface name
2845 # @fd: #optional file descriptor of an already opened tap
2847 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2848 # tap
2850 # @script: #optional script to initialize the interface
2852 # @downscript: #optional script to shut down the interface
2854 # @helper: #optional command to execute to configure bridge
2856 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2858 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2860 # @vhost: #optional enable vhost-net network accelerator
2862 # @vhostfd: #optional file descriptor of an already opened vhost net device
2864 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2865 # devices
2867 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2869 # @queues: #optional number of queues to be created for multiqueue capable tap
2871 # Since 1.2
2873 { 'type': 'NetdevTapOptions',
2874   'data': {
2875     '*ifname':     'str',
2876     '*fd':         'str',
2877     '*fds':        'str',
2878     '*script':     'str',
2879     '*downscript': 'str',
2880     '*helper':     'str',
2881     '*sndbuf':     'size',
2882     '*vnet_hdr':   'bool',
2883     '*vhost':      'bool',
2884     '*vhostfd':    'str',
2885     '*vhostfds':   'str',
2886     '*vhostforce': 'bool',
2887     '*queues':     'uint32'} }
2890 # @NetdevSocketOptions
2892 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2893 # socket connection.
2895 # @fd: #optional file descriptor of an already opened socket
2897 # @listen: #optional port number, and optional hostname, to listen on
2899 # @connect: #optional port number, and optional hostname, to connect to
2901 # @mcast: #optional UDP multicast address and port number
2903 # @localaddr: #optional source address and port for multicast and udp packets
2905 # @udp: #optional UDP unicast address and port number
2907 # Since 1.2
2909 { 'type': 'NetdevSocketOptions',
2910   'data': {
2911     '*fd':        'str',
2912     '*listen':    'str',
2913     '*connect':   'str',
2914     '*mcast':     'str',
2915     '*localaddr': 'str',
2916     '*udp':       'str' } }
2919 # @NetdevVdeOptions
2921 # Connect the VLAN to a vde switch running on the host.
2923 # @sock: #optional socket path
2925 # @port: #optional port number
2927 # @group: #optional group owner of socket
2929 # @mode: #optional permissions for socket
2931 # Since 1.2
2933 { 'type': 'NetdevVdeOptions',
2934   'data': {
2935     '*sock':  'str',
2936     '*port':  'uint16',
2937     '*group': 'str',
2938     '*mode':  'uint16' } }
2941 # @NetdevDumpOptions
2943 # Dump VLAN network traffic to a file.
2945 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2946 # suffixes.
2948 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2950 # Since 1.2
2952 { 'type': 'NetdevDumpOptions',
2953   'data': {
2954     '*len':  'size',
2955     '*file': 'str' } }
2958 # @NetdevBridgeOptions
2960 # Connect a host TAP network interface to a host bridge device.
2962 # @br: #optional bridge name
2964 # @helper: #optional command to execute to configure bridge
2966 # Since 1.2
2968 { 'type': 'NetdevBridgeOptions',
2969   'data': {
2970     '*br':     'str',
2971     '*helper': 'str' } }
2974 # @NetdevHubPortOptions
2976 # Connect two or more net clients through a software hub.
2978 # @hubid: hub identifier number
2980 # Since 1.2
2982 { 'type': 'NetdevHubPortOptions',
2983   'data': {
2984     'hubid':     'int32' } }
2987 # @NetClientOptions
2989 # A discriminated record of network device traits.
2991 # Since 1.2
2993 { 'union': 'NetClientOptions',
2994   'data': {
2995     'none':     'NetdevNoneOptions',
2996     'nic':      'NetLegacyNicOptions',
2997     'user':     'NetdevUserOptions',
2998     'tap':      'NetdevTapOptions',
2999     'socket':   'NetdevSocketOptions',
3000     'vde':      'NetdevVdeOptions',
3001     'dump':     'NetdevDumpOptions',
3002     'bridge':   'NetdevBridgeOptions',
3003     'hubport':  'NetdevHubPortOptions' } }
3006 # @NetLegacy
3008 # Captures the configuration of a network device; legacy.
3010 # @vlan: #optional vlan number
3012 # @id: #optional identifier for monitor commands
3014 # @name: #optional identifier for monitor commands, ignored if @id is present
3016 # @opts: device type specific properties (legacy)
3018 # Since 1.2
3020 { 'type': 'NetLegacy',
3021   'data': {
3022     '*vlan': 'int32',
3023     '*id':   'str',
3024     '*name': 'str',
3025     'opts':  'NetClientOptions' } }
3028 # @Netdev
3030 # Captures the configuration of a network device.
3032 # @id: identifier for monitor commands.
3034 # @opts: device type specific properties
3036 # Since 1.2
3038 { 'type': 'Netdev',
3039   'data': {
3040     'id':   'str',
3041     'opts': 'NetClientOptions' } }
3044 # @InetSocketAddress
3046 # Captures a socket address or address range in the Internet namespace.
3048 # @host: host part of the address
3050 # @port: port part of the address, or lowest port if @to is present
3052 # @to: highest port to try
3054 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3055 #        #optional
3057 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3058 #        #optional
3060 # Since 1.3
3062 { 'type': 'InetSocketAddress',
3063   'data': {
3064     'host': 'str',
3065     'port': 'str',
3066     '*to': 'uint16',
3067     '*ipv4': 'bool',
3068     '*ipv6': 'bool' } }
3071 # @UnixSocketAddress
3073 # Captures a socket address in the local ("Unix socket") namespace.
3075 # @path: filesystem path to use
3077 # Since 1.3
3079 { 'type': 'UnixSocketAddress',
3080   'data': {
3081     'path': 'str' } }
3084 # @SocketAddress
3086 # Captures the address of a socket, which could also be a named file descriptor
3088 # Since 1.3
3090 { 'union': 'SocketAddress',
3091   'data': {
3092     'inet': 'InetSocketAddress',
3093     'unix': 'UnixSocketAddress',
3094     'fd': 'String' } }
3097 # @getfd:
3099 # Receive a file descriptor via SCM rights and assign it a name
3101 # @fdname: file descriptor name
3103 # Returns: Nothing on success
3105 # Since: 0.14.0
3107 # Notes: If @fdname already exists, the file descriptor assigned to
3108 #        it will be closed and replaced by the received file
3109 #        descriptor.
3110 #        The 'closefd' command can be used to explicitly close the
3111 #        file descriptor when it is no longer needed.
3113 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3116 # @closefd:
3118 # Close a file descriptor previously passed via SCM rights
3120 # @fdname: file descriptor name
3122 # Returns: Nothing on success
3124 # Since: 0.14.0
3126 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3129 # @MachineInfo:
3131 # Information describing a machine.
3133 # @name: the name of the machine
3135 # @alias: #optional an alias for the machine name
3137 # @default: #optional whether the machine is default
3139 # @cpu-max: maximum number of CPUs supported by the machine type
3140 #           (since 1.5.0)
3142 # Since: 1.2.0
3144 { 'type': 'MachineInfo',
3145   'data': { 'name': 'str', '*alias': 'str',
3146             '*is-default': 'bool', 'cpu-max': 'int' } }
3149 # @query-machines:
3151 # Return a list of supported machines
3153 # Returns: a list of MachineInfo
3155 # Since: 1.2.0
3157 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3160 # @CpuDefinitionInfo:
3162 # Virtual CPU definition.
3164 # @name: the name of the CPU definition
3166 # Since: 1.2.0
3168 { 'type': 'CpuDefinitionInfo',
3169   'data': { 'name': 'str' } }
3172 # @query-cpu-definitions:
3174 # Return a list of supported virtual CPU definitions
3176 # Returns: a list of CpuDefInfo
3178 # Since: 1.2.0
3180 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3182 # @AddfdInfo:
3184 # Information about a file descriptor that was added to an fd set.
3186 # @fdset-id: The ID of the fd set that @fd was added to.
3188 # @fd: The file descriptor that was received via SCM rights and
3189 #      added to the fd set.
3191 # Since: 1.2.0
3193 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3196 # @add-fd:
3198 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3200 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3202 # @opaque: #optional A free-form string that can be used to describe the fd.
3204 # Returns: @AddfdInfo on success
3205 #          If file descriptor was not received, FdNotSupplied
3206 #          If @fdset-id is a negative value, InvalidParameterValue
3208 # Notes: The list of fd sets is shared by all monitor connections.
3210 #        If @fdset-id is not specified, a new fd set will be created.
3212 # Since: 1.2.0
3214 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3215   'returns': 'AddfdInfo' }
3218 # @remove-fd:
3220 # Remove a file descriptor from an fd set.
3222 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3224 # @fd: #optional The file descriptor that is to be removed.
3226 # Returns: Nothing on success
3227 #          If @fdset-id or @fd is not found, FdNotFound
3229 # Since: 1.2.0
3231 # Notes: The list of fd sets is shared by all monitor connections.
3233 #        If @fd is not specified, all file descriptors in @fdset-id
3234 #        will be removed.
3236 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3239 # @FdsetFdInfo:
3241 # Information about a file descriptor that belongs to an fd set.
3243 # @fd: The file descriptor value.
3245 # @opaque: #optional A free-form string that can be used to describe the fd.
3247 # Since: 1.2.0
3249 { 'type': 'FdsetFdInfo',
3250   'data': {'fd': 'int', '*opaque': 'str'} }
3253 # @FdsetInfo:
3255 # Information about an fd set.
3257 # @fdset-id: The ID of the fd set.
3259 # @fds: A list of file descriptors that belong to this fd set.
3261 # Since: 1.2.0
3263 { 'type': 'FdsetInfo',
3264   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3267 # @query-fdsets:
3269 # Return information describing all fd sets.
3271 # Returns: A list of @FdsetInfo
3273 # Since: 1.2.0
3275 # Note: The list of fd sets is shared by all monitor connections.
3278 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3281 # @TargetInfo:
3283 # Information describing the QEMU target.
3285 # @arch: the target architecture (eg "x86_64", "i386", etc)
3287 # Since: 1.2.0
3289 { 'type': 'TargetInfo',
3290   'data': { 'arch': 'str' } }
3293 # @query-target:
3295 # Return information about the target for this QEMU
3297 # Returns: TargetInfo
3299 # Since: 1.2.0
3301 { 'command': 'query-target', 'returns': 'TargetInfo' }
3304 # @QKeyCode:
3306 # An enumeration of key name.
3308 # This is used by the send-key command.
3310 # Since: 1.3.0
3312 { 'enum': 'QKeyCode',
3313   'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3314             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3315             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3316             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3317             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3318             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3319             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3320             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3321             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3322             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3323             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3324             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3325             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3326             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3327              'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3330 # @KeyValue
3332 # Represents a keyboard key.
3334 # Since: 1.3.0
3336 { 'union': 'KeyValue',
3337   'data': {
3338     'number': 'int',
3339     'qcode': 'QKeyCode' } }
3342 # @send-key:
3344 # Send keys to guest.
3346 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3347 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3348 #        directly to the guest, while @KeyValue.qcode must be a valid
3349 #        @QKeyCode value
3351 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3352 #             to 100
3354 # Returns: Nothing on success
3355 #          If key is unknown or redundant, InvalidParameter
3357 # Since: 1.3.0
3360 { 'command': 'send-key',
3361   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3364 # @screendump:
3366 # Write a PPM of the VGA screen to a file.
3368 # @filename: the path of a new PPM file to store the image
3370 # Returns: Nothing on success
3372 # Since: 0.14.0
3374 { 'command': 'screendump', 'data': {'filename': 'str'} }
3377 # @nbd-server-start:
3379 # Start an NBD server listening on the given host and port.  Block
3380 # devices can then be exported using @nbd-server-add.  The NBD
3381 # server will present them as named exports; for example, another
3382 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3384 # @addr: Address on which to listen.
3386 # Returns: error if the server is already running.
3388 # Since: 1.3.0
3390 { 'command': 'nbd-server-start',
3391   'data': { 'addr': 'SocketAddress' } }
3394 # @nbd-server-add:
3396 # Export a device to QEMU's embedded NBD server.
3398 # @device: Block device to be exported
3400 # @writable: Whether clients should be able to write to the device via the
3401 #     NBD connection (default false). #optional
3403 # Returns: error if the device is already marked for export.
3405 # Since: 1.3.0
3407 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3410 # @nbd-server-stop:
3412 # Stop QEMU's embedded NBD server, and unregister all devices previously
3413 # added via @nbd-server-add.
3415 # Since: 1.3.0
3417 { 'command': 'nbd-server-stop' }
3420 # @ChardevFile:
3422 # Configuration info for file chardevs.
3424 # @in:  #optional The name of the input file
3425 # @out: The name of the output file
3427 # Since: 1.4
3429 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3430                                    'out' : 'str' } }
3433 # @ChardevHostdev:
3435 # Configuration info for device and pipe chardevs.
3437 # @device: The name of the special file for the device,
3438 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3439 # @type: What kind of device this is.
3441 # Since: 1.4
3443 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3446 # @ChardevSocket:
3448 # Configuration info for (stream) socket chardevs.
3450 # @addr: socket address to listen on (server=true)
3451 #        or connect to (server=false)
3452 # @server: #optional create server socket (default: true)
3453 # @wait: #optional wait for incoming connection on server
3454 #        sockets (default: false).
3455 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3456 # @telnet: #optional enable telnet protocol on server
3457 #          sockets (default: false)
3459 # Since: 1.4
3461 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3462                                      '*server'  : 'bool',
3463                                      '*wait'    : 'bool',
3464                                      '*nodelay' : 'bool',
3465                                      '*telnet'  : 'bool' } }
3468 # @ChardevUdp:
3470 # Configuration info for datagram socket chardevs.
3472 # @remote: remote address
3473 # @local: #optional local address
3475 # Since: 1.5
3477 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3478                                   '*local' : 'SocketAddress' } }
3481 # @ChardevMux:
3483 # Configuration info for mux chardevs.
3485 # @chardev: name of the base chardev.
3487 # Since: 1.5
3489 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3492 # @ChardevStdio:
3494 # Configuration info for stdio chardevs.
3496 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3497 #          be delivered to qemu.  Default: true in -nographic mode,
3498 #          false otherwise.
3500 # Since: 1.5
3502 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3505 # @ChardevSpiceChannel:
3507 # Configuration info for spice vm channel chardevs.
3509 # @type: kind of channel (for example vdagent).
3511 # Since: 1.5
3513 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3516 # @ChardevSpicePort:
3518 # Configuration info for spice port chardevs.
3520 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3522 # Since: 1.5
3524 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3527 # @ChardevVC:
3529 # Configuration info for virtual console chardevs.
3531 # @width:  console width,  in pixels
3532 # @height: console height, in pixels
3533 # @cols:   console width,  in chars
3534 # @rows:   console height, in chars
3536 # Since: 1.5
3538 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3539                                  '*height' : 'int',
3540                                  '*cols'   : 'int',
3541                                  '*rows'   : 'int' } }
3544 # @ChardevRingbuf:
3546 # Configuration info for ring buffer chardevs.
3548 # @size: #optional ring buffer size, must be power of two, default is 65536
3550 # Since: 1.5
3552 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3555 # @ChardevBackend:
3557 # Configuration info for the new chardev backend.
3559 # Since: 1.4
3561 { 'type': 'ChardevDummy', 'data': { } }
3563 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3564                                        'serial' : 'ChardevHostdev',
3565                                        'parallel': 'ChardevHostdev',
3566                                        'pipe'   : 'ChardevHostdev',
3567                                        'socket' : 'ChardevSocket',
3568                                        'udp'    : 'ChardevUdp',
3569                                        'pty'    : 'ChardevDummy',
3570                                        'null'   : 'ChardevDummy',
3571                                        'mux'    : 'ChardevMux',
3572                                        'msmouse': 'ChardevDummy',
3573                                        'braille': 'ChardevDummy',
3574                                        'stdio'  : 'ChardevStdio',
3575                                        'console': 'ChardevDummy',
3576                                        'spicevmc' : 'ChardevSpiceChannel',
3577                                        'spiceport' : 'ChardevSpicePort',
3578                                        'vc'     : 'ChardevVC',
3579                                        'ringbuf': 'ChardevRingbuf',
3580                                        # next one is just for compatibility
3581                                        'memory' : 'ChardevRingbuf' } }
3584 # @ChardevReturn:
3586 # Return info about the chardev backend just created.
3588 # @pty: #optional name of the slave pseudoterminal device, present if
3589 #       and only if a chardev of type 'pty' was created
3591 # Since: 1.4
3593 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3596 # @chardev-add:
3598 # Add a character device backend
3600 # @id: the chardev's ID, must be unique
3601 # @backend: backend type and parameters
3603 # Returns: ChardevReturn.
3605 # Since: 1.4
3607 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3608                                      'backend' : 'ChardevBackend' },
3609   'returns': 'ChardevReturn' }
3612 # @chardev-remove:
3614 # Remove a character device backend
3616 # @id: the chardev's ID, must exist and not be in use
3618 # Returns: Nothing on success
3620 # Since: 1.4
3622 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3625 # @TpmModel:
3627 # An enumeration of TPM models
3629 # @tpm-tis: TPM TIS model
3631 # Since: 1.5
3633 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3636 # @query-tpm-models:
3638 # Return a list of supported TPM models
3640 # Returns: a list of TpmModel
3642 # Since: 1.5
3644 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3647 # @TpmType:
3649 # An enumeration of TPM types
3651 # @passthrough: TPM passthrough type
3653 # Since: 1.5
3655 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3658 # @query-tpm-types:
3660 # Return a list of supported TPM types
3662 # Returns: a list of TpmType
3664 # Since: 1.5
3666 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3669 # @TPMPassthroughOptions:
3671 # Information about the TPM passthrough type
3673 # @path: #optional string describing the path used for accessing the TPM device
3675 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3676 #               for cancellation of TPM commands while they are executing
3678 # Since: 1.5
3680 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3681                                              '*cancel-path' : 'str'} }
3684 # @TpmTypeOptions:
3686 # A union referencing different TPM backend types' configuration options
3688 # @passthrough: The configuration options for the TPM passthrough type
3690 # Since: 1.5
3692 { 'union': 'TpmTypeOptions',
3693    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3696 # @TpmInfo:
3698 # Information about the TPM
3700 # @id: The Id of the TPM
3702 # @model: The TPM frontend model
3704 # @options: The TPM (backend) type configuration options
3706 # Since: 1.5
3708 { 'type': 'TPMInfo',
3709   'data': {'id': 'str',
3710            'model': 'TpmModel',
3711            'options': 'TpmTypeOptions' } }
3714 # @query-tpm:
3716 # Return information about the TPM device
3718 # Returns: @TPMInfo on success
3720 # Since: 1.5
3722 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3725 # @AcpiTableOptions
3727 # Specify an ACPI table on the command line to load.
3729 # At most one of @file and @data can be specified. The list of files specified
3730 # by any one of them is loaded and concatenated in order. If both are omitted,
3731 # @data is implied.
3733 # Other fields / optargs can be used to override fields of the generic ACPI
3734 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3735 # Description Table Header. If a header field is not overridden, then the
3736 # corresponding value from the concatenated blob is used (in case of @file), or
3737 # it is filled in with a hard-coded value (in case of @data).
3739 # String fields are copied into the matching ACPI member from lowest address
3740 # upwards, and silently truncated / NUL-padded to length.
3742 # @sig: #optional table signature / identifier (4 bytes)
3744 # @rev: #optional table revision number (dependent on signature, 1 byte)
3746 # @oem_id: #optional OEM identifier (6 bytes)
3748 # @oem_table_id: #optional OEM table identifier (8 bytes)
3750 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3752 # @asl_compiler_id: #optional identifier of the utility that created the table
3753 #                   (4 bytes)
3755 # @asl_compiler_rev: #optional revision number of the utility that created the
3756 #                    table (4 bytes)
3758 # @file: #optional colon (:) separated list of pathnames to load and
3759 #        concatenate as table data. The resultant binary blob is expected to
3760 #        have an ACPI table header. At least one file is required. This field
3761 #        excludes @data.
3763 # @data: #optional colon (:) separated list of pathnames to load and
3764 #        concatenate as table data. The resultant binary blob must not have an
3765 #        ACPI table header. At least one file is required. This field excludes
3766 #        @file.
3768 # Since 1.5
3770 { 'type': 'AcpiTableOptions',
3771   'data': {
3772     '*sig':               'str',
3773     '*rev':               'uint8',
3774     '*oem_id':            'str',
3775     '*oem_table_id':      'str',
3776     '*oem_rev':           'uint32',
3777     '*asl_compiler_id':   'str',
3778     '*asl_compiler_rev':  'uint32',
3779     '*file':              'str',
3780     '*data':              'str' }}
3783 # @CommandLineParameterType:
3785 # Possible types for an option parameter.
3787 # @string: accepts a character string
3789 # @boolean: accepts "on" or "off"
3791 # @number: accepts a number
3793 # @size: accepts a number followed by an optional suffix (K)ilo,
3794 #        (M)ega, (G)iga, (T)era
3796 # Since 1.5
3798 { 'enum': 'CommandLineParameterType',
3799   'data': ['string', 'boolean', 'number', 'size'] }
3802 # @CommandLineParameterInfo:
3804 # Details about a single parameter of a command line option.
3806 # @name: parameter name
3808 # @type: parameter @CommandLineParameterType
3810 # @help: #optional human readable text string, not suitable for parsing.
3812 # Since 1.5
3814 { 'type': 'CommandLineParameterInfo',
3815   'data': { 'name': 'str',
3816             'type': 'CommandLineParameterType',
3817             '*help': 'str' } }
3820 # @CommandLineOptionInfo:
3822 # Details about a command line option, including its list of parameter details
3824 # @option: option name
3826 # @parameters: an array of @CommandLineParameterInfo
3828 # Since 1.5
3830 { 'type': 'CommandLineOptionInfo',
3831   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3834 # @query-command-line-options:
3836 # Query command line option schema.
3838 # @option: #optional option name
3840 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3841 #          @option).  Returns an error if the given @option doesn't exist.
3843 # Since 1.5
3845 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3846  'returns': ['CommandLineOptionInfo'] }
3849 # @X86CPURegister32
3851 # A X86 32-bit register
3853 # Since: 1.5
3855 { 'enum': 'X86CPURegister32',
3856   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3859 # @X86CPUFeatureWordInfo
3861 # Information about a X86 CPU feature word
3863 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3865 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3866 #                   feature word
3868 # @cpuid-register: Output register containing the feature bits
3870 # @features: value of output register, containing the feature bits
3872 # Since: 1.5
3874 { 'type': 'X86CPUFeatureWordInfo',
3875   'data': { 'cpuid-input-eax': 'int',
3876             '*cpuid-input-ecx': 'int',
3877             'cpuid-register': 'X86CPURegister32',
3878             'features': 'int' } }
3881 # @RxState:
3883 # Packets receiving state
3885 # @normal: filter assigned packets according to the mac-table
3887 # @none: don't receive any assigned packet
3889 # @all: receive all assigned packets
3891 # Since: 1.6
3893 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
3896 # @RxFilterInfo:
3898 # Rx-filter information for a NIC.
3900 # @name: net client name
3902 # @promiscuous: whether promiscuous mode is enabled
3904 # @multicast: multicast receive state
3906 # @unicast: unicast receive state
3908 # @broadcast-allowed: whether to receive broadcast
3910 # @multicast-overflow: multicast table is overflowed or not
3912 # @unicast-overflow: unicast table is overflowed or not
3914 # @main-mac: the main macaddr string
3916 # @vlan-table: a list of active vlan id
3918 # @unicast-table: a list of unicast macaddr string
3920 # @multicast-table: a list of multicast macaddr string
3922 # Since 1.6
3925 { 'type': 'RxFilterInfo',
3926   'data': {
3927     'name':               'str',
3928     'promiscuous':        'bool',
3929     'multicast':          'RxState',
3930     'unicast':            'RxState',
3931     'broadcast-allowed':  'bool',
3932     'multicast-overflow': 'bool',
3933     'unicast-overflow':   'bool',
3934     'main-mac':           'str',
3935     'vlan-table':         ['int'],
3936     'unicast-table':      ['str'],
3937     'multicast-table':    ['str'] }}
3940 # @query-rx-filter:
3942 # Return rx-filter information for all NICs (or for the given NIC).
3944 # @name: #optional net client name
3946 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
3947 #          Returns an error if the given @name doesn't exist, or given
3948 #          NIC doesn't support rx-filter querying, or given net client
3949 #          isn't a NIC.
3951 # Since: 1.6
3953 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
3954   'returns': ['RxFilterInfo'] }
3958 # @BlockdevDiscardOptions
3960 # Determines how to handle discard requests.
3962 # @ignore:      Ignore the request
3963 # @unmap:       Forward as an unmap request
3965 # Since: 1.7
3967 { 'enum': 'BlockdevDiscardOptions',
3968   'data': [ 'ignore', 'unmap' ] }
3971 # @BlockdevAioOptions
3973 # Selects the AIO backend to handle I/O requests
3975 # @threads:     Use qemu's thread pool
3976 # @native:      Use native AIO backend (only Linux and Windows)
3978 # Since: 1.7
3980 { 'enum': 'BlockdevAioOptions',
3981   'data': [ 'threads', 'native' ] }
3984 # @BlockdevCacheOptions
3986 # Includes cache-related options for block devices
3988 # @writeback:   #optional enables writeback mode for any caches (default: true)
3989 # @direct:      #optional enables use of O_DIRECT (bypass the host page cache;
3990 #               default: false)
3991 # @no-flush:    #optional ignore any flush requests for the device (default:
3992 #               false)
3994 # Since: 1.7
3996 { 'type': 'BlockdevCacheOptions',
3997   'data': { '*writeback': 'bool',
3998             '*direct': 'bool',
3999             '*no-flush': 'bool' } }
4002 # @BlockdevOptionsBase
4004 # Options that are available for all block devices, independent of the block
4005 # driver.
4007 # @driver:      block driver name
4008 # @id:          #optional id by which the new block device can be referred to.
4009 #               This is a required option on the top level of blockdev-add, and
4010 #               currently not allowed on any other level.
4011 # @discard:     #optional discard-related options (default: ignore)
4012 # @cache:       #optional cache-related options
4013 # @aio:         #optional AIO backend (default: threads)
4014 # @rerror:      #optional how to handle read errors on the device
4015 #               (default: report)
4016 # @werror:      #optional how to handle write errors on the device
4017 #               (default: enospc)
4018 # @read-only:   #optional whether the block device should be read-only
4019 #               (default: false)
4021 # Since: 1.7
4023 { 'type': 'BlockdevOptionsBase',
4024   'data': { 'driver': 'str',
4025             '*id': 'str',
4026             '*discard': 'BlockdevDiscardOptions',
4027             '*cache': 'BlockdevCacheOptions',
4028             '*aio': 'BlockdevAioOptions',
4029             '*rerror': 'BlockdevOnError',
4030             '*werror': 'BlockdevOnError',
4031             '*read-only': 'bool' } }
4034 # @BlockdevOptionsFile
4036 # Driver specific block device options for the file backend and similar
4037 # protocols.
4039 # @filename:    path to the image file
4041 # Since: 1.7
4043 { 'type': 'BlockdevOptionsFile',
4044   'data': { 'filename': 'str' } }
4047 # @BlockdevOptionsVVFAT
4049 # Driver specific block device options for the vvfat protocol.
4051 # @dir:         directory to be exported as FAT image
4052 # @fat-type:    #optional FAT type: 12, 16 or 32
4053 # @floppy:      #optional whether to export a floppy image (true) or
4054 #               partitioned hard disk (false; default)
4055 # @rw:          #optional whether to allow write operations (default: false)
4057 # Since: 1.7
4059 { 'type': 'BlockdevOptionsVVFAT',
4060   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4061             '*rw': 'bool' } }
4064 # @BlockdevOptionsGenericFormat
4066 # Driver specific block device options for image format that have no option
4067 # besides their data source.
4069 # @file:        reference to or definition of the data source block device
4071 # Since: 1.7
4073 { 'type': 'BlockdevOptionsGenericFormat',
4074   'data': { 'file': 'BlockdevRef' } }
4077 # @BlockdevOptionsGenericCOWFormat
4079 # Driver specific block device options for image format that have no option
4080 # besides their data source and an optional backing file.
4082 # @backing:     #optional reference to or definition of the backing file block
4083 #               device (if missing, taken from the image file content). It is
4084 #               allowed to pass an empty string here in order to disable the
4085 #               default backing file.
4087 # Since: 1.7
4089 { 'type': 'BlockdevOptionsGenericCOWFormat',
4090   'base': 'BlockdevOptionsGenericFormat',
4091   'data': { '*backing': 'BlockdevRef' } }
4094 # @BlockdevOptionsQcow2
4096 # Driver specific block device options for qcow2.
4098 # @lazy-refcounts:        #optional whether to enable the lazy refcounts
4099 #                         feature (default is taken from the image file)
4101 # @pass-discard-request:  #optional whether discard requests to the qcow2
4102 #                         device should be forwarded to the data source
4104 # @pass-discard-snapshot: #optional whether discard requests for the data source
4105 #                         should be issued when a snapshot operation (e.g.
4106 #                         deleting a snapshot) frees clusters in the qcow2 file
4108 # @pass-discard-other:    #optional whether discard requests for the data source
4109 #                         should be issued on other occasions where a cluster
4110 #                         gets freed
4112 # Since: 1.7
4114 { 'type': 'BlockdevOptionsQcow2',
4115   'base': 'BlockdevOptionsGenericCOWFormat',
4116   'data': { '*lazy-refcounts': 'bool',
4117             '*pass-discard-request': 'bool',
4118             '*pass-discard-snapshot': 'bool',
4119             '*pass-discard-other': 'bool' } }
4122 # @BlockdevOptions
4124 # Options for creating a block device.
4126 # Since: 1.7
4128 { 'union': 'BlockdevOptions',
4129   'base': 'BlockdevOptionsBase',
4130   'discriminator': 'driver',
4131   'data': {
4132       'file':       'BlockdevOptionsFile',
4133       'http':       'BlockdevOptionsFile',
4134       'https':      'BlockdevOptionsFile',
4135       'ftp':        'BlockdevOptionsFile',
4136       'ftps':       'BlockdevOptionsFile',
4137       'tftp':       'BlockdevOptionsFile',
4138 # TODO gluster: Wait for structured options
4139 # TODO iscsi: Wait for structured options
4140 # TODO nbd: Should take InetSocketAddress for 'host'?
4141 # TODO rbd: Wait for structured options
4142 # TODO sheepdog: Wait for structured options
4143 # TODO ssh: Should take InetSocketAddress for 'host'?
4144       'vvfat':      'BlockdevOptionsVVFAT',
4146 # TODO blkdebug: Wait for structured options
4147 # TODO blkverify: Wait for structured options
4149       'bochs':      'BlockdevOptionsGenericFormat',
4150       'cloop':      'BlockdevOptionsGenericFormat',
4151       'cow':        'BlockdevOptionsGenericCOWFormat',
4152       'dmg':        'BlockdevOptionsGenericFormat',
4153       'parallels':  'BlockdevOptionsGenericFormat',
4154       'qcow':       'BlockdevOptionsGenericCOWFormat',
4155       'qcow2':      'BlockdevOptionsQcow2',
4156       'qed':        'BlockdevOptionsGenericCOWFormat',
4157       'raw':        'BlockdevOptionsGenericFormat',
4158       'vdi':        'BlockdevOptionsGenericFormat',
4159       'vhdx':       'BlockdevOptionsGenericFormat',
4160       'vmdk':       'BlockdevOptionsGenericCOWFormat',
4161       'vpc':        'BlockdevOptionsGenericFormat'
4162   } }
4165 # @BlockdevRef
4167 # Reference to a block device.
4169 # @definition:      defines a new block device inline
4170 # @reference:       references the ID of an existing block device. An
4171 #                   empty string means that no block device should be
4172 #                   referenced.
4174 # Since: 1.7
4176 { 'union': 'BlockdevRef',
4177   'discriminator': {},
4178   'data': { 'definition': 'BlockdevOptions',
4179             'reference': 'str' } }
4182 # @blockdev-add:
4184 # Creates a new block device.
4186 # @options: block device options for the new device
4188 # Since: 1.7
4190 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }