tcg: Optimize brcond2 and setcond2 ne/eq
[qemu.git] / qapi-schema.json
blob7bc33ea71746a1d821fede970f848fd764bd689c
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' ] }
33 # LostTickPolicy:
35 # Policy for handling lost ticks in timer devices.
37 # @discard: throw away the missed tick(s) and continue with future injection
38 #           normally.  Guest time may be delayed, unless the OS has explicit
39 #           handling of lost ticks
41 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
42 #         delayed due to the late tick
44 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
45 #         may be delayed, depending on how the OS reacts to the merging
46 #         of ticks
48 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
49 #        guest time should not be delayed once catchup is complete.
51 # Since: 2.0
53 { 'enum': 'LostTickPolicy',
54   'data': ['discard', 'delay', 'merge', 'slew' ] }
57 # BiosAtaTranslation:
59 # Policy that BIOS should use to interpret cylinder/head/sector
60 # addresses.  Note that Bochs BIOS and SeaBIOS will not actually
61 # translate logical CHS to physical; instead, they will use logical
62 # block addressing.
64 # @auto: If cylinder/heads/sizes are passed, choose between none and LBA
65 #        depending on the size of the disk.  If they are not passed,
66 #        choose none if QEMU can guess that the disk had 16 or fewer
67 #        heads, large if QEMU can guess that the disk had 131072 or
68 #        fewer tracks across all heads (i.e. cylinders*heads<131072),
69 #        otherwise LBA.
71 # @none: The physical disk geometry is equal to the logical geometry.
73 # @lba: Assume 63 sectors per track and one of 16, 32, 64, 128 or 255
74 #       heads (if fewer than 255 are enough to cover the whole disk
75 #       with 1024 cylinders/head).  The number of cylinders/head is
76 #       then computed based on the number of sectors and heads.
78 # @large: The number of cylinders per head is scaled down to 1024
79 #         by correspondingly scaling up the number of heads.
81 # @rechs: Same as @large, but first convert a 16-head geometry to
82 #         15-head, by proportionally scaling up the number of
83 #         cylinders/head.
85 # Since: 2.0
87 { 'enum': 'BiosAtaTranslation',
88   'data': ['auto', 'none', 'lba', 'large', 'rechs']}
90 # @add_client
92 # Allow client connections for VNC, Spice and socket based
93 # character devices to be passed in to QEMU via SCM_RIGHTS.
95 # @protocol: protocol name. Valid names are "vnc", "spice" or the
96 #            name of a character device (eg. from -chardev id=XXXX)
98 # @fdname: file descriptor name previously passed via 'getfd' command
100 # @skipauth: #optional whether to skip authentication. Only applies
101 #            to "vnc" and "spice" protocols
103 # @tls: #optional whether to perform TLS. Only applies to the "spice"
104 #       protocol
106 # Returns: nothing on success.
108 # Since: 0.14.0
110 { 'command': 'add_client',
111   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
112             '*tls': 'bool' } }
115 # @NameInfo:
117 # Guest name information.
119 # @name: #optional The name of the guest
121 # Since 0.14.0
123 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
126 # @query-name:
128 # Return the name information of a guest.
130 # Returns: @NameInfo of the guest
132 # Since 0.14.0
134 { 'command': 'query-name', 'returns': 'NameInfo' }
137 # @VersionInfo:
139 # A description of QEMU's version.
141 # @qemu.major:  The major version of QEMU
143 # @qemu.minor:  The minor version of QEMU
145 # @qemu.micro:  The micro version of QEMU.  By current convention, a micro
146 #               version of 50 signifies a development branch.  A micro version
147 #               greater than or equal to 90 signifies a release candidate for
148 #               the next minor version.  A micro version of less than 50
149 #               signifies a stable release.
151 # @package:     QEMU will always set this field to an empty string.  Downstream
152 #               versions of QEMU should set this to a non-empty string.  The
153 #               exact format depends on the downstream however it highly
154 #               recommended that a unique name is used.
156 # Since: 0.14.0
158 { 'type': 'VersionInfo',
159   'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
160            'package': 'str'} }
163 # @query-version:
165 # Returns the current version of QEMU.
167 # Returns:  A @VersionInfo object describing the current version of QEMU.
169 # Since: 0.14.0
171 { 'command': 'query-version', 'returns': 'VersionInfo' }
174 # @KvmInfo:
176 # Information about support for KVM acceleration
178 # @enabled: true if KVM acceleration is active
180 # @present: true if KVM acceleration is built into this executable
182 # Since: 0.14.0
184 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
187 # @query-kvm:
189 # Returns information about KVM acceleration
191 # Returns: @KvmInfo
193 # Since: 0.14.0
195 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
198 # @RunState
200 # An enumeration of VM run states.
202 # @debug: QEMU is running on a debugger
204 # @finish-migrate: guest is paused to finish the migration process
206 # @inmigrate: guest is paused waiting for an incoming migration.  Note
207 # that this state does not tell whether the machine will start at the
208 # end of the migration.  This depends on the command-line -S option and
209 # any invocation of 'stop' or 'cont' that has happened since QEMU was
210 # started.
212 # @internal-error: An internal error that prevents further guest execution
213 # has occurred
215 # @io-error: the last IOP has failed and the device is configured to pause
216 # on I/O errors
218 # @paused: guest has been paused via the 'stop' command
220 # @postmigrate: guest is paused following a successful 'migrate'
222 # @prelaunch: QEMU was started with -S and guest has not started
224 # @restore-vm: guest is paused to restore VM state
226 # @running: guest is actively running
228 # @save-vm: guest is paused to save the VM state
230 # @shutdown: guest is shut down (and -no-shutdown is in use)
232 # @suspended: guest is suspended (ACPI S3)
234 # @watchdog: the watchdog action is configured to pause and has been triggered
236 # @guest-panicked: guest has been panicked as a result of guest OS panic
238 { 'enum': 'RunState',
239   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
240             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
241             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
242             'guest-panicked' ] }
245 # @SnapshotInfo
247 # @id: unique snapshot id
249 # @name: user chosen name
251 # @vm-state-size: size of the VM state
253 # @date-sec: UTC date of the snapshot in seconds
255 # @date-nsec: fractional part in nano seconds to be used with date-sec
257 # @vm-clock-sec: VM clock relative to boot in seconds
259 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
261 # Since: 1.3
265 { 'type': 'SnapshotInfo',
266   'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
267             'date-sec': 'int', 'date-nsec': 'int',
268             'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
271 # @ImageInfoSpecificQCow2:
273 # @compat: compatibility level
275 # @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
277 # Since: 1.7
279 { 'type': 'ImageInfoSpecificQCow2',
280   'data': {
281       'compat': 'str',
282       '*lazy-refcounts': 'bool'
283   } }
286 # @ImageInfoSpecificVmdk:
288 # @create-type: The create type of VMDK image
290 # @cid: Content id of image
292 # @parent-cid: Parent VMDK image's cid
294 # @extents: List of extent files
296 # Since: 1.7
298 { 'type': 'ImageInfoSpecificVmdk',
299   'data': {
300       'create-type': 'str',
301       'cid': 'int',
302       'parent-cid': 'int',
303       'extents': ['ImageInfo']
304   } }
307 # @ImageInfoSpecific:
309 # A discriminated record of image format specific information structures.
311 # Since: 1.7
314 { 'union': 'ImageInfoSpecific',
315   'data': {
316       'qcow2': 'ImageInfoSpecificQCow2',
317       'vmdk': 'ImageInfoSpecificVmdk'
318   } }
321 # @ImageInfo:
323 # Information about a QEMU image file
325 # @filename: name of the image file
327 # @format: format of the image file
329 # @virtual-size: maximum capacity in bytes of the image
331 # @actual-size: #optional actual size on disk in bytes of the image
333 # @dirty-flag: #optional true if image is not cleanly closed
335 # @cluster-size: #optional size of a cluster in bytes
337 # @encrypted: #optional true if the image is encrypted
339 # @compressed: #optional true if the image is compressed (Since 1.7)
341 # @backing-filename: #optional name of the backing file
343 # @full-backing-filename: #optional full path of the backing file
345 # @backing-filename-format: #optional the format of the backing file
347 # @snapshots: #optional list of VM snapshots
349 # @backing-image: #optional info of the backing image (since 1.6)
351 # @format-specific: #optional structure supplying additional format-specific
352 # information (since 1.7)
354 # Since: 1.3
358 { 'type': 'ImageInfo',
359   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
360            '*actual-size': 'int', 'virtual-size': 'int',
361            '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
362            '*backing-filename': 'str', '*full-backing-filename': 'str',
363            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
364            '*backing-image': 'ImageInfo',
365            '*format-specific': 'ImageInfoSpecific' } }
368 # @ImageCheck:
370 # Information about a QEMU image file check
372 # @filename: name of the image file checked
374 # @format: format of the image file checked
376 # @check-errors: number of unexpected errors occurred during check
378 # @image-end-offset: #optional offset (in bytes) where the image ends, this
379 #                    field is present if the driver for the image format
380 #                    supports it
382 # @corruptions: #optional number of corruptions found during the check if any
384 # @leaks: #optional number of leaks found during the check if any
386 # @corruptions-fixed: #optional number of corruptions fixed during the check
387 #                     if any
389 # @leaks-fixed: #optional number of leaks fixed during the check if any
391 # @total-clusters: #optional total number of clusters, this field is present
392 #                  if the driver for the image format supports it
394 # @allocated-clusters: #optional total number of allocated clusters, this
395 #                      field is present if the driver for the image format
396 #                      supports it
398 # @fragmented-clusters: #optional total number of fragmented clusters, this
399 #                       field is present if the driver for the image format
400 #                       supports it
402 # @compressed-clusters: #optional total number of compressed clusters, this
403 #                       field is present if the driver for the image format
404 #                       supports it
406 # Since: 1.4
410 { 'type': 'ImageCheck',
411   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
412            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
413            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
414            '*total-clusters': 'int', '*allocated-clusters': 'int',
415            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
418 # @StatusInfo:
420 # Information about VCPU run state
422 # @running: true if all VCPUs are runnable, false if not runnable
424 # @singlestep: true if VCPUs are in single-step mode
426 # @status: the virtual machine @RunState
428 # Since:  0.14.0
430 # Notes: @singlestep is enabled through the GDB stub
432 { 'type': 'StatusInfo',
433   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
436 # @query-status:
438 # Query the run status of all VCPUs
440 # Returns: @StatusInfo reflecting all VCPUs
442 # Since:  0.14.0
444 { 'command': 'query-status', 'returns': 'StatusInfo' }
447 # @UuidInfo:
449 # Guest UUID information.
451 # @UUID: the UUID of the guest
453 # Since: 0.14.0
455 # Notes: If no UUID was specified for the guest, a null UUID is returned.
457 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
460 # @query-uuid:
462 # Query the guest UUID information.
464 # Returns: The @UuidInfo for the guest
466 # Since 0.14.0
468 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
471 # @ChardevInfo:
473 # Information about a character device.
475 # @label: the label of the character device
477 # @filename: the filename of the character device
479 # Notes: @filename is encoded using the QEMU command line character device
480 #        encoding.  See the QEMU man page for details.
482 # Since: 0.14.0
484 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
487 # @query-chardev:
489 # Returns information about current character devices.
491 # Returns: a list of @ChardevInfo
493 # Since: 0.14.0
495 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
498 # @ChardevBackendInfo:
500 # Information about a character device backend
502 # @name: The backend name
504 # Since: 2.0
506 { 'type': 'ChardevBackendInfo', 'data': {'name': 'str'} }
509 # @query-chardev-backends:
511 # Returns information about character device backends.
513 # Returns: a list of @ChardevBackendInfo
515 # Since: 2.0
517 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
520 # @DataFormat:
522 # An enumeration of data format.
524 # @utf8: Data is a UTF-8 string (RFC 3629)
526 # @base64: Data is Base64 encoded binary (RFC 3548)
528 # Since: 1.4
530 { 'enum': 'DataFormat',
531   'data': [ 'utf8', 'base64' ] }
534 # @ringbuf-write:
536 # Write to a ring buffer character device.
538 # @device: the ring buffer character device name
540 # @data: data to write
542 # @format: #optional data encoding (default 'utf8').
543 #          - base64: data must be base64 encoded text.  Its binary
544 #            decoding gets written.
545 #            Bug: invalid base64 is currently not rejected.
546 #            Whitespace *is* invalid.
547 #          - utf8: data's UTF-8 encoding is written
548 #          - data itself is always Unicode regardless of format, like
549 #            any other string.
551 # Returns: Nothing on success
553 # Since: 1.4
555 { 'command': 'ringbuf-write',
556   'data': {'device': 'str', 'data': 'str',
557            '*format': 'DataFormat'} }
560 # @ringbuf-read:
562 # Read from a ring buffer character device.
564 # @device: the ring buffer character device name
566 # @size: how many bytes to read at most
568 # @format: #optional data encoding (default 'utf8').
569 #          - base64: the data read is returned in base64 encoding.
570 #          - utf8: the data read is interpreted as UTF-8.
571 #            Bug: can screw up when the buffer contains invalid UTF-8
572 #            sequences, NUL characters, after the ring buffer lost
573 #            data, and when reading stops because the size limit is
574 #            reached.
575 #          - The return value is always Unicode regardless of format,
576 #            like any other string.
578 # Returns: data read from the device
580 # Since: 1.4
582 { 'command': 'ringbuf-read',
583   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
584   'returns': 'str' }
587 # @CommandInfo:
589 # Information about a QMP command
591 # @name: The command name
593 # Since: 0.14.0
595 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
598 # @query-commands:
600 # Return a list of supported QMP commands by this server
602 # Returns: A list of @CommandInfo for all supported commands
604 # Since: 0.14.0
606 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
609 # @EventInfo:
611 # Information about a QMP event
613 # @name: The event name
615 # Since: 1.2.0
617 { 'type': 'EventInfo', 'data': {'name': 'str'} }
620 # @query-events:
622 # Return a list of supported QMP events by this server
624 # Returns: A list of @EventInfo for all supported events
626 # Since: 1.2.0
628 { 'command': 'query-events', 'returns': ['EventInfo'] }
631 # @MigrationStats
633 # Detailed migration status.
635 # @transferred: amount of bytes already transferred to the target VM
637 # @remaining: amount of bytes remaining to be transferred to the target VM
639 # @total: total amount of bytes involved in the migration process
641 # @duplicate: number of duplicate (zero) pages (since 1.2)
643 # @skipped: number of skipped zero pages (since 1.5)
645 # @normal : number of normal pages (since 1.2)
647 # @normal-bytes: number of normal bytes sent (since 1.2)
649 # @dirty-pages-rate: number of pages dirtied by second by the
650 #        guest (since 1.3)
652 # @mbps: throughput in megabits/sec. (since 1.6)
654 # @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
656 # Since: 0.14.0
658 { 'type': 'MigrationStats',
659   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
660            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
661            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
662            'mbps' : 'number', 'dirty-sync-count' : 'int' } }
665 # @XBZRLECacheStats
667 # Detailed XBZRLE migration cache statistics
669 # @cache-size: XBZRLE cache size
671 # @bytes: amount of bytes already transferred to the target VM
673 # @pages: amount of pages transferred to the target VM
675 # @cache-miss: number of cache miss
677 # @cache-miss-rate: rate of cache miss (since 2.1)
679 # @overflow: number of overflows
681 # Since: 1.2
683 { 'type': 'XBZRLECacheStats',
684   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
685            'cache-miss': 'int', 'cache-miss-rate': 'number',
686            'overflow': 'int' } }
689 # @MigrationInfo
691 # Information about current migration process.
693 # @status: #optional string describing the current migration status.
694 #          As of 0.14.0 this can be 'setup', 'active', 'completed', 'failed' or
695 #          'cancelled'. If this field is not returned, no migration process
696 #          has been initiated
698 # @ram: #optional @MigrationStats containing detailed migration
699 #       status, only returned if status is 'active' or
700 #       'completed'. 'comppleted' (since 1.2)
702 # @disk: #optional @MigrationStats containing detailed disk migration
703 #        status, only returned if status is 'active' and it is a block
704 #        migration
706 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
707 #                migration statistics, only returned if XBZRLE feature is on and
708 #                status is 'active' or 'completed' (since 1.2)
710 # @total-time: #optional total amount of milliseconds since migration started.
711 #        If migration has ended, it returns the total migration
712 #        time. (since 1.2)
714 # @downtime: #optional only present when migration finishes correctly
715 #        total downtime in milliseconds for the guest.
716 #        (since 1.3)
718 # @expected-downtime: #optional only present while migration is active
719 #        expected downtime in milliseconds for the guest in last walk
720 #        of the dirty bitmap. (since 1.3)
722 # @setup-time: #optional amount of setup time in milliseconds _before_ the
723 #        iterations begin but _after_ the QMP command is issued. This is designed
724 #        to provide an accounting of any activities (such as RDMA pinning) which
725 #        may be expensive, but do not actually occur during the iterative
726 #        migration rounds themselves. (since 1.6)
728 # Since: 0.14.0
730 { 'type': 'MigrationInfo',
731   'data': {'*status': 'str', '*ram': 'MigrationStats',
732            '*disk': 'MigrationStats',
733            '*xbzrle-cache': 'XBZRLECacheStats',
734            '*total-time': 'int',
735            '*expected-downtime': 'int',
736            '*downtime': 'int',
737            '*setup-time': 'int'} }
740 # @query-migrate
742 # Returns information about current migration process.
744 # Returns: @MigrationInfo
746 # Since: 0.14.0
748 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
751 # @MigrationCapability
753 # Migration capabilities enumeration
755 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
756 #          This feature allows us to minimize migration traffic for certain work
757 #          loads, by sending compressed difference of the pages
759 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
760 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
761 #          Disabled by default. (since 2.0)
763 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
764 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
765 #          source and target VM to support this feature. To enable it is sufficient
766 #          to enable the capability on the source VM. The feature is disabled by
767 #          default. (since 1.6)
769 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
770 #          to speed up convergence of RAM migration. (since 1.6)
772 # Since: 1.2
774 { 'enum': 'MigrationCapability',
775   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks'] }
778 # @MigrationCapabilityStatus
780 # Migration capability information
782 # @capability: capability enum
784 # @state: capability state bool
786 # Since: 1.2
788 { 'type': 'MigrationCapabilityStatus',
789   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
792 # @migrate-set-capabilities
794 # Enable/Disable the following migration capabilities (like xbzrle)
796 # @capabilities: json array of capability modifications to make
798 # Since: 1.2
800 { 'command': 'migrate-set-capabilities',
801   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
804 # @query-migrate-capabilities
806 # Returns information about the current migration capabilities status
808 # Returns: @MigrationCapabilitiesStatus
810 # Since: 1.2
812 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
815 # @MouseInfo:
817 # Information about a mouse device.
819 # @name: the name of the mouse device
821 # @index: the index of the mouse device
823 # @current: true if this device is currently receiving mouse events
825 # @absolute: true if this device supports absolute coordinates as input
827 # Since: 0.14.0
829 { 'type': 'MouseInfo',
830   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
831            'absolute': 'bool'} }
834 # @query-mice:
836 # Returns information about each active mouse device
838 # Returns: a list of @MouseInfo for each device
840 # Since: 0.14.0
842 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
845 # @CpuInfo:
847 # Information about a virtual CPU
849 # @CPU: the index of the virtual CPU
851 # @current: this only exists for backwards compatible and should be ignored
853 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
854 #          to a processor specific low power mode.
856 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
857 #                pointer.
858 #                If the target is Sparc, this is the PC component of the
859 #                instruction pointer.
861 # @nip: #optional If the target is PPC, the instruction pointer
863 # @npc: #optional If the target is Sparc, the NPC component of the instruction
864 #                 pointer
866 # @PC: #optional If the target is MIPS, the instruction pointer
868 # @thread_id: ID of the underlying host thread
870 # Since: 0.14.0
872 # Notes: @halted is a transient state that changes frequently.  By the time the
873 #        data is sent to the client, the guest may no longer be halted.
875 { 'type': 'CpuInfo',
876   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
877            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
880 # @query-cpus:
882 # Returns a list of information about each virtual CPU.
884 # Returns: a list of @CpuInfo for each virtual CPU
886 # Since: 0.14.0
888 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
891 # @IOThreadInfo:
893 # Information about an iothread
895 # @id: the identifier of the iothread
897 # @thread-id: ID of the underlying host thread
899 # Since: 2.0
901 { 'type': 'IOThreadInfo',
902   'data': {'id': 'str', 'thread-id': 'int'} }
905 # @query-iothreads:
907 # Returns a list of information about each iothread.
909 # Note this list excludes the QEMU main loop thread, which is not declared
910 # using the -object iothread command-line option.  It is always the main thread
911 # of the process.
913 # Returns: a list of @IOThreadInfo for each iothread
915 # Since: 2.0
917 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
920 # @BlockDeviceInfo:
922 # Information about the backing device for a block device.
924 # @file: the filename of the backing device
926 # @node-name: #optional the name of the block driver node (Since 2.0)
928 # @ro: true if the backing device was open read-only
930 # @drv: the name of the block format used to open the backing device. As of
931 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
932 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
933 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
934 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
936 # @backing_file: #optional the name of the backing file (for copy-on-write)
938 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
940 # @encrypted: true if the backing device is encrypted
942 # @encryption_key_missing: true if the backing device is encrypted but an
943 #                          valid encryption key is missing
945 # @detect_zeroes: detect and optimize zero writes (Since 2.1)
947 # @bps: total throughput limit in bytes per second is specified
949 # @bps_rd: read throughput limit in bytes per second is specified
951 # @bps_wr: write throughput limit in bytes per second is specified
953 # @iops: total I/O operations per second is specified
955 # @iops_rd: read I/O operations per second is specified
957 # @iops_wr: write I/O operations per second is specified
959 # @image: the info of image used (since: 1.6)
961 # @bps_max: #optional total max in bytes (Since 1.7)
963 # @bps_rd_max: #optional read max in bytes (Since 1.7)
965 # @bps_wr_max: #optional write max in bytes (Since 1.7)
967 # @iops_max: #optional total I/O operations max (Since 1.7)
969 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
971 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
973 # @iops_size: #optional an I/O size in bytes (Since 1.7)
975 # Since: 0.14.0
978 { 'type': 'BlockDeviceInfo',
979   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
980             '*backing_file': 'str', 'backing_file_depth': 'int',
981             'encrypted': 'bool', 'encryption_key_missing': 'bool',
982             'detect_zeroes': 'BlockdevDetectZeroesOptions',
983             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
984             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
985             'image': 'ImageInfo',
986             '*bps_max': 'int', '*bps_rd_max': 'int',
987             '*bps_wr_max': 'int', '*iops_max': 'int',
988             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
989             '*iops_size': 'int' } }
992 # @BlockDeviceIoStatus:
994 # An enumeration of block device I/O status.
996 # @ok: The last I/O operation has succeeded
998 # @failed: The last I/O operation has failed
1000 # @nospace: The last I/O operation has failed due to a no-space condition
1002 # Since: 1.0
1004 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
1007 # @BlockDeviceMapEntry:
1009 # Entry in the metadata map of the device (returned by "qemu-img map")
1011 # @start: Offset in the image of the first byte described by this entry
1012 #         (in bytes)
1014 # @length: Length of the range described by this entry (in bytes)
1016 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
1017 #         before reaching one for which the range is allocated.  The value is
1018 #         in the range 0 to the depth of the image chain - 1.
1020 # @zero: the sectors in this range read as zeros
1022 # @data: reading the image will actually read data from a file (in particular,
1023 #        if @offset is present this means that the sectors are not simply
1024 #        preallocated, but contain actual data in raw format)
1026 # @offset: if present, the image file stores the data for this range in
1027 #          raw format at the given offset.
1029 # Since 1.7
1031 { 'type': 'BlockDeviceMapEntry',
1032   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
1033             'data': 'bool', '*offset': 'int' } }
1036 # @BlockDirtyInfo:
1038 # Block dirty bitmap information.
1040 # @count: number of dirty bytes according to the dirty bitmap
1042 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
1044 # Since: 1.3
1046 { 'type': 'BlockDirtyInfo',
1047   'data': {'count': 'int', 'granularity': 'int'} }
1050 # @BlockInfo:
1052 # Block device information.  This structure describes a virtual device and
1053 # the backing device associated with it.
1055 # @device: The device name associated with the virtual device.
1057 # @type: This field is returned only for compatibility reasons, it should
1058 #        not be used (always returns 'unknown')
1060 # @removable: True if the device supports removable media.
1062 # @locked: True if the guest has locked this device from having its media
1063 #          removed
1065 # @tray_open: #optional True if the device has a tray and it is open
1066 #             (only present if removable is true)
1068 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
1069 #                 driver has one or more dirty bitmaps) (Since 2.0)
1071 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
1072 #             supports it and the VM is configured to stop on errors
1074 # @inserted: #optional @BlockDeviceInfo describing the device if media is
1075 #            present
1077 # Since:  0.14.0
1079 { 'type': 'BlockInfo',
1080   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
1081            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
1082            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
1083            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
1086 # @query-block:
1088 # Get a list of BlockInfo for all virtual block devices.
1090 # Returns: a list of @BlockInfo describing each virtual block device
1092 # Since: 0.14.0
1094 { 'command': 'query-block', 'returns': ['BlockInfo'] }
1097 # @BlockDeviceStats:
1099 # Statistics of a virtual block device or a block backing device.
1101 # @rd_bytes:      The number of bytes read by the device.
1103 # @wr_bytes:      The number of bytes written by the device.
1105 # @rd_operations: The number of read operations performed by the device.
1107 # @wr_operations: The number of write operations performed by the device.
1109 # @flush_operations: The number of cache flush operations performed by the
1110 #                    device (since 0.15.0)
1112 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
1113 #                       (since 0.15.0).
1115 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1117 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1119 # @wr_highest_offset: The offset after the greatest byte written to the
1120 #                     device.  The intended use of this information is for
1121 #                     growable sparse files (like qcow2) that are used on top
1122 #                     of a physical device.
1124 # Since: 0.14.0
1126 { 'type': 'BlockDeviceStats',
1127   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1128            'wr_operations': 'int', 'flush_operations': 'int',
1129            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1130            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1133 # @BlockStats:
1135 # Statistics of a virtual block device or a block backing device.
1137 # @device: #optional If the stats are for a virtual block device, the name
1138 #          corresponding to the virtual block device.
1140 # @stats:  A @BlockDeviceStats for the device.
1142 # @parent: #optional This describes the file block device if it has one.
1144 # @backing: #optional This describes the backing block device if it has one.
1145 #           (Since 2.0)
1147 # Since: 0.14.0
1149 { 'type': 'BlockStats',
1150   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1151            '*parent': 'BlockStats',
1152            '*backing': 'BlockStats'} }
1155 # @query-blockstats:
1157 # Query the @BlockStats for all virtual block devices.
1159 # Returns: A list of @BlockStats for each virtual block devices.
1161 # Since: 0.14.0
1163 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1166 # @VncClientInfo:
1168 # Information about a connected VNC client.
1170 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1171 #        when possible.
1173 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1174 #          'ipv4' if the client is connected via IPv4 and TCP
1175 #          'unix' if the client is connected via a unix domain socket
1176 #          'unknown' otherwise
1178 # @service: The service name of the client's port.  This may depends on the
1179 #           host system's service database so symbolic names should not be
1180 #           relied on.
1182 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1183 #              Name of the client.
1185 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1186 #                 used for authentication.
1188 # Since: 0.14.0
1190 { 'type': 'VncClientInfo',
1191   'data': {'host': 'str', 'family': 'str', 'service': 'str',
1192            '*x509_dname': 'str', '*sasl_username': 'str'} }
1195 # @VncInfo:
1197 # Information about the VNC session.
1199 # @enabled: true if the VNC server is enabled, false otherwise
1201 # @host: #optional The hostname the VNC server is bound to.  This depends on
1202 #        the name resolution on the host and may be an IP address.
1204 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1205 #                    'ipv4' if the host is listening for IPv4 connections
1206 #                    'unix' if the host is listening on a unix domain socket
1207 #                    'unknown' otherwise
1209 # @service: #optional The service name of the server's port.  This may depends
1210 #           on the host system's service database so symbolic names should not
1211 #           be relied on.
1213 # @auth: #optional the current authentication type used by the server
1214 #        'none' if no authentication is being used
1215 #        'vnc' if VNC authentication is being used
1216 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1217 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1218 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1219 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1220 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1221 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1222 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1223 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1224 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1226 # @clients: a list of @VncClientInfo of all currently connected clients
1228 # Since: 0.14.0
1230 { 'type': 'VncInfo',
1231   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1232            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1235 # @query-vnc:
1237 # Returns information about the current VNC server
1239 # Returns: @VncInfo
1241 # Since: 0.14.0
1243 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1246 # @SpiceChannel
1248 # Information about a SPICE client channel.
1250 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1251 #        when possible.
1253 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1254 #          'ipv4' if the client is connected via IPv4 and TCP
1255 #          'unix' if the client is connected via a unix domain socket
1256 #          'unknown' otherwise
1258 # @port: The client's port number.
1260 # @connection-id: SPICE connection id number.  All channels with the same id
1261 #                 belong to the same SPICE session.
1263 # @connection-type: SPICE channel type number.  "1" is the main control
1264 #                   channel, filter for this one if you want to track spice
1265 #                   sessions only
1267 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1268 #              multiple channels of the same type exist, such as multiple
1269 #              display channels in a multihead setup
1271 # @tls: true if the channel is encrypted, false otherwise.
1273 # Since: 0.14.0
1275 { 'type': 'SpiceChannel',
1276   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1277            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1278            'tls': 'bool'} }
1281 # @SpiceQueryMouseMode
1283 # An enumeration of Spice mouse states.
1285 # @client: Mouse cursor position is determined by the client.
1287 # @server: Mouse cursor position is determined by the server.
1289 # @unknown: No information is available about mouse mode used by
1290 #           the spice server.
1292 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1294 # Since: 1.1
1296 { 'enum': 'SpiceQueryMouseMode',
1297   'data': [ 'client', 'server', 'unknown' ] }
1300 # @SpiceInfo
1302 # Information about the SPICE session.
1304 # @enabled: true if the SPICE server is enabled, false otherwise
1306 # @migrated: true if the last guest migration completed and spice
1307 #            migration had completed as well. false otherwise.
1309 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1310 #        the name resolution on the host and may be an IP address.
1312 # @port: #optional The SPICE server's port number.
1314 # @compiled-version: #optional SPICE server version.
1316 # @tls-port: #optional The SPICE server's TLS port number.
1318 # @auth: #optional the current authentication type used by the server
1319 #        'none'  if no authentication is being used
1320 #        'spice' uses SASL or direct TLS authentication, depending on command
1321 #                line options
1323 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1324 #              be determined by the client or the server, or unknown if spice
1325 #              server doesn't provide this information.
1327 #              Since: 1.1
1329 # @channels: a list of @SpiceChannel for each active spice channel
1331 # Since: 0.14.0
1333 { 'type': 'SpiceInfo',
1334   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1335            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1336            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1339 # @query-spice
1341 # Returns information about the current SPICE server
1343 # Returns: @SpiceInfo
1345 # Since: 0.14.0
1347 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1350 # @BalloonInfo:
1352 # Information about the guest balloon device.
1354 # @actual: the number of bytes the balloon currently contains
1356 # Since: 0.14.0
1359 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1362 # @query-balloon:
1364 # Return information about the balloon device.
1366 # Returns: @BalloonInfo on success
1367 #          If the balloon driver is enabled but not functional because the KVM
1368 #          kernel module cannot support it, KvmMissingCap
1369 #          If no balloon device is present, DeviceNotActive
1371 # Since: 0.14.0
1373 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1376 # @PciMemoryRange:
1378 # A PCI device memory region
1380 # @base: the starting address (guest physical)
1382 # @limit: the ending address (guest physical)
1384 # Since: 0.14.0
1386 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1389 # @PciMemoryRegion
1391 # Information about a PCI device I/O region.
1393 # @bar: the index of the Base Address Register for this region
1395 # @type: 'io' if the region is a PIO region
1396 #        'memory' if the region is a MMIO region
1398 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1400 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1402 # Since: 0.14.0
1404 { 'type': 'PciMemoryRegion',
1405   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1406            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1409 # @PciBridgeInfo:
1411 # Information about a PCI Bridge device
1413 # @bus.number: primary bus interface number.  This should be the number of the
1414 #              bus the device resides on.
1416 # @bus.secondary: secondary bus interface number.  This is the number of the
1417 #                 main bus for the bridge
1419 # @bus.subordinate: This is the highest number bus that resides below the
1420 #                   bridge.
1422 # @bus.io_range: The PIO range for all devices on this bridge
1424 # @bus.memory_range: The MMIO range for all devices on this bridge
1426 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1427 #                          this bridge
1429 # @devices: a list of @PciDeviceInfo for each device on this bridge
1431 # Since: 0.14.0
1433 { 'type': 'PciBridgeInfo',
1434   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1435                     'io_range': 'PciMemoryRange',
1436                     'memory_range': 'PciMemoryRange',
1437                     'prefetchable_range': 'PciMemoryRange' },
1438            '*devices': ['PciDeviceInfo']} }
1441 # @PciDeviceInfo:
1443 # Information about a PCI device
1445 # @bus: the bus number of the device
1447 # @slot: the slot the device is located in
1449 # @function: the function of the slot used by the device
1451 # @class_info.desc: #optional a string description of the device's class
1453 # @class_info.class: the class code of the device
1455 # @id.device: the PCI device id
1457 # @id.vendor: the PCI vendor id
1459 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1461 # @qdev_id: the device name of the PCI device
1463 # @pci_bridge: if the device is a PCI bridge, the bridge information
1465 # @regions: a list of the PCI I/O regions associated with the device
1467 # Notes: the contents of @class_info.desc are not stable and should only be
1468 #        treated as informational.
1470 # Since: 0.14.0
1472 { 'type': 'PciDeviceInfo',
1473   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1474            'class_info': {'*desc': 'str', 'class': 'int'},
1475            'id': {'device': 'int', 'vendor': 'int'},
1476            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1477            'regions': ['PciMemoryRegion']} }
1480 # @PciInfo:
1482 # Information about a PCI bus
1484 # @bus: the bus index
1486 # @devices: a list of devices on this bus
1488 # Since: 0.14.0
1490 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1493 # @query-pci:
1495 # Return information about the PCI bus topology of the guest.
1497 # Returns: a list of @PciInfo for each PCI bus
1499 # Since: 0.14.0
1501 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1504 # @BlockdevOnError:
1506 # An enumeration of possible behaviors for errors on I/O operations.
1507 # The exact meaning depends on whether the I/O was initiated by a guest
1508 # or by a block job
1510 # @report: for guest operations, report the error to the guest;
1511 #          for jobs, cancel the job
1513 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1514 #          or BLOCK_JOB_ERROR)
1516 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1518 # @stop: for guest operations, stop the virtual machine;
1519 #        for jobs, pause the job
1521 # Since: 1.3
1523 { 'enum': 'BlockdevOnError',
1524   'data': ['report', 'ignore', 'enospc', 'stop'] }
1527 # @MirrorSyncMode:
1529 # An enumeration of possible behaviors for the initial synchronization
1530 # phase of storage mirroring.
1532 # @top: copies data in the topmost image to the destination
1534 # @full: copies data from all images to the destination
1536 # @none: only copy data written from now on
1538 # Since: 1.3
1540 { 'enum': 'MirrorSyncMode',
1541   'data': ['top', 'full', 'none'] }
1544 # @BlockJobType:
1546 # Type of a block job.
1548 # @commit: block commit job type, see "block-commit"
1550 # @stream: block stream job type, see "block-stream"
1552 # @mirror: drive mirror job type, see "drive-mirror"
1554 # @backup: drive backup job type, see "drive-backup"
1556 # Since: 1.7
1558 { 'enum': 'BlockJobType',
1559   'data': ['commit', 'stream', 'mirror', 'backup'] }
1562 # @BlockJobInfo:
1564 # Information about a long-running block device operation.
1566 # @type: the job type ('stream' for image streaming)
1568 # @device: the block device name
1570 # @len: the maximum progress value
1572 # @busy: false if the job is known to be in a quiescent state, with
1573 #        no pending I/O.  Since 1.3.
1575 # @paused: whether the job is paused or, if @busy is true, will
1576 #          pause itself as soon as possible.  Since 1.3.
1578 # @offset: the current progress value
1580 # @speed: the rate limit, bytes per second
1582 # @io-status: the status of the job (since 1.3)
1584 # Since: 1.1
1586 { 'type': 'BlockJobInfo',
1587   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1588            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1589            'io-status': 'BlockDeviceIoStatus'} }
1592 # @query-block-jobs:
1594 # Return information about long-running block device operations.
1596 # Returns: a list of @BlockJobInfo for each active block job
1598 # Since: 1.1
1600 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1603 # @quit:
1605 # This command will cause the QEMU process to exit gracefully.  While every
1606 # attempt is made to send the QMP response before terminating, this is not
1607 # guaranteed.  When using this interface, a premature EOF would not be
1608 # unexpected.
1610 # Since: 0.14.0
1612 { 'command': 'quit' }
1615 # @stop:
1617 # Stop all guest VCPU execution.
1619 # Since:  0.14.0
1621 # Notes:  This function will succeed even if the guest is already in the stopped
1622 #         state.  In "inmigrate" state, it will ensure that the guest
1623 #         remains paused once migration finishes, as if the -S option was
1624 #         passed on the command line.
1626 { 'command': 'stop' }
1629 # @system_reset:
1631 # Performs a hard reset of a guest.
1633 # Since: 0.14.0
1635 { 'command': 'system_reset' }
1638 # @system_powerdown:
1640 # Requests that a guest perform a powerdown operation.
1642 # Since: 0.14.0
1644 # Notes: A guest may or may not respond to this command.  This command
1645 #        returning does not indicate that a guest has accepted the request or
1646 #        that it has shut down.  Many guests will respond to this command by
1647 #        prompting the user in some way.
1649 { 'command': 'system_powerdown' }
1652 # @cpu:
1654 # This command is a nop that is only provided for the purposes of compatibility.
1656 # Since: 0.14.0
1658 # Notes: Do not use this command.
1660 { 'command': 'cpu', 'data': {'index': 'int'} }
1663 # @cpu-add
1665 # Adds CPU with specified ID
1667 # @id: ID of CPU to be created, valid values [0..max_cpus)
1669 # Returns: Nothing on success
1671 # Since 1.5
1673 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1676 # @memsave:
1678 # Save a portion of guest memory to a file.
1680 # @val: the virtual address of the guest to start from
1682 # @size: the size of memory region to save
1684 # @filename: the file to save the memory to as binary data
1686 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1687 #                       virtual address (defaults to CPU 0)
1689 # Returns: Nothing on success
1691 # Since: 0.14.0
1693 # Notes: Errors were not reliably returned until 1.1
1695 { 'command': 'memsave',
1696   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1699 # @pmemsave:
1701 # Save a portion of guest physical memory to a file.
1703 # @val: the physical address of the guest to start from
1705 # @size: the size of memory region to save
1707 # @filename: the file to save the memory to as binary data
1709 # Returns: Nothing on success
1711 # Since: 0.14.0
1713 # Notes: Errors were not reliably returned until 1.1
1715 { 'command': 'pmemsave',
1716   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1719 # @cont:
1721 # Resume guest VCPU execution.
1723 # Since:  0.14.0
1725 # Returns:  If successful, nothing
1726 #           If QEMU was started with an encrypted block device and a key has
1727 #              not yet been set, DeviceEncrypted.
1729 # Notes:  This command will succeed if the guest is currently running.  It
1730 #         will also succeed if the guest is in the "inmigrate" state; in
1731 #         this case, the effect of the command is to make sure the guest
1732 #         starts once migration finishes, removing the effect of the -S
1733 #         command line option if it was passed.
1735 { 'command': 'cont' }
1738 # @system_wakeup:
1740 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1742 # Since:  1.1
1744 # Returns:  nothing.
1746 { 'command': 'system_wakeup' }
1749 # @inject-nmi:
1751 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1753 # Returns:  If successful, nothing
1755 # Since:  0.14.0
1757 # Notes: Only x86 Virtual Machines support this command.
1759 { 'command': 'inject-nmi' }
1762 # @set_link:
1764 # Sets the link status of a virtual network adapter.
1766 # @name: the device name of the virtual network adapter
1768 # @up: true to set the link status to be up
1770 # Returns: Nothing on success
1771 #          If @name is not a valid network device, DeviceNotFound
1773 # Since: 0.14.0
1775 # Notes: Not all network adapters support setting link status.  This command
1776 #        will succeed even if the network adapter does not support link status
1777 #        notification.
1779 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1782 # @block_passwd:
1784 # This command sets the password of a block device that has not been open
1785 # with a password and requires one.
1787 # The two cases where this can happen are a block device is created through
1788 # QEMU's initial command line or a block device is changed through the legacy
1789 # @change interface.
1791 # In the event that the block device is created through the initial command
1792 # line, the VM will start in the stopped state regardless of whether '-S' is
1793 # used.  The intention is for a management tool to query the block devices to
1794 # determine which ones are encrypted, set the passwords with this command, and
1795 # then start the guest with the @cont command.
1797 # Either @device or @node-name must be set but not both.
1799 # @device: #optional the name of the block backend device to set the password on
1801 # @node-name: #optional graph node name to set the password on (Since 2.0)
1803 # @password: the password to use for the device
1805 # Returns: nothing on success
1806 #          If @device is not a valid block device, DeviceNotFound
1807 #          If @device is not encrypted, DeviceNotEncrypted
1809 # Notes:  Not all block formats support encryption and some that do are not
1810 #         able to validate that a password is correct.  Disk corruption may
1811 #         occur if an invalid password is specified.
1813 # Since: 0.14.0
1815 { 'command': 'block_passwd', 'data': {'*device': 'str',
1816                                       '*node-name': 'str', 'password': 'str'} }
1819 # @balloon:
1821 # Request the balloon driver to change its balloon size.
1823 # @value: the target size of the balloon in bytes
1825 # Returns: Nothing on success
1826 #          If the balloon driver is enabled but not functional because the KVM
1827 #            kernel module cannot support it, KvmMissingCap
1828 #          If no balloon device is present, DeviceNotActive
1830 # Notes: This command just issues a request to the guest.  When it returns,
1831 #        the balloon size may not have changed.  A guest can change the balloon
1832 #        size independent of this command.
1834 # Since: 0.14.0
1836 { 'command': 'balloon', 'data': {'value': 'int'} }
1839 # @block_resize
1841 # Resize a block image while a guest is running.
1843 # Either @device or @node-name must be set but not both.
1845 # @device: #optional the name of the device to get the image resized
1847 # @node-name: #optional graph node name to get the image resized (Since 2.0)
1849 # @size:  new image size in bytes
1851 # Returns: nothing on success
1852 #          If @device is not a valid block device, DeviceNotFound
1854 # Since: 0.14.0
1856 { 'command': 'block_resize', 'data': { '*device': 'str',
1857                                        '*node-name': 'str',
1858                                        'size': 'int' }}
1861 # @NewImageMode
1863 # An enumeration that tells QEMU how to set the backing file path in
1864 # a new image file.
1866 # @existing: QEMU should look for an existing image file.
1868 # @absolute-paths: QEMU should create a new image with absolute paths
1869 # for the backing file. If there is no backing file available, the new
1870 # image will not be backed either.
1872 # Since: 1.1
1874 { 'enum': 'NewImageMode',
1875   'data': [ 'existing', 'absolute-paths' ] }
1878 # @BlockdevSnapshot
1880 # Either @device or @node-name must be set but not both.
1882 # @device: #optional the name of the device to generate the snapshot from.
1884 # @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
1886 # @snapshot-file: the target of the new image. A new file will be created.
1888 # @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
1890 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1892 # @mode: #optional whether and how QEMU should create a new image, default is
1893 #        'absolute-paths'.
1895 { 'type': 'BlockdevSnapshot',
1896   'data': { '*device': 'str', '*node-name': 'str',
1897             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1898             '*format': 'str', '*mode': 'NewImageMode' } }
1901 # @BlockdevSnapshotInternal
1903 # @device: the name of the device to generate the snapshot from
1905 # @name: the name of the internal snapshot to be created
1907 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1908 #        exists, the operation will fail. Only some image formats support it,
1909 #        for example, qcow2, rbd, and sheepdog.
1911 # Since: 1.7
1913 { 'type': 'BlockdevSnapshotInternal',
1914   'data': { 'device': 'str', 'name': 'str' } }
1917 # @DriveBackup
1919 # @device: the name of the device which should be copied.
1921 # @target: the target of the new image. If the file exists, or if it
1922 #          is a device, the existing file/device will be used as the new
1923 #          destination.  If it does not exist, a new file will be created.
1925 # @format: #optional the format of the new destination, default is to
1926 #          probe if @mode is 'existing', else the format of the source
1928 # @sync: what parts of the disk image should be copied to the destination
1929 #        (all the disk, only the sectors allocated in the topmost image, or
1930 #        only new I/O).
1932 # @mode: #optional whether and how QEMU should create a new image, default is
1933 #        'absolute-paths'.
1935 # @speed: #optional the maximum speed, in bytes per second
1937 # @on-source-error: #optional the action to take on an error on the source,
1938 #                   default 'report'.  'stop' and 'enospc' can only be used
1939 #                   if the block device supports io-status (see BlockInfo).
1941 # @on-target-error: #optional the action to take on an error on the target,
1942 #                   default 'report' (no limitations, since this applies to
1943 #                   a different block device than @device).
1945 # Note that @on-source-error and @on-target-error only affect background I/O.
1946 # If an error occurs during a guest write request, the device's rerror/werror
1947 # actions will be used.
1949 # Since: 1.6
1951 { 'type': 'DriveBackup',
1952   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1953             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1954             '*speed': 'int',
1955             '*on-source-error': 'BlockdevOnError',
1956             '*on-target-error': 'BlockdevOnError' } }
1959 # @Abort
1961 # This action can be used to test transaction failure.
1963 # Since: 1.6
1965 { 'type': 'Abort',
1966   'data': { } }
1969 # @TransactionAction
1971 # A discriminated record of operations that can be performed with
1972 # @transaction.
1974 { 'union': 'TransactionAction',
1975   'data': {
1976        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1977        'drive-backup': 'DriveBackup',
1978        'abort': 'Abort',
1979        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1980    } }
1983 # @transaction
1985 # Executes a number of transactionable QMP commands atomically. If any
1986 # operation fails, then the entire set of actions will be abandoned and the
1987 # appropriate error returned.
1989 #  List of:
1990 #  @TransactionAction: information needed for the respective operation
1992 # Returns: nothing on success
1993 #          Errors depend on the operations of the transaction
1995 # Note: The transaction aborts on the first failure.  Therefore, there will be
1996 # information on only one failed operation returned in an error condition, and
1997 # subsequent actions will not have been attempted.
1999 # Since 1.1
2001 { 'command': 'transaction',
2002   'data': { 'actions': [ 'TransactionAction' ] } }
2005 # @blockdev-snapshot-sync
2007 # Generates a synchronous snapshot of a block device.
2009 # For the arguments, see the documentation of BlockdevSnapshot.
2011 # Returns: nothing on success
2012 #          If @device is not a valid block device, DeviceNotFound
2014 # Since 0.14.0
2016 { 'command': 'blockdev-snapshot-sync',
2017   'data': 'BlockdevSnapshot' }
2020 # @blockdev-snapshot-internal-sync
2022 # Synchronously take an internal snapshot of a block device, when the format
2023 # of the image used supports it.
2025 # For the arguments, see the documentation of BlockdevSnapshotInternal.
2027 # Returns: nothing on success
2028 #          If @device is not a valid block device, DeviceNotFound
2029 #          If any snapshot matching @name exists, or @name is empty,
2030 #          GenericError
2031 #          If the format of the image used does not support it,
2032 #          BlockFormatFeatureNotSupported
2034 # Since 1.7
2036 { 'command': 'blockdev-snapshot-internal-sync',
2037   'data': 'BlockdevSnapshotInternal' }
2040 # @blockdev-snapshot-delete-internal-sync
2042 # Synchronously delete an internal snapshot of a block device, when the format
2043 # of the image used support it. The snapshot is identified by name or id or
2044 # both. One of the name or id is required. Return SnapshotInfo for the
2045 # successfully deleted snapshot.
2047 # @device: the name of the device to delete the snapshot from
2049 # @id: optional the snapshot's ID to be deleted
2051 # @name: optional the snapshot's name to be deleted
2053 # Returns: SnapshotInfo on success
2054 #          If @device is not a valid block device, DeviceNotFound
2055 #          If snapshot not found, GenericError
2056 #          If the format of the image used does not support it,
2057 #          BlockFormatFeatureNotSupported
2058 #          If @id and @name are both not specified, GenericError
2060 # Since 1.7
2062 { 'command': 'blockdev-snapshot-delete-internal-sync',
2063   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
2064   'returns': 'SnapshotInfo' }
2067 # @human-monitor-command:
2069 # Execute a command on the human monitor and return the output.
2071 # @command-line: the command to execute in the human monitor
2073 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2075 # Returns: the output of the command as a string
2077 # Since: 0.14.0
2079 # Notes: This command only exists as a stop-gap.  Its use is highly
2080 #        discouraged.  The semantics of this command are not guaranteed.
2082 #        Known limitations:
2084 #        o This command is stateless, this means that commands that depend
2085 #          on state information (such as getfd) might not work
2087 #       o Commands that prompt the user for data (eg. 'cont' when the block
2088 #         device is encrypted) don't currently work
2090 { 'command': 'human-monitor-command',
2091   'data': {'command-line': 'str', '*cpu-index': 'int'},
2092   'returns': 'str' }
2095 # @block-commit
2097 # Live commit of data from overlay image nodes into backing nodes - i.e.,
2098 # writes data between 'top' and 'base' into 'base'.
2100 # @device:  the name of the device
2102 # @base:   #optional The file name of the backing image to write data into.
2103 #                    If not specified, this is the deepest backing image
2105 # @top:              The file name of the backing image within the image chain,
2106 #                    which contains the topmost data to be committed down.
2108 #                    If top == base, that is an error.
2109 #                    If top == active, the job will not be completed by itself,
2110 #                    user needs to complete the job with the block-job-complete
2111 #                    command after getting the ready event. (Since 2.0)
2113 #                    If the base image is smaller than top, then the base image
2114 #                    will be resized to be the same size as top.  If top is
2115 #                    smaller than the base image, the base will not be
2116 #                    truncated.  If you want the base image size to match the
2117 #                    size of the smaller top, you can safely truncate it
2118 #                    yourself once the commit operation successfully completes.
2121 # @speed:  #optional the maximum speed, in bytes per second
2123 # Returns: Nothing on success
2124 #          If commit or stream is already active on this device, DeviceInUse
2125 #          If @device does not exist, DeviceNotFound
2126 #          If image commit is not supported by this device, NotSupported
2127 #          If @base or @top is invalid, a generic error is returned
2128 #          If @speed is invalid, InvalidParameter
2130 # Since: 1.3
2133 { 'command': 'block-commit',
2134   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
2135             '*speed': 'int' } }
2138 # @drive-backup
2140 # Start a point-in-time copy of a block device to a new destination.  The
2141 # status of ongoing drive-backup operations can be checked with
2142 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
2143 # The operation can be stopped before it has completed using the
2144 # block-job-cancel command.
2146 # For the arguments, see the documentation of DriveBackup.
2148 # Returns: nothing on success
2149 #          If @device is not a valid block device, DeviceNotFound
2151 # Since 1.6
2153 { 'command': 'drive-backup', 'data': 'DriveBackup' }
2156 # @query-named-block-nodes
2158 # Get the named block driver list
2160 # Returns: the list of BlockDeviceInfo
2162 # Since 2.0
2164 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
2167 # @drive-mirror
2169 # Start mirroring a block device's writes to a new destination.
2171 # @device:  the name of the device whose writes should be mirrored.
2173 # @target: the target of the new image. If the file exists, or if it
2174 #          is a device, the existing file/device will be used as the new
2175 #          destination.  If it does not exist, a new file will be created.
2177 # @format: #optional the format of the new destination, default is to
2178 #          probe if @mode is 'existing', else the format of the source
2180 # @mode: #optional whether and how QEMU should create a new image, default is
2181 #        'absolute-paths'.
2183 # @speed:  #optional the maximum speed, in bytes per second
2185 # @sync: what parts of the disk image should be copied to the destination
2186 #        (all the disk, only the sectors allocated in the topmost image, or
2187 #        only new I/O).
2189 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2190 #               if the image format doesn't have clusters, 4K if the clusters
2191 #               are smaller than that, else the cluster size.  Must be a
2192 #               power of 2 between 512 and 64M (since 1.4).
2194 # @buf-size: #optional maximum amount of data in flight from source to
2195 #            target (since 1.4).
2197 # @on-source-error: #optional the action to take on an error on the source,
2198 #                   default 'report'.  'stop' and 'enospc' can only be used
2199 #                   if the block device supports io-status (see BlockInfo).
2201 # @on-target-error: #optional the action to take on an error on the target,
2202 #                   default 'report' (no limitations, since this applies to
2203 #                   a different block device than @device).
2205 # Returns: nothing on success
2206 #          If @device is not a valid block device, DeviceNotFound
2208 # Since 1.3
2210 { 'command': 'drive-mirror',
2211   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2212             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2213             '*speed': 'int', '*granularity': 'uint32',
2214             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2215             '*on-target-error': 'BlockdevOnError' } }
2218 # @migrate_cancel
2220 # Cancel the current executing migration process.
2222 # Returns: nothing on success
2224 # Notes: This command succeeds even if there is no migration process running.
2226 # Since: 0.14.0
2228 { 'command': 'migrate_cancel' }
2231 # @migrate_set_downtime
2233 # Set maximum tolerated downtime for migration.
2235 # @value: maximum downtime in seconds
2237 # Returns: nothing on success
2239 # Since: 0.14.0
2241 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2244 # @migrate_set_speed
2246 # Set maximum speed for migration.
2248 # @value: maximum speed in bytes.
2250 # Returns: nothing on success
2252 # Notes: A value lesser than zero will be automatically round up to zero.
2254 # Since: 0.14.0
2256 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2259 # @migrate-set-cache-size
2261 # Set XBZRLE cache size
2263 # @value: cache size in bytes
2265 # The size will be rounded down to the nearest power of 2.
2266 # The cache size can be modified before and during ongoing migration
2268 # Returns: nothing on success
2270 # Since: 1.2
2272 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2275 # @query-migrate-cache-size
2277 # query XBZRLE cache size
2279 # Returns: XBZRLE cache size in bytes
2281 # Since: 1.2
2283 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2286 # @ObjectPropertyInfo:
2288 # @name: the name of the property
2290 # @type: the type of the property.  This will typically come in one of four
2291 #        forms:
2293 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2294 #           These types are mapped to the appropriate JSON type.
2296 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
2297 #           legacy qdev typename.  These types are always treated as strings.
2299 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
2300 #           device type name.  Child properties create the composition tree.
2302 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
2303 #           device type name.  Link properties form the device model graph.
2305 # Since: 1.2
2307 { 'type': 'ObjectPropertyInfo',
2308   'data': { 'name': 'str', 'type': 'str' } }
2311 # @qom-list:
2313 # This command will list any properties of a object given a path in the object
2314 # model.
2316 # @path: the path within the object model.  See @qom-get for a description of
2317 #        this parameter.
2319 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2320 #          object.
2322 # Since: 1.2
2324 { 'command': 'qom-list',
2325   'data': { 'path': 'str' },
2326   'returns': [ 'ObjectPropertyInfo' ] }
2329 # @qom-get:
2331 # This command will get a property from a object model path and return the
2332 # value.
2334 # @path: The path within the object model.  There are two forms of supported
2335 #        paths--absolute and partial paths.
2337 #        Absolute paths are derived from the root object and can follow child<>
2338 #        or link<> properties.  Since they can follow link<> properties, they
2339 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2340 #        and are prefixed  with a leading slash.
2342 #        Partial paths look like relative filenames.  They do not begin
2343 #        with a prefix.  The matching rules for partial paths are subtle but
2344 #        designed to make specifying objects easy.  At each level of the
2345 #        composition tree, the partial path is matched as an absolute path.
2346 #        The first match is not returned.  At least two matches are searched
2347 #        for.  A successful result is only returned if only one match is
2348 #        found.  If more than one match is found, a flag is return to
2349 #        indicate that the match was ambiguous.
2351 # @property: The property name to read
2353 # Returns: The property value.  The type depends on the property type.  legacy<>
2354 #          properties are returned as #str.  child<> and link<> properties are
2355 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2356 #          are returned as #int.
2358 # Since: 1.2
2360 { 'command': 'qom-get',
2361   'data': { 'path': 'str', 'property': 'str' },
2362   'returns': 'visitor',
2363   'gen': 'no' }
2366 # @qom-set:
2368 # This command will set a property from a object model path.
2370 # @path: see @qom-get for a description of this parameter
2372 # @property: the property name to set
2374 # @value: a value who's type is appropriate for the property type.  See @qom-get
2375 #         for a description of type mapping.
2377 # Since: 1.2
2379 { 'command': 'qom-set',
2380   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2381   'gen': 'no' }
2384 # @set_password:
2386 # Sets the password of a remote display session.
2388 # @protocol: `vnc' to modify the VNC server password
2389 #            `spice' to modify the Spice server password
2391 # @password: the new password
2393 # @connected: #optional how to handle existing clients when changing the
2394 #                       password.  If nothing is specified, defaults to `keep'
2395 #                       `fail' to fail the command if clients are connected
2396 #                       `disconnect' to disconnect existing clients
2397 #                       `keep' to maintain existing clients
2399 # Returns: Nothing on success
2400 #          If Spice is not enabled, DeviceNotFound
2402 # Since: 0.14.0
2404 { 'command': 'set_password',
2405   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2408 # @expire_password:
2410 # Expire the password of a remote display server.
2412 # @protocol: the name of the remote display protocol `vnc' or `spice'
2414 # @time: when to expire the password.
2415 #        `now' to expire the password immediately
2416 #        `never' to cancel password expiration
2417 #        `+INT' where INT is the number of seconds from now (integer)
2418 #        `INT' where INT is the absolute time in seconds
2420 # Returns: Nothing on success
2421 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2423 # Since: 0.14.0
2425 # Notes: Time is relative to the server and currently there is no way to
2426 #        coordinate server time with client time.  It is not recommended to
2427 #        use the absolute time version of the @time parameter unless you're
2428 #        sure you are on the same machine as the QEMU instance.
2430 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2433 # @eject:
2435 # Ejects a device from a removable drive.
2437 # @device:  The name of the device
2439 # @force:   @optional If true, eject regardless of whether the drive is locked.
2440 #           If not specified, the default value is false.
2442 # Returns:  Nothing on success
2443 #           If @device is not a valid block device, DeviceNotFound
2445 # Notes:    Ejecting a device will no media results in success
2447 # Since: 0.14.0
2449 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2452 # @change-vnc-password:
2454 # Change the VNC server password.
2456 # @target:  the new password to use with VNC authentication
2458 # Since: 1.1
2460 # Notes:  An empty password in this command will set the password to the empty
2461 #         string.  Existing clients are unaffected by executing this command.
2463 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2466 # @change:
2468 # This command is multiple commands multiplexed together.
2470 # @device: This is normally the name of a block device but it may also be 'vnc'.
2471 #          when it's 'vnc', then sub command depends on @target
2473 # @target: If @device is a block device, then this is the new filename.
2474 #          If @device is 'vnc', then if the value 'password' selects the vnc
2475 #          change password command.   Otherwise, this specifies a new server URI
2476 #          address to listen to for VNC connections.
2478 # @arg:    If @device is a block device, then this is an optional format to open
2479 #          the device with.
2480 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2481 #          password to set.  If this argument is an empty string, then no future
2482 #          logins will be allowed.
2484 # Returns: Nothing on success.
2485 #          If @device is not a valid block device, DeviceNotFound
2486 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2487 #          if this error is returned, the device has been opened successfully
2488 #          and an additional call to @block_passwd is required to set the
2489 #          device's password.  The behavior of reads and writes to the block
2490 #          device between when these calls are executed is undefined.
2492 # Notes:  It is strongly recommended that this interface is not used especially
2493 #         for changing block devices.
2495 # Since: 0.14.0
2497 { 'command': 'change',
2498   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2501 # @block_set_io_throttle:
2503 # Change I/O throttle limits for a block drive.
2505 # @device: The name of the device
2507 # @bps: total throughput limit in bytes per second
2509 # @bps_rd: read throughput limit in bytes per second
2511 # @bps_wr: write throughput limit in bytes per second
2513 # @iops: total I/O operations per second
2515 # @ops_rd: read I/O operations per second
2517 # @iops_wr: write I/O operations per second
2519 # @bps_max: #optional total max in bytes (Since 1.7)
2521 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2523 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2525 # @iops_max: #optional total I/O operations max (Since 1.7)
2527 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2529 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2531 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2533 # Returns: Nothing on success
2534 #          If @device is not a valid block device, DeviceNotFound
2536 # Since: 1.1
2538 { 'command': 'block_set_io_throttle',
2539   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2540             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2541             '*bps_max': 'int', '*bps_rd_max': 'int',
2542             '*bps_wr_max': 'int', '*iops_max': 'int',
2543             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2544             '*iops_size': 'int' } }
2547 # @block-stream:
2549 # Copy data from a backing file into a block device.
2551 # The block streaming operation is performed in the background until the entire
2552 # backing file has been copied.  This command returns immediately once streaming
2553 # has started.  The status of ongoing block streaming operations can be checked
2554 # with query-block-jobs.  The operation can be stopped before it has completed
2555 # using the block-job-cancel command.
2557 # If a base file is specified then sectors are not copied from that base file and
2558 # its backing chain.  When streaming completes the image file will have the base
2559 # file as its backing file.  This can be used to stream a subset of the backing
2560 # file chain instead of flattening the entire image.
2562 # On successful completion the image file is updated to drop the backing file
2563 # and the BLOCK_JOB_COMPLETED event is emitted.
2565 # @device: the device name
2567 # @base:   #optional the common backing file name
2569 # @speed:  #optional the maximum speed, in bytes per second
2571 # @on-error: #optional the action to take on an error (default report).
2572 #            'stop' and 'enospc' can only be used if the block device
2573 #            supports io-status (see BlockInfo).  Since 1.3.
2575 # Returns: Nothing on success
2576 #          If @device does not exist, DeviceNotFound
2578 # Since: 1.1
2580 { 'command': 'block-stream',
2581   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2582             '*on-error': 'BlockdevOnError' } }
2585 # @block-job-set-speed:
2587 # Set maximum speed for a background block operation.
2589 # This command can only be issued when there is an active block job.
2591 # Throttling can be disabled by setting the speed to 0.
2593 # @device: the device name
2595 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2596 #          Defaults to 0.
2598 # Returns: Nothing on success
2599 #          If no background operation is active on this device, DeviceNotActive
2601 # Since: 1.1
2603 { 'command': 'block-job-set-speed',
2604   'data': { 'device': 'str', 'speed': 'int' } }
2607 # @block-job-cancel:
2609 # Stop an active background block operation.
2611 # This command returns immediately after marking the active background block
2612 # operation for cancellation.  It is an error to call this command if no
2613 # operation is in progress.
2615 # The operation will cancel as soon as possible and then emit the
2616 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2617 # enumerated using query-block-jobs.
2619 # For streaming, the image file retains its backing file unless the streaming
2620 # operation happens to complete just as it is being cancelled.  A new streaming
2621 # operation can be started at a later time to finish copying all data from the
2622 # backing file.
2624 # @device: the device name
2626 # @force: #optional whether to allow cancellation of a paused job (default
2627 #         false).  Since 1.3.
2629 # Returns: Nothing on success
2630 #          If no background operation is active on this device, DeviceNotActive
2632 # Since: 1.1
2634 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2637 # @block-job-pause:
2639 # Pause an active background block operation.
2641 # This command returns immediately after marking the active background block
2642 # operation for pausing.  It is an error to call this command if no
2643 # operation is in progress.  Pausing an already paused job has no cumulative
2644 # effect; a single block-job-resume command will resume the job.
2646 # The operation will pause as soon as possible.  No event is emitted when
2647 # the operation is actually paused.  Cancelling a paused job automatically
2648 # resumes it.
2650 # @device: the device name
2652 # Returns: Nothing on success
2653 #          If no background operation is active on this device, DeviceNotActive
2655 # Since: 1.3
2657 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2660 # @block-job-resume:
2662 # Resume an active background block operation.
2664 # This command returns immediately after resuming a paused background block
2665 # operation.  It is an error to call this command if no operation is in
2666 # progress.  Resuming an already running job is not an error.
2668 # This command also clears the error status of the job.
2670 # @device: the device name
2672 # Returns: Nothing on success
2673 #          If no background operation is active on this device, DeviceNotActive
2675 # Since: 1.3
2677 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2680 # @block-job-complete:
2682 # Manually trigger completion of an active background block operation.  This
2683 # is supported for drive mirroring, where it also switches the device to
2684 # write to the target path only.  The ability to complete is signaled with
2685 # a BLOCK_JOB_READY event.
2687 # This command completes an active background block operation synchronously.
2688 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2689 # is not defined.  Note that if an I/O error occurs during the processing of
2690 # this command: 1) the command itself will fail; 2) the error will be processed
2691 # according to the rerror/werror arguments that were specified when starting
2692 # the operation.
2694 # A cancelled or paused job cannot be completed.
2696 # @device: the device name
2698 # Returns: Nothing on success
2699 #          If no background operation is active on this device, DeviceNotActive
2701 # Since: 1.3
2703 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2706 # @ObjectTypeInfo:
2708 # This structure describes a search result from @qom-list-types
2710 # @name: the type name found in the search
2712 # Since: 1.1
2714 # Notes: This command is experimental and may change syntax in future releases.
2716 { 'type': 'ObjectTypeInfo',
2717   'data': { 'name': 'str' } }
2720 # @qom-list-types:
2722 # This command will return a list of types given search parameters
2724 # @implements: if specified, only return types that implement this type name
2726 # @abstract: if true, include abstract types in the results
2728 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2730 # Since: 1.1
2732 { 'command': 'qom-list-types',
2733   'data': { '*implements': 'str', '*abstract': 'bool' },
2734   'returns': [ 'ObjectTypeInfo' ] }
2737 # @DevicePropertyInfo:
2739 # Information about device properties.
2741 # @name: the name of the property
2742 # @type: the typename of the property
2744 # Since: 1.2
2746 { 'type': 'DevicePropertyInfo',
2747   'data': { 'name': 'str', 'type': 'str' } }
2750 # @device-list-properties:
2752 # List properties associated with a device.
2754 # @typename: the type name of a device
2756 # Returns: a list of DevicePropertyInfo describing a devices properties
2758 # Since: 1.2
2760 { 'command': 'device-list-properties',
2761   'data': { 'typename': 'str'},
2762   'returns': [ 'DevicePropertyInfo' ] }
2765 # @migrate
2767 # Migrates the current running guest to another Virtual Machine.
2769 # @uri: the Uniform Resource Identifier of the destination VM
2771 # @blk: #optional do block migration (full disk copy)
2773 # @inc: #optional incremental disk copy migration
2775 # @detach: this argument exists only for compatibility reasons and
2776 #          is ignored by QEMU
2778 # Returns: nothing on success
2780 # Since: 0.14.0
2782 { 'command': 'migrate',
2783   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2785 # @xen-save-devices-state:
2787 # Save the state of all devices to file. The RAM and the block devices
2788 # of the VM are not saved by this command.
2790 # @filename: the file to save the state of the devices to as binary
2791 # data. See xen-save-devices-state.txt for a description of the binary
2792 # format.
2794 # Returns: Nothing on success
2796 # Since: 1.1
2798 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2801 # @xen-set-global-dirty-log
2803 # Enable or disable the global dirty log mode.
2805 # @enable: true to enable, false to disable.
2807 # Returns: nothing
2809 # Since: 1.3
2811 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2814 # @device_del:
2816 # Remove a device from a guest
2818 # @id: the name of the device
2820 # Returns: Nothing on success
2821 #          If @id is not a valid device, DeviceNotFound
2823 # Notes: When this command completes, the device may not be removed from the
2824 #        guest.  Hot removal is an operation that requires guest cooperation.
2825 #        This command merely requests that the guest begin the hot removal
2826 #        process.  Completion of the device removal process is signaled with a
2827 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2828 #        for all devices.
2830 # Since: 0.14.0
2832 { 'command': 'device_del', 'data': {'id': 'str'} }
2835 # @DumpGuestMemoryFormat:
2837 # An enumeration of guest-memory-dump's format.
2839 # @elf: elf format
2841 # @kdump-zlib: kdump-compressed format with zlib-compressed
2843 # @kdump-lzo: kdump-compressed format with lzo-compressed
2845 # @kdump-snappy: kdump-compressed format with snappy-compressed
2847 # Since: 2.0
2849 { 'enum': 'DumpGuestMemoryFormat',
2850   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
2853 # @dump-guest-memory
2855 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2856 # very long depending on the amount of guest memory. This command is only
2857 # supported on i386 and x86_64.
2859 # @paging: if true, do paging to get guest's memory mapping. This allows
2860 #          using gdb to process the core file.
2862 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2863 #                     of RAM. This can happen for a large guest, or a
2864 #                     malicious guest pretending to be large.
2866 #          Also, paging=true has the following limitations:
2868 #             1. The guest may be in a catastrophic state or can have corrupted
2869 #                memory, which cannot be trusted
2870 #             2. The guest can be in real-mode even if paging is enabled. For
2871 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2872 #                goes in real-mode
2874 # @protocol: the filename or file descriptor of the vmcore. The supported
2875 #            protocols are:
2877 #            1. file: the protocol starts with "file:", and the following
2878 #               string is the file's path.
2879 #            2. fd: the protocol starts with "fd:", and the following string
2880 #               is the fd's name.
2882 # @begin: #optional if specified, the starting physical address.
2884 # @length: #optional if specified, the memory size, in bytes. If you don't
2885 #          want to dump all guest's memory, please specify the start @begin
2886 #          and @length
2888 # @format: #optional if specified, the format of guest memory dump. But non-elf
2889 #          format is conflict with paging and filter, ie. @paging, @begin and
2890 #          @length is not allowed to be specified with non-elf @format at the
2891 #          same time (since 2.0)
2893 # Returns: nothing on success
2895 # Since: 1.2
2897 { 'command': 'dump-guest-memory',
2898   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2899             '*length': 'int', '*format': 'DumpGuestMemoryFormat' } }
2902 # @DumpGuestMemoryCapability:
2904 # A list of the available formats for dump-guest-memory
2906 # Since: 2.0
2908 { 'type': 'DumpGuestMemoryCapability',
2909   'data': {
2910       'formats': ['DumpGuestMemoryFormat'] } }
2913 # @query-dump-guest-memory-capability:
2915 # Returns the available formats for dump-guest-memory
2917 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
2918 #           dump-guest-memory
2920 # Since: 2.0
2922 { 'command': 'query-dump-guest-memory-capability',
2923   'returns': 'DumpGuestMemoryCapability' }
2926 # @netdev_add:
2928 # Add a network backend.
2930 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2931 #        'vde', 'socket', 'dump' and 'bridge'
2933 # @id: the name of the new network backend
2935 # @props: #optional a list of properties to be passed to the backend in
2936 #         the format 'name=value', like 'ifname=tap0,script=no'
2938 # Notes: The semantics of @props is not well defined.  Future commands will be
2939 #        introduced that provide stronger typing for backend creation.
2941 # Since: 0.14.0
2943 # Returns: Nothing on success
2944 #          If @type is not a valid network backend, DeviceNotFound
2946 { 'command': 'netdev_add',
2947   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2948   'gen': 'no' }
2951 # @netdev_del:
2953 # Remove a network backend.
2955 # @id: the name of the network backend to remove
2957 # Returns: Nothing on success
2958 #          If @id is not a valid network backend, DeviceNotFound
2960 # Since: 0.14.0
2962 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2965 # @object-add:
2967 # Create a QOM object.
2969 # @qom-type: the class name for the object to be created
2971 # @id: the name of the new object
2973 # @props: #optional a dictionary of properties to be passed to the backend
2975 # Returns: Nothing on success
2976 #          Error if @qom-type is not a valid class name
2978 # Since: 2.0
2980 { 'command': 'object-add',
2981   'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
2982   'gen': 'no' }
2985 # @object-del:
2987 # Remove a QOM object.
2989 # @id: the name of the QOM object to remove
2991 # Returns: Nothing on success
2992 #          Error if @id is not a valid id for a QOM object
2994 # Since: 2.0
2996 { 'command': 'object-del', 'data': {'id': 'str'} }
2999 # @NetdevNoneOptions
3001 # Use it alone to have zero network devices.
3003 # Since 1.2
3005 { 'type': 'NetdevNoneOptions',
3006   'data': { } }
3009 # @NetLegacyNicOptions
3011 # Create a new Network Interface Card.
3013 # @netdev: #optional id of -netdev to connect to
3015 # @macaddr: #optional MAC address
3017 # @model: #optional device model (e1000, rtl8139, virtio etc.)
3019 # @addr: #optional PCI device address
3021 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
3023 # Since 1.2
3025 { 'type': 'NetLegacyNicOptions',
3026   'data': {
3027     '*netdev':  'str',
3028     '*macaddr': 'str',
3029     '*model':   'str',
3030     '*addr':    'str',
3031     '*vectors': 'uint32' } }
3034 # @String
3036 # A fat type wrapping 'str', to be embedded in lists.
3038 # Since 1.2
3040 { 'type': 'String',
3041   'data': {
3042     'str': 'str' } }
3045 # @NetdevUserOptions
3047 # Use the user mode network stack which requires no administrator privilege to
3048 # run.
3050 # @hostname: #optional client hostname reported by the builtin DHCP server
3052 # @restrict: #optional isolate the guest from the host
3054 # @ip: #optional legacy parameter, use net= instead
3056 # @net: #optional IP address and optional netmask
3058 # @host: #optional guest-visible address of the host
3060 # @tftp: #optional root directory of the built-in TFTP server
3062 # @bootfile: #optional BOOTP filename, for use with tftp=
3064 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
3065 #             assign
3067 # @dns: #optional guest-visible address of the virtual nameserver
3069 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
3070 #             to the guest
3072 # @smb: #optional root directory of the built-in SMB server
3074 # @smbserver: #optional IP address of the built-in SMB server
3076 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
3077 #           endpoints
3079 # @guestfwd: #optional forward guest TCP connections
3081 # Since 1.2
3083 { 'type': 'NetdevUserOptions',
3084   'data': {
3085     '*hostname':  'str',
3086     '*restrict':  'bool',
3087     '*ip':        'str',
3088     '*net':       'str',
3089     '*host':      'str',
3090     '*tftp':      'str',
3091     '*bootfile':  'str',
3092     '*dhcpstart': 'str',
3093     '*dns':       'str',
3094     '*dnssearch': ['String'],
3095     '*smb':       'str',
3096     '*smbserver': 'str',
3097     '*hostfwd':   ['String'],
3098     '*guestfwd':  ['String'] } }
3101 # @NetdevTapOptions
3103 # Connect the host TAP network interface name to the VLAN.
3105 # @ifname: #optional interface name
3107 # @fd: #optional file descriptor of an already opened tap
3109 # @fds: #optional multiple file descriptors of already opened multiqueue capable
3110 # tap
3112 # @script: #optional script to initialize the interface
3114 # @downscript: #optional script to shut down the interface
3116 # @helper: #optional command to execute to configure bridge
3118 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3120 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3122 # @vhost: #optional enable vhost-net network accelerator
3124 # @vhostfd: #optional file descriptor of an already opened vhost net device
3126 # @vhostfds: #optional file descriptors of multiple already opened vhost net
3127 # devices
3129 # @vhostforce: #optional vhost on for non-MSIX virtio guests
3131 # @queues: #optional number of queues to be created for multiqueue capable tap
3133 # Since 1.2
3135 { 'type': 'NetdevTapOptions',
3136   'data': {
3137     '*ifname':     'str',
3138     '*fd':         'str',
3139     '*fds':        'str',
3140     '*script':     'str',
3141     '*downscript': 'str',
3142     '*helper':     'str',
3143     '*sndbuf':     'size',
3144     '*vnet_hdr':   'bool',
3145     '*vhost':      'bool',
3146     '*vhostfd':    'str',
3147     '*vhostfds':   'str',
3148     '*vhostforce': 'bool',
3149     '*queues':     'uint32'} }
3152 # @NetdevSocketOptions
3154 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3155 # socket connection.
3157 # @fd: #optional file descriptor of an already opened socket
3159 # @listen: #optional port number, and optional hostname, to listen on
3161 # @connect: #optional port number, and optional hostname, to connect to
3163 # @mcast: #optional UDP multicast address and port number
3165 # @localaddr: #optional source address and port for multicast and udp packets
3167 # @udp: #optional UDP unicast address and port number
3169 # Since 1.2
3171 { 'type': 'NetdevSocketOptions',
3172   'data': {
3173     '*fd':        'str',
3174     '*listen':    'str',
3175     '*connect':   'str',
3176     '*mcast':     'str',
3177     '*localaddr': 'str',
3178     '*udp':       'str' } }
3181 # @NetdevVdeOptions
3183 # Connect the VLAN to a vde switch running on the host.
3185 # @sock: #optional socket path
3187 # @port: #optional port number
3189 # @group: #optional group owner of socket
3191 # @mode: #optional permissions for socket
3193 # Since 1.2
3195 { 'type': 'NetdevVdeOptions',
3196   'data': {
3197     '*sock':  'str',
3198     '*port':  'uint16',
3199     '*group': 'str',
3200     '*mode':  'uint16' } }
3203 # @NetdevDumpOptions
3205 # Dump VLAN network traffic to a file.
3207 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3208 # suffixes.
3210 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3212 # Since 1.2
3214 { 'type': 'NetdevDumpOptions',
3215   'data': {
3216     '*len':  'size',
3217     '*file': 'str' } }
3220 # @NetdevBridgeOptions
3222 # Connect a host TAP network interface to a host bridge device.
3224 # @br: #optional bridge name
3226 # @helper: #optional command to execute to configure bridge
3228 # Since 1.2
3230 { 'type': 'NetdevBridgeOptions',
3231   'data': {
3232     '*br':     'str',
3233     '*helper': 'str' } }
3236 # @NetdevHubPortOptions
3238 # Connect two or more net clients through a software hub.
3240 # @hubid: hub identifier number
3242 # Since 1.2
3244 { 'type': 'NetdevHubPortOptions',
3245   'data': {
3246     'hubid':     'int32' } }
3249 # @NetdevNetmapOptions
3251 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3253 # @ifname: Either the name of an existing network interface supported by
3254 #          netmap, or the name of a VALE port (created on the fly).
3255 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3256 #          YYY are non-negative integers. XXX identifies a switch and
3257 #          YYY identifies a port of the switch. VALE ports having the
3258 #          same XXX are therefore connected to the same switch.
3260 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3262 # Since 2.0
3264 { 'type': 'NetdevNetmapOptions',
3265   'data': {
3266     'ifname':     'str',
3267     '*devname':    'str' } }
3270 # @NetClientOptions
3272 # A discriminated record of network device traits.
3274 # Since 1.2
3276 { 'union': 'NetClientOptions',
3277   'data': {
3278     'none':     'NetdevNoneOptions',
3279     'nic':      'NetLegacyNicOptions',
3280     'user':     'NetdevUserOptions',
3281     'tap':      'NetdevTapOptions',
3282     'socket':   'NetdevSocketOptions',
3283     'vde':      'NetdevVdeOptions',
3284     'dump':     'NetdevDumpOptions',
3285     'bridge':   'NetdevBridgeOptions',
3286     'hubport':  'NetdevHubPortOptions',
3287     'netmap':   'NetdevNetmapOptions' } }
3290 # @NetLegacy
3292 # Captures the configuration of a network device; legacy.
3294 # @vlan: #optional vlan number
3296 # @id: #optional identifier for monitor commands
3298 # @name: #optional identifier for monitor commands, ignored if @id is present
3300 # @opts: device type specific properties (legacy)
3302 # Since 1.2
3304 { 'type': 'NetLegacy',
3305   'data': {
3306     '*vlan': 'int32',
3307     '*id':   'str',
3308     '*name': 'str',
3309     'opts':  'NetClientOptions' } }
3312 # @Netdev
3314 # Captures the configuration of a network device.
3316 # @id: identifier for monitor commands.
3318 # @opts: device type specific properties
3320 # Since 1.2
3322 { 'type': 'Netdev',
3323   'data': {
3324     'id':   'str',
3325     'opts': 'NetClientOptions' } }
3328 # @InetSocketAddress
3330 # Captures a socket address or address range in the Internet namespace.
3332 # @host: host part of the address
3334 # @port: port part of the address, or lowest port if @to is present
3336 # @to: highest port to try
3338 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3339 #        #optional
3341 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3342 #        #optional
3344 # Since 1.3
3346 { 'type': 'InetSocketAddress',
3347   'data': {
3348     'host': 'str',
3349     'port': 'str',
3350     '*to': 'uint16',
3351     '*ipv4': 'bool',
3352     '*ipv6': 'bool' } }
3355 # @UnixSocketAddress
3357 # Captures a socket address in the local ("Unix socket") namespace.
3359 # @path: filesystem path to use
3361 # Since 1.3
3363 { 'type': 'UnixSocketAddress',
3364   'data': {
3365     'path': 'str' } }
3368 # @SocketAddress
3370 # Captures the address of a socket, which could also be a named file descriptor
3372 # Since 1.3
3374 { 'union': 'SocketAddress',
3375   'data': {
3376     'inet': 'InetSocketAddress',
3377     'unix': 'UnixSocketAddress',
3378     'fd': 'String' } }
3381 # @getfd:
3383 # Receive a file descriptor via SCM rights and assign it a name
3385 # @fdname: file descriptor name
3387 # Returns: Nothing on success
3389 # Since: 0.14.0
3391 # Notes: If @fdname already exists, the file descriptor assigned to
3392 #        it will be closed and replaced by the received file
3393 #        descriptor.
3394 #        The 'closefd' command can be used to explicitly close the
3395 #        file descriptor when it is no longer needed.
3397 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3400 # @closefd:
3402 # Close a file descriptor previously passed via SCM rights
3404 # @fdname: file descriptor name
3406 # Returns: Nothing on success
3408 # Since: 0.14.0
3410 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3413 # @MachineInfo:
3415 # Information describing a machine.
3417 # @name: the name of the machine
3419 # @alias: #optional an alias for the machine name
3421 # @default: #optional whether the machine is default
3423 # @cpu-max: maximum number of CPUs supported by the machine type
3424 #           (since 1.5.0)
3426 # Since: 1.2.0
3428 { 'type': 'MachineInfo',
3429   'data': { 'name': 'str', '*alias': 'str',
3430             '*is-default': 'bool', 'cpu-max': 'int' } }
3433 # @query-machines:
3435 # Return a list of supported machines
3437 # Returns: a list of MachineInfo
3439 # Since: 1.2.0
3441 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3444 # @CpuDefinitionInfo:
3446 # Virtual CPU definition.
3448 # @name: the name of the CPU definition
3450 # Since: 1.2.0
3452 { 'type': 'CpuDefinitionInfo',
3453   'data': { 'name': 'str' } }
3456 # @query-cpu-definitions:
3458 # Return a list of supported virtual CPU definitions
3460 # Returns: a list of CpuDefInfo
3462 # Since: 1.2.0
3464 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3466 # @AddfdInfo:
3468 # Information about a file descriptor that was added to an fd set.
3470 # @fdset-id: The ID of the fd set that @fd was added to.
3472 # @fd: The file descriptor that was received via SCM rights and
3473 #      added to the fd set.
3475 # Since: 1.2.0
3477 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3480 # @add-fd:
3482 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3484 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3486 # @opaque: #optional A free-form string that can be used to describe the fd.
3488 # Returns: @AddfdInfo on success
3489 #          If file descriptor was not received, FdNotSupplied
3490 #          If @fdset-id is a negative value, InvalidParameterValue
3492 # Notes: The list of fd sets is shared by all monitor connections.
3494 #        If @fdset-id is not specified, a new fd set will be created.
3496 # Since: 1.2.0
3498 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3499   'returns': 'AddfdInfo' }
3502 # @remove-fd:
3504 # Remove a file descriptor from an fd set.
3506 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3508 # @fd: #optional The file descriptor that is to be removed.
3510 # Returns: Nothing on success
3511 #          If @fdset-id or @fd is not found, FdNotFound
3513 # Since: 1.2.0
3515 # Notes: The list of fd sets is shared by all monitor connections.
3517 #        If @fd is not specified, all file descriptors in @fdset-id
3518 #        will be removed.
3520 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3523 # @FdsetFdInfo:
3525 # Information about a file descriptor that belongs to an fd set.
3527 # @fd: The file descriptor value.
3529 # @opaque: #optional A free-form string that can be used to describe the fd.
3531 # Since: 1.2.0
3533 { 'type': 'FdsetFdInfo',
3534   'data': {'fd': 'int', '*opaque': 'str'} }
3537 # @FdsetInfo:
3539 # Information about an fd set.
3541 # @fdset-id: The ID of the fd set.
3543 # @fds: A list of file descriptors that belong to this fd set.
3545 # Since: 1.2.0
3547 { 'type': 'FdsetInfo',
3548   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3551 # @query-fdsets:
3553 # Return information describing all fd sets.
3555 # Returns: A list of @FdsetInfo
3557 # Since: 1.2.0
3559 # Note: The list of fd sets is shared by all monitor connections.
3562 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3565 # @TargetInfo:
3567 # Information describing the QEMU target.
3569 # @arch: the target architecture (eg "x86_64", "i386", etc)
3571 # Since: 1.2.0
3573 { 'type': 'TargetInfo',
3574   'data': { 'arch': 'str' } }
3577 # @query-target:
3579 # Return information about the target for this QEMU
3581 # Returns: TargetInfo
3583 # Since: 1.2.0
3585 { 'command': 'query-target', 'returns': 'TargetInfo' }
3588 # @QKeyCode:
3590 # An enumeration of key name.
3592 # This is used by the send-key command.
3594 # Since: 1.3.0
3596 # 'unmapped' and 'pause' since 2.0
3598 { 'enum': 'QKeyCode',
3599   'data': [ 'unmapped',
3600             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3601             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3602             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3603             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3604             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3605             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3606             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3607             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3608             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3609             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3610             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3611             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3612             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3613             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3614              'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause' ] }
3617 # @KeyValue
3619 # Represents a keyboard key.
3621 # Since: 1.3.0
3623 { 'union': 'KeyValue',
3624   'data': {
3625     'number': 'int',
3626     'qcode': 'QKeyCode' } }
3629 # @send-key:
3631 # Send keys to guest.
3633 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3634 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3635 #        directly to the guest, while @KeyValue.qcode must be a valid
3636 #        @QKeyCode value
3638 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3639 #             to 100
3641 # Returns: Nothing on success
3642 #          If key is unknown or redundant, InvalidParameter
3644 # Since: 1.3.0
3647 { 'command': 'send-key',
3648   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3651 # @screendump:
3653 # Write a PPM of the VGA screen to a file.
3655 # @filename: the path of a new PPM file to store the image
3657 # Returns: Nothing on success
3659 # Since: 0.14.0
3661 { 'command': 'screendump', 'data': {'filename': 'str'} }
3664 # @nbd-server-start:
3666 # Start an NBD server listening on the given host and port.  Block
3667 # devices can then be exported using @nbd-server-add.  The NBD
3668 # server will present them as named exports; for example, another
3669 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3671 # @addr: Address on which to listen.
3673 # Returns: error if the server is already running.
3675 # Since: 1.3.0
3677 { 'command': 'nbd-server-start',
3678   'data': { 'addr': 'SocketAddress' } }
3681 # @nbd-server-add:
3683 # Export a device to QEMU's embedded NBD server.
3685 # @device: Block device to be exported
3687 # @writable: Whether clients should be able to write to the device via the
3688 #     NBD connection (default false). #optional
3690 # Returns: error if the device is already marked for export.
3692 # Since: 1.3.0
3694 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3697 # @nbd-server-stop:
3699 # Stop QEMU's embedded NBD server, and unregister all devices previously
3700 # added via @nbd-server-add.
3702 # Since: 1.3.0
3704 { 'command': 'nbd-server-stop' }
3707 # @ChardevFile:
3709 # Configuration info for file chardevs.
3711 # @in:  #optional The name of the input file
3712 # @out: The name of the output file
3714 # Since: 1.4
3716 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3717                                    'out' : 'str' } }
3720 # @ChardevHostdev:
3722 # Configuration info for device and pipe chardevs.
3724 # @device: The name of the special file for the device,
3725 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3726 # @type: What kind of device this is.
3728 # Since: 1.4
3730 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3733 # @ChardevSocket:
3735 # Configuration info for (stream) socket chardevs.
3737 # @addr: socket address to listen on (server=true)
3738 #        or connect to (server=false)
3739 # @server: #optional create server socket (default: true)
3740 # @wait: #optional wait for incoming connection on server
3741 #        sockets (default: false).
3742 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3743 # @telnet: #optional enable telnet protocol on server
3744 #          sockets (default: false)
3746 # Since: 1.4
3748 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3749                                      '*server'  : 'bool',
3750                                      '*wait'    : 'bool',
3751                                      '*nodelay' : 'bool',
3752                                      '*telnet'  : 'bool' } }
3755 # @ChardevUdp:
3757 # Configuration info for datagram socket chardevs.
3759 # @remote: remote address
3760 # @local: #optional local address
3762 # Since: 1.5
3764 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3765                                   '*local' : 'SocketAddress' } }
3768 # @ChardevMux:
3770 # Configuration info for mux chardevs.
3772 # @chardev: name of the base chardev.
3774 # Since: 1.5
3776 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3779 # @ChardevStdio:
3781 # Configuration info for stdio chardevs.
3783 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3784 #          be delivered to qemu.  Default: true in -nographic mode,
3785 #          false otherwise.
3787 # Since: 1.5
3789 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3792 # @ChardevSpiceChannel:
3794 # Configuration info for spice vm channel chardevs.
3796 # @type: kind of channel (for example vdagent).
3798 # Since: 1.5
3800 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3803 # @ChardevSpicePort:
3805 # Configuration info for spice port chardevs.
3807 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3809 # Since: 1.5
3811 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3814 # @ChardevVC:
3816 # Configuration info for virtual console chardevs.
3818 # @width:  console width,  in pixels
3819 # @height: console height, in pixels
3820 # @cols:   console width,  in chars
3821 # @rows:   console height, in chars
3823 # Since: 1.5
3825 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3826                                  '*height' : 'int',
3827                                  '*cols'   : 'int',
3828                                  '*rows'   : 'int' } }
3831 # @ChardevRingbuf:
3833 # Configuration info for ring buffer chardevs.
3835 # @size: #optional ring buffer size, must be power of two, default is 65536
3837 # Since: 1.5
3839 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3842 # @ChardevBackend:
3844 # Configuration info for the new chardev backend.
3846 # Since: 1.4
3848 { 'type': 'ChardevDummy', 'data': { } }
3850 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3851                                        'serial' : 'ChardevHostdev',
3852                                        'parallel': 'ChardevHostdev',
3853                                        'pipe'   : 'ChardevHostdev',
3854                                        'socket' : 'ChardevSocket',
3855                                        'udp'    : 'ChardevUdp',
3856                                        'pty'    : 'ChardevDummy',
3857                                        'null'   : 'ChardevDummy',
3858                                        'mux'    : 'ChardevMux',
3859                                        'msmouse': 'ChardevDummy',
3860                                        'braille': 'ChardevDummy',
3861                                        'stdio'  : 'ChardevStdio',
3862                                        'console': 'ChardevDummy',
3863                                        'spicevmc' : 'ChardevSpiceChannel',
3864                                        'spiceport' : 'ChardevSpicePort',
3865                                        'vc'     : 'ChardevVC',
3866                                        'ringbuf': 'ChardevRingbuf',
3867                                        # next one is just for compatibility
3868                                        'memory' : 'ChardevRingbuf' } }
3871 # @ChardevReturn:
3873 # Return info about the chardev backend just created.
3875 # @pty: #optional name of the slave pseudoterminal device, present if
3876 #       and only if a chardev of type 'pty' was created
3878 # Since: 1.4
3880 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3883 # @chardev-add:
3885 # Add a character device backend
3887 # @id: the chardev's ID, must be unique
3888 # @backend: backend type and parameters
3890 # Returns: ChardevReturn.
3892 # Since: 1.4
3894 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3895                                      'backend' : 'ChardevBackend' },
3896   'returns': 'ChardevReturn' }
3899 # @chardev-remove:
3901 # Remove a character device backend
3903 # @id: the chardev's ID, must exist and not be in use
3905 # Returns: Nothing on success
3907 # Since: 1.4
3909 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3912 # @TpmModel:
3914 # An enumeration of TPM models
3916 # @tpm-tis: TPM TIS model
3918 # Since: 1.5
3920 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3923 # @query-tpm-models:
3925 # Return a list of supported TPM models
3927 # Returns: a list of TpmModel
3929 # Since: 1.5
3931 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3934 # @TpmType:
3936 # An enumeration of TPM types
3938 # @passthrough: TPM passthrough type
3940 # Since: 1.5
3942 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3945 # @query-tpm-types:
3947 # Return a list of supported TPM types
3949 # Returns: a list of TpmType
3951 # Since: 1.5
3953 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3956 # @TPMPassthroughOptions:
3958 # Information about the TPM passthrough type
3960 # @path: #optional string describing the path used for accessing the TPM device
3962 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3963 #               for cancellation of TPM commands while they are executing
3965 # Since: 1.5
3967 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3968                                              '*cancel-path' : 'str'} }
3971 # @TpmTypeOptions:
3973 # A union referencing different TPM backend types' configuration options
3975 # @passthrough: The configuration options for the TPM passthrough type
3977 # Since: 1.5
3979 { 'union': 'TpmTypeOptions',
3980    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3983 # @TpmInfo:
3985 # Information about the TPM
3987 # @id: The Id of the TPM
3989 # @model: The TPM frontend model
3991 # @options: The TPM (backend) type configuration options
3993 # Since: 1.5
3995 { 'type': 'TPMInfo',
3996   'data': {'id': 'str',
3997            'model': 'TpmModel',
3998            'options': 'TpmTypeOptions' } }
4001 # @query-tpm:
4003 # Return information about the TPM device
4005 # Returns: @TPMInfo on success
4007 # Since: 1.5
4009 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
4012 # @AcpiTableOptions
4014 # Specify an ACPI table on the command line to load.
4016 # At most one of @file and @data can be specified. The list of files specified
4017 # by any one of them is loaded and concatenated in order. If both are omitted,
4018 # @data is implied.
4020 # Other fields / optargs can be used to override fields of the generic ACPI
4021 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
4022 # Description Table Header. If a header field is not overridden, then the
4023 # corresponding value from the concatenated blob is used (in case of @file), or
4024 # it is filled in with a hard-coded value (in case of @data).
4026 # String fields are copied into the matching ACPI member from lowest address
4027 # upwards, and silently truncated / NUL-padded to length.
4029 # @sig: #optional table signature / identifier (4 bytes)
4031 # @rev: #optional table revision number (dependent on signature, 1 byte)
4033 # @oem_id: #optional OEM identifier (6 bytes)
4035 # @oem_table_id: #optional OEM table identifier (8 bytes)
4037 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
4039 # @asl_compiler_id: #optional identifier of the utility that created the table
4040 #                   (4 bytes)
4042 # @asl_compiler_rev: #optional revision number of the utility that created the
4043 #                    table (4 bytes)
4045 # @file: #optional colon (:) separated list of pathnames to load and
4046 #        concatenate as table data. The resultant binary blob is expected to
4047 #        have an ACPI table header. At least one file is required. This field
4048 #        excludes @data.
4050 # @data: #optional colon (:) separated list of pathnames to load and
4051 #        concatenate as table data. The resultant binary blob must not have an
4052 #        ACPI table header. At least one file is required. This field excludes
4053 #        @file.
4055 # Since 1.5
4057 { 'type': 'AcpiTableOptions',
4058   'data': {
4059     '*sig':               'str',
4060     '*rev':               'uint8',
4061     '*oem_id':            'str',
4062     '*oem_table_id':      'str',
4063     '*oem_rev':           'uint32',
4064     '*asl_compiler_id':   'str',
4065     '*asl_compiler_rev':  'uint32',
4066     '*file':              'str',
4067     '*data':              'str' }}
4070 # @CommandLineParameterType:
4072 # Possible types for an option parameter.
4074 # @string: accepts a character string
4076 # @boolean: accepts "on" or "off"
4078 # @number: accepts a number
4080 # @size: accepts a number followed by an optional suffix (K)ilo,
4081 #        (M)ega, (G)iga, (T)era
4083 # Since 1.5
4085 { 'enum': 'CommandLineParameterType',
4086   'data': ['string', 'boolean', 'number', 'size'] }
4089 # @CommandLineParameterInfo:
4091 # Details about a single parameter of a command line option.
4093 # @name: parameter name
4095 # @type: parameter @CommandLineParameterType
4097 # @help: #optional human readable text string, not suitable for parsing.
4099 # Since 1.5
4101 { 'type': 'CommandLineParameterInfo',
4102   'data': { 'name': 'str',
4103             'type': 'CommandLineParameterType',
4104             '*help': 'str' } }
4107 # @CommandLineOptionInfo:
4109 # Details about a command line option, including its list of parameter details
4111 # @option: option name
4113 # @parameters: an array of @CommandLineParameterInfo
4115 # Since 1.5
4117 { 'type': 'CommandLineOptionInfo',
4118   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
4121 # @query-command-line-options:
4123 # Query command line option schema.
4125 # @option: #optional option name
4127 # Returns: list of @CommandLineOptionInfo for all options (or for the given
4128 #          @option).  Returns an error if the given @option doesn't exist.
4130 # Since 1.5
4132 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
4133  'returns': ['CommandLineOptionInfo'] }
4136 # @X86CPURegister32
4138 # A X86 32-bit register
4140 # Since: 1.5
4142 { 'enum': 'X86CPURegister32',
4143   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
4146 # @X86CPUFeatureWordInfo
4148 # Information about a X86 CPU feature word
4150 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
4152 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
4153 #                   feature word
4155 # @cpuid-register: Output register containing the feature bits
4157 # @features: value of output register, containing the feature bits
4159 # Since: 1.5
4161 { 'type': 'X86CPUFeatureWordInfo',
4162   'data': { 'cpuid-input-eax': 'int',
4163             '*cpuid-input-ecx': 'int',
4164             'cpuid-register': 'X86CPURegister32',
4165             'features': 'int' } }
4168 # @RxState:
4170 # Packets receiving state
4172 # @normal: filter assigned packets according to the mac-table
4174 # @none: don't receive any assigned packet
4176 # @all: receive all assigned packets
4178 # Since: 1.6
4180 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4183 # @RxFilterInfo:
4185 # Rx-filter information for a NIC.
4187 # @name: net client name
4189 # @promiscuous: whether promiscuous mode is enabled
4191 # @multicast: multicast receive state
4193 # @unicast: unicast receive state
4195 # @vlan: vlan receive state (Since 2.0)
4197 # @broadcast-allowed: whether to receive broadcast
4199 # @multicast-overflow: multicast table is overflowed or not
4201 # @unicast-overflow: unicast table is overflowed or not
4203 # @main-mac: the main macaddr string
4205 # @vlan-table: a list of active vlan id
4207 # @unicast-table: a list of unicast macaddr string
4209 # @multicast-table: a list of multicast macaddr string
4211 # Since 1.6
4214 { 'type': 'RxFilterInfo',
4215   'data': {
4216     'name':               'str',
4217     'promiscuous':        'bool',
4218     'multicast':          'RxState',
4219     'unicast':            'RxState',
4220     'vlan':               'RxState',
4221     'broadcast-allowed':  'bool',
4222     'multicast-overflow': 'bool',
4223     'unicast-overflow':   'bool',
4224     'main-mac':           'str',
4225     'vlan-table':         ['int'],
4226     'unicast-table':      ['str'],
4227     'multicast-table':    ['str'] }}
4230 # @query-rx-filter:
4232 # Return rx-filter information for all NICs (or for the given NIC).
4234 # @name: #optional net client name
4236 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4237 #          Returns an error if the given @name doesn't exist, or given
4238 #          NIC doesn't support rx-filter querying, or given net client
4239 #          isn't a NIC.
4241 # Since: 1.6
4243 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4244   'returns': ['RxFilterInfo'] }
4248 # @BlockdevDiscardOptions
4250 # Determines how to handle discard requests.
4252 # @ignore:      Ignore the request
4253 # @unmap:       Forward as an unmap request
4255 # Since: 1.7
4257 { 'enum': 'BlockdevDiscardOptions',
4258   'data': [ 'ignore', 'unmap' ] }
4261 # @BlockdevDetectZeroesOptions
4263 # Describes the operation mode for the automatic conversion of plain
4264 # zero writes by the OS to driver specific optimized zero write commands.
4266 # @off:      Disabled (default)
4267 # @on:       Enabled
4268 # @unmap:    Enabled and even try to unmap blocks if possible. This requires
4269 #            also that @BlockdevDiscardOptions is set to unmap for this device.
4271 # Since: 2.1
4273 { 'enum': 'BlockdevDetectZeroesOptions',
4274   'data': [ 'off', 'on', 'unmap' ] }
4277 # @BlockdevAioOptions
4279 # Selects the AIO backend to handle I/O requests
4281 # @threads:     Use qemu's thread pool
4282 # @native:      Use native AIO backend (only Linux and Windows)
4284 # Since: 1.7
4286 { 'enum': 'BlockdevAioOptions',
4287   'data': [ 'threads', 'native' ] }
4290 # @BlockdevCacheOptions
4292 # Includes cache-related options for block devices
4294 # @writeback:   #optional enables writeback mode for any caches (default: true)
4295 # @direct:      #optional enables use of O_DIRECT (bypass the host page cache;
4296 #               default: false)
4297 # @no-flush:    #optional ignore any flush requests for the device (default:
4298 #               false)
4300 # Since: 1.7
4302 { 'type': 'BlockdevCacheOptions',
4303   'data': { '*writeback': 'bool',
4304             '*direct': 'bool',
4305             '*no-flush': 'bool' } }
4308 # @BlockdevDriver
4310 # Drivers that are supported in block device operations.
4312 # @host_device, @host_cdrom, @host_floppy: Since 2.1
4314 # Since: 2.0
4316 { 'enum': 'BlockdevDriver',
4317   'data': [ 'file', 'host_device', 'host_cdrom', 'host_floppy',
4318             'http', 'https', 'ftp', 'ftps', 'tftp', 'vvfat', 'blkdebug',
4319             'blkverify', 'bochs', 'cloop', 'cow', 'dmg', 'parallels', 'qcow',
4320             'qcow2', 'qed', 'raw', 'vdi', 'vhdx', 'vmdk', 'vpc', 'quorum' ] }
4323 # @BlockdevOptionsBase
4325 # Options that are available for all block devices, independent of the block
4326 # driver.
4328 # @driver:        block driver name
4329 # @id:            #optional id by which the new block device can be referred to.
4330 #                 This is a required option on the top level of blockdev-add, and
4331 #                 currently not allowed on any other level.
4332 # @node-name:     #optional the name of a block driver state node (Since 2.0)
4333 # @discard:       #optional discard-related options (default: ignore)
4334 # @cache:         #optional cache-related options
4335 # @aio:           #optional AIO backend (default: threads)
4336 # @rerror:        #optional how to handle read errors on the device
4337 #                 (default: report)
4338 # @werror:        #optional how to handle write errors on the device
4339 #                 (default: enospc)
4340 # @read-only:     #optional whether the block device should be read-only
4341 #                 (default: false)
4342 # @detect-zeroes: #optional detect and optimize zero writes (Since 2.1)
4343 #                 (default: off)
4345 # Since: 1.7
4347 { 'type': 'BlockdevOptionsBase',
4348   'data': { 'driver': 'BlockdevDriver',
4349             '*id': 'str',
4350             '*node-name': 'str',
4351             '*discard': 'BlockdevDiscardOptions',
4352             '*cache': 'BlockdevCacheOptions',
4353             '*aio': 'BlockdevAioOptions',
4354             '*rerror': 'BlockdevOnError',
4355             '*werror': 'BlockdevOnError',
4356             '*read-only': 'bool',
4357             '*detect-zeroes': 'BlockdevDetectZeroesOptions' } }
4360 # @BlockdevOptionsFile
4362 # Driver specific block device options for the file backend and similar
4363 # protocols.
4365 # @filename:    path to the image file
4367 # Since: 1.7
4369 { 'type': 'BlockdevOptionsFile',
4370   'data': { 'filename': 'str' } }
4373 # @BlockdevOptionsVVFAT
4375 # Driver specific block device options for the vvfat protocol.
4377 # @dir:         directory to be exported as FAT image
4378 # @fat-type:    #optional FAT type: 12, 16 or 32
4379 # @floppy:      #optional whether to export a floppy image (true) or
4380 #               partitioned hard disk (false; default)
4381 # @rw:          #optional whether to allow write operations (default: false)
4383 # Since: 1.7
4385 { 'type': 'BlockdevOptionsVVFAT',
4386   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4387             '*rw': 'bool' } }
4390 # @BlockdevOptionsGenericFormat
4392 # Driver specific block device options for image format that have no option
4393 # besides their data source.
4395 # @file:        reference to or definition of the data source block device
4397 # Since: 1.7
4399 { 'type': 'BlockdevOptionsGenericFormat',
4400   'data': { 'file': 'BlockdevRef' } }
4403 # @BlockdevOptionsGenericCOWFormat
4405 # Driver specific block device options for image format that have no option
4406 # besides their data source and an optional backing file.
4408 # @backing:     #optional reference to or definition of the backing file block
4409 #               device (if missing, taken from the image file content). It is
4410 #               allowed to pass an empty string here in order to disable the
4411 #               default backing file.
4413 # Since: 1.7
4415 { 'type': 'BlockdevOptionsGenericCOWFormat',
4416   'base': 'BlockdevOptionsGenericFormat',
4417   'data': { '*backing': 'BlockdevRef' } }
4420 # @BlockdevOptionsQcow2
4422 # Driver specific block device options for qcow2.
4424 # @lazy-refcounts:        #optional whether to enable the lazy refcounts
4425 #                         feature (default is taken from the image file)
4427 # @pass-discard-request:  #optional whether discard requests to the qcow2
4428 #                         device should be forwarded to the data source
4430 # @pass-discard-snapshot: #optional whether discard requests for the data source
4431 #                         should be issued when a snapshot operation (e.g.
4432 #                         deleting a snapshot) frees clusters in the qcow2 file
4434 # @pass-discard-other:    #optional whether discard requests for the data source
4435 #                         should be issued on other occasions where a cluster
4436 #                         gets freed
4438 # Since: 1.7
4440 { 'type': 'BlockdevOptionsQcow2',
4441   'base': 'BlockdevOptionsGenericCOWFormat',
4442   'data': { '*lazy-refcounts': 'bool',
4443             '*pass-discard-request': 'bool',
4444             '*pass-discard-snapshot': 'bool',
4445             '*pass-discard-other': 'bool' } }
4448 # @BlkdebugEvent
4450 # Trigger events supported by blkdebug.
4452 { 'enum': 'BlkdebugEvent',
4453   'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
4454             'l1_grow.activate_table', 'l2_load', 'l2_update',
4455             'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
4456             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
4457             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
4458             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
4459             'refblock_load', 'refblock_update', 'refblock_update_part',
4460             'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
4461             'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
4462             'refblock_alloc.switch_table', 'cluster_alloc',
4463             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
4464             'flush_to_disk' ] }
4467 # @BlkdebugInjectErrorOptions
4469 # Describes a single error injection for blkdebug.
4471 # @event:       trigger event
4473 # @state:       #optional the state identifier blkdebug needs to be in to
4474 #               actually trigger the event; defaults to "any"
4476 # @errno:       #optional error identifier (errno) to be returned; defaults to
4477 #               EIO
4479 # @sector:      #optional specifies the sector index which has to be affected
4480 #               in order to actually trigger the event; defaults to "any
4481 #               sector"
4483 # @once:        #optional disables further events after this one has been
4484 #               triggered; defaults to false
4486 # @immediately: #optional fail immediately; defaults to false
4488 # Since: 2.0
4490 { 'type': 'BlkdebugInjectErrorOptions',
4491   'data': { 'event': 'BlkdebugEvent',
4492             '*state': 'int',
4493             '*errno': 'int',
4494             '*sector': 'int',
4495             '*once': 'bool',
4496             '*immediately': 'bool' } }
4499 # @BlkdebugSetStateOptions
4501 # Describes a single state-change event for blkdebug.
4503 # @event:       trigger event
4505 # @state:       #optional the current state identifier blkdebug needs to be in;
4506 #               defaults to "any"
4508 # @new_state:   the state identifier blkdebug is supposed to assume if
4509 #               this event is triggered
4511 # Since: 2.0
4513 { 'type': 'BlkdebugSetStateOptions',
4514   'data': { 'event': 'BlkdebugEvent',
4515             '*state': 'int',
4516             'new_state': 'int' } }
4519 # @BlockdevOptionsBlkdebug
4521 # Driver specific block device options for blkdebug.
4523 # @image:           underlying raw block device (or image file)
4525 # @config:          #optional filename of the configuration file
4527 # @align:           #optional required alignment for requests in bytes
4529 # @inject-error:    #optional array of error injection descriptions
4531 # @set-state:       #optional array of state-change descriptions
4533 # Since: 2.0
4535 { 'type': 'BlockdevOptionsBlkdebug',
4536   'data': { 'image': 'BlockdevRef',
4537             '*config': 'str',
4538             '*align': 'int',
4539             '*inject-error': ['BlkdebugInjectErrorOptions'],
4540             '*set-state': ['BlkdebugSetStateOptions'] } }
4543 # @BlockdevOptionsBlkverify
4545 # Driver specific block device options for blkverify.
4547 # @test:    block device to be tested
4549 # @raw:     raw image used for verification
4551 # Since: 2.0
4553 { 'type': 'BlockdevOptionsBlkverify',
4554   'data': { 'test': 'BlockdevRef',
4555             'raw': 'BlockdevRef' } }
4558 # @BlockdevOptionsQuorum
4560 # Driver specific block device options for Quorum
4562 # @blkverify:      #optional true if the driver must print content mismatch
4563 #                  set to false by default
4565 # @children:       the children block devices to use
4567 # @vote-threshold: the vote limit under which a read will fail
4569 # Since: 2.0
4571 { 'type': 'BlockdevOptionsQuorum',
4572   'data': { '*blkverify': 'bool',
4573             'children': [ 'BlockdevRef' ],
4574             'vote-threshold': 'int' } }
4577 # @BlockdevOptions
4579 # Options for creating a block device.
4581 # Since: 1.7
4583 { 'union': 'BlockdevOptions',
4584   'base': 'BlockdevOptionsBase',
4585   'discriminator': 'driver',
4586   'data': {
4587       'file':       'BlockdevOptionsFile',
4588       'host_device':'BlockdevOptionsFile',
4589       'host_cdrom': 'BlockdevOptionsFile',
4590       'host_floppy':'BlockdevOptionsFile',
4591       'http':       'BlockdevOptionsFile',
4592       'https':      'BlockdevOptionsFile',
4593       'ftp':        'BlockdevOptionsFile',
4594       'ftps':       'BlockdevOptionsFile',
4595       'tftp':       'BlockdevOptionsFile',
4596 # TODO gluster: Wait for structured options
4597 # TODO iscsi: Wait for structured options
4598 # TODO nbd: Should take InetSocketAddress for 'host'?
4599 # TODO nfs: Wait for structured options
4600 # TODO rbd: Wait for structured options
4601 # TODO sheepdog: Wait for structured options
4602 # TODO ssh: Should take InetSocketAddress for 'host'?
4603       'vvfat':      'BlockdevOptionsVVFAT',
4604       'blkdebug':   'BlockdevOptionsBlkdebug',
4605       'blkverify':  'BlockdevOptionsBlkverify',
4606       'bochs':      'BlockdevOptionsGenericFormat',
4607       'cloop':      'BlockdevOptionsGenericFormat',
4608       'cow':        'BlockdevOptionsGenericCOWFormat',
4609       'dmg':        'BlockdevOptionsGenericFormat',
4610       'parallels':  'BlockdevOptionsGenericFormat',
4611       'qcow':       'BlockdevOptionsGenericCOWFormat',
4612       'qcow2':      'BlockdevOptionsQcow2',
4613       'qed':        'BlockdevOptionsGenericCOWFormat',
4614       'raw':        'BlockdevOptionsGenericFormat',
4615       'vdi':        'BlockdevOptionsGenericFormat',
4616       'vhdx':       'BlockdevOptionsGenericFormat',
4617       'vmdk':       'BlockdevOptionsGenericCOWFormat',
4618       'vpc':        'BlockdevOptionsGenericFormat',
4619       'quorum':     'BlockdevOptionsQuorum'
4620   } }
4623 # @BlockdevRef
4625 # Reference to a block device.
4627 # @definition:      defines a new block device inline
4628 # @reference:       references the ID of an existing block device. An
4629 #                   empty string means that no block device should be
4630 #                   referenced.
4632 # Since: 1.7
4634 { 'union': 'BlockdevRef',
4635   'discriminator': {},
4636   'data': { 'definition': 'BlockdevOptions',
4637             'reference': 'str' } }
4640 # @blockdev-add:
4642 # Creates a new block device.
4644 # @options: block device options for the new device
4646 # Since: 1.7
4648 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
4651 # @InputButton
4653 # Button of a pointer input device (mouse, tablet).
4655 # Since: 2.0
4657 { 'enum'  : 'InputButton',
4658   'data'  : [ 'Left', 'Middle', 'Right', 'WheelUp', 'WheelDown' ] }
4661 # @InputButton
4663 # Position axis of a pointer input device (mouse, tablet).
4665 # Since: 2.0
4667 { 'enum'  : 'InputAxis',
4668   'data'  : [ 'X', 'Y' ] }
4671 # @InputKeyEvent
4673 # Keyboard input event.
4675 # @key:    Which key this event is for.
4676 # @down:   True for key-down and false for key-up events.
4678 # Since: 2.0
4680 { 'type'  : 'InputKeyEvent',
4681   'data'  : { 'key'     : 'KeyValue',
4682               'down'    : 'bool' } }
4685 # @InputBtnEvent
4687 # Pointer button input event.
4689 # @button: Which button this event is for.
4690 # @down:   True for key-down and false for key-up events.
4692 # Since: 2.0
4694 { 'type'  : 'InputBtnEvent',
4695   'data'  : { 'button'  : 'InputButton',
4696               'down'    : 'bool' } }
4699 # @InputMoveEvent
4701 # Pointer motion input event.
4703 # @axis:   Which axis is referenced by @value.
4704 # @value:  Pointer position.  For absolute coordinates the
4705 #          valid range is 0 -> 0x7ffff
4707 # Since: 2.0
4709 { 'type'  : 'InputMoveEvent',
4710   'data'  : { 'axis'    : 'InputAxis',
4711               'value'   : 'int' } }
4714 # @InputEvent
4716 # Input event union.
4718 # Since: 2.0
4720 { 'union' : 'InputEvent',
4721   'data'  : { 'key'     : 'InputKeyEvent',
4722               'btn'     : 'InputBtnEvent',
4723               'rel'     : 'InputMoveEvent',
4724               'abs'     : 'InputMoveEvent' } }