xilinx: Inline usages of xilinx_axi*_init()
[qemu.git] / qapi-schema.json
blobfcb2280053518583530a28d613233bfa38f0335f
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 # Since: 0.14.0
656 { 'type': 'MigrationStats',
657   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
658            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
659            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
660            'mbps' : 'number' } }
663 # @XBZRLECacheStats
665 # Detailed XBZRLE migration cache statistics
667 # @cache-size: XBZRLE cache size
669 # @bytes: amount of bytes already transferred to the target VM
671 # @pages: amount of pages transferred to the target VM
673 # @cache-miss: number of cache miss
675 # @overflow: number of overflows
677 # Since: 1.2
679 { 'type': 'XBZRLECacheStats',
680   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
681            'cache-miss': 'int', 'overflow': 'int' } }
684 # @MigrationInfo
686 # Information about current migration process.
688 # @status: #optional string describing the current migration status.
689 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
690 #          'cancelled'. If this field is not returned, no migration process
691 #          has been initiated
693 # @ram: #optional @MigrationStats containing detailed migration
694 #       status, only returned if status is 'active' or
695 #       'completed'. 'comppleted' (since 1.2)
697 # @disk: #optional @MigrationStats containing detailed disk migration
698 #        status, only returned if status is 'active' and it is a block
699 #        migration
701 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
702 #                migration statistics, only returned if XBZRLE feature is on and
703 #                status is 'active' or 'completed' (since 1.2)
705 # @total-time: #optional total amount of milliseconds since migration started.
706 #        If migration has ended, it returns the total migration
707 #        time. (since 1.2)
709 # @downtime: #optional only present when migration finishes correctly
710 #        total downtime in milliseconds for the guest.
711 #        (since 1.3)
713 # @expected-downtime: #optional only present while migration is active
714 #        expected downtime in milliseconds for the guest in last walk
715 #        of the dirty bitmap. (since 1.3)
717 # @setup-time: #optional amount of setup time in milliseconds _before_ the
718 #        iterations begin but _after_ the QMP command is issued. This is designed
719 #        to provide an accounting of any activities (such as RDMA pinning) which
720 #        may be expensive, but do not actually occur during the iterative
721 #        migration rounds themselves. (since 1.6)
723 # Since: 0.14.0
725 { 'type': 'MigrationInfo',
726   'data': {'*status': 'str', '*ram': 'MigrationStats',
727            '*disk': 'MigrationStats',
728            '*xbzrle-cache': 'XBZRLECacheStats',
729            '*total-time': 'int',
730            '*expected-downtime': 'int',
731            '*downtime': 'int',
732            '*setup-time': 'int'} }
735 # @query-migrate
737 # Returns information about current migration process.
739 # Returns: @MigrationInfo
741 # Since: 0.14.0
743 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
746 # @MigrationCapability
748 # Migration capabilities enumeration
750 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
751 #          This feature allows us to minimize migration traffic for certain work
752 #          loads, by sending compressed difference of the pages
754 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
755 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
756 #          Disabled by default. Experimental: may (or may not) be renamed after
757 #          further testing is complete. (since 1.6)
759 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
760 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
761 #          source and target VM to support this feature. To enable it is sufficient
762 #          to enable the capability on the source VM. The feature is disabled by
763 #          default. (since 1.6)
765 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
766 #          to speed up convergence of RAM migration. (since 1.6)
768 # Since: 1.2
770 { 'enum': 'MigrationCapability',
771   'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
774 # @MigrationCapabilityStatus
776 # Migration capability information
778 # @capability: capability enum
780 # @state: capability state bool
782 # Since: 1.2
784 { 'type': 'MigrationCapabilityStatus',
785   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
788 # @migrate-set-capabilities
790 # Enable/Disable the following migration capabilities (like xbzrle)
792 # @capabilities: json array of capability modifications to make
794 # Since: 1.2
796 { 'command': 'migrate-set-capabilities',
797   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
800 # @query-migrate-capabilities
802 # Returns information about the current migration capabilities status
804 # Returns: @MigrationCapabilitiesStatus
806 # Since: 1.2
808 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
811 # @MouseInfo:
813 # Information about a mouse device.
815 # @name: the name of the mouse device
817 # @index: the index of the mouse device
819 # @current: true if this device is currently receiving mouse events
821 # @absolute: true if this device supports absolute coordinates as input
823 # Since: 0.14.0
825 { 'type': 'MouseInfo',
826   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
827            'absolute': 'bool'} }
830 # @query-mice:
832 # Returns information about each active mouse device
834 # Returns: a list of @MouseInfo for each device
836 # Since: 0.14.0
838 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
841 # @CpuInfo:
843 # Information about a virtual CPU
845 # @CPU: the index of the virtual CPU
847 # @current: this only exists for backwards compatible and should be ignored
849 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
850 #          to a processor specific low power mode.
852 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
853 #                pointer.
854 #                If the target is Sparc, this is the PC component of the
855 #                instruction pointer.
857 # @nip: #optional If the target is PPC, the instruction pointer
859 # @npc: #optional If the target is Sparc, the NPC component of the instruction
860 #                 pointer
862 # @PC: #optional If the target is MIPS, the instruction pointer
864 # @thread_id: ID of the underlying host thread
866 # Since: 0.14.0
868 # Notes: @halted is a transient state that changes frequently.  By the time the
869 #        data is sent to the client, the guest may no longer be halted.
871 { 'type': 'CpuInfo',
872   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
873            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
876 # @query-cpus:
878 # Returns a list of information about each virtual CPU.
880 # Returns: a list of @CpuInfo for each virtual CPU
882 # Since: 0.14.0
884 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
887 # @BlockDeviceInfo:
889 # Information about the backing device for a block device.
891 # @file: the filename of the backing device
893 # @node-name: #optional the name of the block driver node (Since 2.0)
895 # @ro: true if the backing device was open read-only
897 # @drv: the name of the block format used to open the backing device. As of
898 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
899 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
900 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
901 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
903 # @backing_file: #optional the name of the backing file (for copy-on-write)
905 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
907 # @encrypted: true if the backing device is encrypted
909 # @encryption_key_missing: true if the backing device is encrypted but an
910 #                          valid encryption key is missing
912 # @bps: total throughput limit in bytes per second is specified
914 # @bps_rd: read throughput limit in bytes per second is specified
916 # @bps_wr: write throughput limit in bytes per second is specified
918 # @iops: total I/O operations per second is specified
920 # @iops_rd: read I/O operations per second is specified
922 # @iops_wr: write I/O operations per second is specified
924 # @image: the info of image used (since: 1.6)
926 # @bps_max: #optional total max in bytes (Since 1.7)
928 # @bps_rd_max: #optional read max in bytes (Since 1.7)
930 # @bps_wr_max: #optional write max in bytes (Since 1.7)
932 # @iops_max: #optional total I/O operations max (Since 1.7)
934 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
936 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
938 # @iops_size: #optional an I/O size in bytes (Since 1.7)
940 # Since: 0.14.0
943 { 'type': 'BlockDeviceInfo',
944   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
945             '*backing_file': 'str', 'backing_file_depth': 'int',
946             'encrypted': 'bool', 'encryption_key_missing': 'bool',
947             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
948             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
949             'image': 'ImageInfo',
950             '*bps_max': 'int', '*bps_rd_max': 'int',
951             '*bps_wr_max': 'int', '*iops_max': 'int',
952             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
953             '*iops_size': 'int' } }
956 # @BlockDeviceIoStatus:
958 # An enumeration of block device I/O status.
960 # @ok: The last I/O operation has succeeded
962 # @failed: The last I/O operation has failed
964 # @nospace: The last I/O operation has failed due to a no-space condition
966 # Since: 1.0
968 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
971 # @BlockDeviceMapEntry:
973 # Entry in the metadata map of the device (returned by "qemu-img map")
975 # @start: Offset in the image of the first byte described by this entry
976 #         (in bytes)
978 # @length: Length of the range described by this entry (in bytes)
980 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
981 #         before reaching one for which the range is allocated.  The value is
982 #         in the range 0 to the depth of the image chain - 1.
984 # @zero: the sectors in this range read as zeros
986 # @data: reading the image will actually read data from a file (in particular,
987 #        if @offset is present this means that the sectors are not simply
988 #        preallocated, but contain actual data in raw format)
990 # @offset: if present, the image file stores the data for this range in
991 #          raw format at the given offset.
993 # Since 1.7
995 { 'type': 'BlockDeviceMapEntry',
996   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
997             'data': 'bool', '*offset': 'int' } }
1000 # @BlockDirtyInfo:
1002 # Block dirty bitmap information.
1004 # @count: number of dirty bytes according to the dirty bitmap
1006 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
1008 # Since: 1.3
1010 { 'type': 'BlockDirtyInfo',
1011   'data': {'count': 'int', 'granularity': 'int'} }
1014 # @BlockInfo:
1016 # Block device information.  This structure describes a virtual device and
1017 # the backing device associated with it.
1019 # @device: The device name associated with the virtual device.
1021 # @type: This field is returned only for compatibility reasons, it should
1022 #        not be used (always returns 'unknown')
1024 # @removable: True if the device supports removable media.
1026 # @locked: True if the guest has locked this device from having its media
1027 #          removed
1029 # @tray_open: #optional True if the device has a tray and it is open
1030 #             (only present if removable is true)
1032 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
1033 #                 driver has one or more dirty bitmaps) (Since 2.0)
1035 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
1036 #             supports it and the VM is configured to stop on errors
1038 # @inserted: #optional @BlockDeviceInfo describing the device if media is
1039 #            present
1041 # Since:  0.14.0
1043 { 'type': 'BlockInfo',
1044   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
1045            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
1046            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
1047            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
1050 # @query-block:
1052 # Get a list of BlockInfo for all virtual block devices.
1054 # Returns: a list of @BlockInfo describing each virtual block device
1056 # Since: 0.14.0
1058 { 'command': 'query-block', 'returns': ['BlockInfo'] }
1061 # @BlockDeviceStats:
1063 # Statistics of a virtual block device or a block backing device.
1065 # @rd_bytes:      The number of bytes read by the device.
1067 # @wr_bytes:      The number of bytes written by the device.
1069 # @rd_operations: The number of read operations performed by the device.
1071 # @wr_operations: The number of write operations performed by the device.
1073 # @flush_operations: The number of cache flush operations performed by the
1074 #                    device (since 0.15.0)
1076 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
1077 #                       (since 0.15.0).
1079 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1081 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1083 # @wr_highest_offset: The offset after the greatest byte written to the
1084 #                     device.  The intended use of this information is for
1085 #                     growable sparse files (like qcow2) that are used on top
1086 #                     of a physical device.
1088 # Since: 0.14.0
1090 { 'type': 'BlockDeviceStats',
1091   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1092            'wr_operations': 'int', 'flush_operations': 'int',
1093            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1094            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1097 # @BlockStats:
1099 # Statistics of a virtual block device or a block backing device.
1101 # @device: #optional If the stats are for a virtual block device, the name
1102 #          corresponding to the virtual block device.
1104 # @stats:  A @BlockDeviceStats for the device.
1106 # @parent: #optional This describes the file block device if it has one.
1108 # @backing: #optional This describes the backing block device if it has one.
1109 #           (Since 2.0)
1111 # Since: 0.14.0
1113 { 'type': 'BlockStats',
1114   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1115            '*parent': 'BlockStats',
1116            '*backing': 'BlockStats'} }
1119 # @query-blockstats:
1121 # Query the @BlockStats for all virtual block devices.
1123 # Returns: A list of @BlockStats for each virtual block devices.
1125 # Since: 0.14.0
1127 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1130 # @VncClientInfo:
1132 # Information about a connected VNC client.
1134 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1135 #        when possible.
1137 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1138 #          'ipv4' if the client is connected via IPv4 and TCP
1139 #          'unix' if the client is connected via a unix domain socket
1140 #          'unknown' otherwise
1142 # @service: The service name of the client's port.  This may depends on the
1143 #           host system's service database so symbolic names should not be
1144 #           relied on.
1146 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1147 #              Name of the client.
1149 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1150 #                 used for authentication.
1152 # Since: 0.14.0
1154 { 'type': 'VncClientInfo',
1155   'data': {'host': 'str', 'family': 'str', 'service': 'str',
1156            '*x509_dname': 'str', '*sasl_username': 'str'} }
1159 # @VncInfo:
1161 # Information about the VNC session.
1163 # @enabled: true if the VNC server is enabled, false otherwise
1165 # @host: #optional The hostname the VNC server is bound to.  This depends on
1166 #        the name resolution on the host and may be an IP address.
1168 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1169 #                    'ipv4' if the host is listening for IPv4 connections
1170 #                    'unix' if the host is listening on a unix domain socket
1171 #                    'unknown' otherwise
1173 # @service: #optional The service name of the server's port.  This may depends
1174 #           on the host system's service database so symbolic names should not
1175 #           be relied on.
1177 # @auth: #optional the current authentication type used by the server
1178 #        'none' if no authentication is being used
1179 #        'vnc' if VNC authentication is being used
1180 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1181 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1182 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1183 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1184 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1185 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1186 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1187 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1188 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1190 # @clients: a list of @VncClientInfo of all currently connected clients
1192 # Since: 0.14.0
1194 { 'type': 'VncInfo',
1195   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1196            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1199 # @query-vnc:
1201 # Returns information about the current VNC server
1203 # Returns: @VncInfo
1205 # Since: 0.14.0
1207 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1210 # @SpiceChannel
1212 # Information about a SPICE client channel.
1214 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1215 #        when possible.
1217 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1218 #          'ipv4' if the client is connected via IPv4 and TCP
1219 #          'unix' if the client is connected via a unix domain socket
1220 #          'unknown' otherwise
1222 # @port: The client's port number.
1224 # @connection-id: SPICE connection id number.  All channels with the same id
1225 #                 belong to the same SPICE session.
1227 # @connection-type: SPICE channel type number.  "1" is the main control
1228 #                   channel, filter for this one if you want to track spice
1229 #                   sessions only
1231 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1232 #              multiple channels of the same type exist, such as multiple
1233 #              display channels in a multihead setup
1235 # @tls: true if the channel is encrypted, false otherwise.
1237 # Since: 0.14.0
1239 { 'type': 'SpiceChannel',
1240   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1241            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1242            'tls': 'bool'} }
1245 # @SpiceQueryMouseMode
1247 # An enumeration of Spice mouse states.
1249 # @client: Mouse cursor position is determined by the client.
1251 # @server: Mouse cursor position is determined by the server.
1253 # @unknown: No information is available about mouse mode used by
1254 #           the spice server.
1256 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1258 # Since: 1.1
1260 { 'enum': 'SpiceQueryMouseMode',
1261   'data': [ 'client', 'server', 'unknown' ] }
1264 # @SpiceInfo
1266 # Information about the SPICE session.
1268 # @enabled: true if the SPICE server is enabled, false otherwise
1270 # @migrated: true if the last guest migration completed and spice
1271 #            migration had completed as well. false otherwise.
1273 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1274 #        the name resolution on the host and may be an IP address.
1276 # @port: #optional The SPICE server's port number.
1278 # @compiled-version: #optional SPICE server version.
1280 # @tls-port: #optional The SPICE server's TLS port number.
1282 # @auth: #optional the current authentication type used by the server
1283 #        'none'  if no authentication is being used
1284 #        'spice' uses SASL or direct TLS authentication, depending on command
1285 #                line options
1287 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1288 #              be determined by the client or the server, or unknown if spice
1289 #              server doesn't provide this information.
1291 #              Since: 1.1
1293 # @channels: a list of @SpiceChannel for each active spice channel
1295 # Since: 0.14.0
1297 { 'type': 'SpiceInfo',
1298   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1299            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1300            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1303 # @query-spice
1305 # Returns information about the current SPICE server
1307 # Returns: @SpiceInfo
1309 # Since: 0.14.0
1311 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1314 # @BalloonInfo:
1316 # Information about the guest balloon device.
1318 # @actual: the number of bytes the balloon currently contains
1320 # Since: 0.14.0
1323 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1326 # @query-balloon:
1328 # Return information about the balloon device.
1330 # Returns: @BalloonInfo on success
1331 #          If the balloon driver is enabled but not functional because the KVM
1332 #          kernel module cannot support it, KvmMissingCap
1333 #          If no balloon device is present, DeviceNotActive
1335 # Since: 0.14.0
1337 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1340 # @PciMemoryRange:
1342 # A PCI device memory region
1344 # @base: the starting address (guest physical)
1346 # @limit: the ending address (guest physical)
1348 # Since: 0.14.0
1350 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1353 # @PciMemoryRegion
1355 # Information about a PCI device I/O region.
1357 # @bar: the index of the Base Address Register for this region
1359 # @type: 'io' if the region is a PIO region
1360 #        'memory' if the region is a MMIO region
1362 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1364 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1366 # Since: 0.14.0
1368 { 'type': 'PciMemoryRegion',
1369   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1370            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1373 # @PciBridgeInfo:
1375 # Information about a PCI Bridge device
1377 # @bus.number: primary bus interface number.  This should be the number of the
1378 #              bus the device resides on.
1380 # @bus.secondary: secondary bus interface number.  This is the number of the
1381 #                 main bus for the bridge
1383 # @bus.subordinate: This is the highest number bus that resides below the
1384 #                   bridge.
1386 # @bus.io_range: The PIO range for all devices on this bridge
1388 # @bus.memory_range: The MMIO range for all devices on this bridge
1390 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1391 #                          this bridge
1393 # @devices: a list of @PciDeviceInfo for each device on this bridge
1395 # Since: 0.14.0
1397 { 'type': 'PciBridgeInfo',
1398   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1399                     'io_range': 'PciMemoryRange',
1400                     'memory_range': 'PciMemoryRange',
1401                     'prefetchable_range': 'PciMemoryRange' },
1402            '*devices': ['PciDeviceInfo']} }
1405 # @PciDeviceInfo:
1407 # Information about a PCI device
1409 # @bus: the bus number of the device
1411 # @slot: the slot the device is located in
1413 # @function: the function of the slot used by the device
1415 # @class_info.desc: #optional a string description of the device's class
1417 # @class_info.class: the class code of the device
1419 # @id.device: the PCI device id
1421 # @id.vendor: the PCI vendor id
1423 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1425 # @qdev_id: the device name of the PCI device
1427 # @pci_bridge: if the device is a PCI bridge, the bridge information
1429 # @regions: a list of the PCI I/O regions associated with the device
1431 # Notes: the contents of @class_info.desc are not stable and should only be
1432 #        treated as informational.
1434 # Since: 0.14.0
1436 { 'type': 'PciDeviceInfo',
1437   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1438            'class_info': {'*desc': 'str', 'class': 'int'},
1439            'id': {'device': 'int', 'vendor': 'int'},
1440            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1441            'regions': ['PciMemoryRegion']} }
1444 # @PciInfo:
1446 # Information about a PCI bus
1448 # @bus: the bus index
1450 # @devices: a list of devices on this bus
1452 # Since: 0.14.0
1454 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1457 # @query-pci:
1459 # Return information about the PCI bus topology of the guest.
1461 # Returns: a list of @PciInfo for each PCI bus
1463 # Since: 0.14.0
1465 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1468 # @BlockdevOnError:
1470 # An enumeration of possible behaviors for errors on I/O operations.
1471 # The exact meaning depends on whether the I/O was initiated by a guest
1472 # or by a block job
1474 # @report: for guest operations, report the error to the guest;
1475 #          for jobs, cancel the job
1477 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1478 #          or BLOCK_JOB_ERROR)
1480 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1482 # @stop: for guest operations, stop the virtual machine;
1483 #        for jobs, pause the job
1485 # Since: 1.3
1487 { 'enum': 'BlockdevOnError',
1488   'data': ['report', 'ignore', 'enospc', 'stop'] }
1491 # @MirrorSyncMode:
1493 # An enumeration of possible behaviors for the initial synchronization
1494 # phase of storage mirroring.
1496 # @top: copies data in the topmost image to the destination
1498 # @full: copies data from all images to the destination
1500 # @none: only copy data written from now on
1502 # Since: 1.3
1504 { 'enum': 'MirrorSyncMode',
1505   'data': ['top', 'full', 'none'] }
1508 # @BlockJobType:
1510 # Type of a block job.
1512 # @commit: block commit job type, see "block-commit"
1514 # @stream: block stream job type, see "block-stream"
1516 # @mirror: drive mirror job type, see "drive-mirror"
1518 # @backup: drive backup job type, see "drive-backup"
1520 # Since: 1.7
1522 { 'enum': 'BlockJobType',
1523   'data': ['commit', 'stream', 'mirror', 'backup'] }
1526 # @BlockJobInfo:
1528 # Information about a long-running block device operation.
1530 # @type: the job type ('stream' for image streaming)
1532 # @device: the block device name
1534 # @len: the maximum progress value
1536 # @busy: false if the job is known to be in a quiescent state, with
1537 #        no pending I/O.  Since 1.3.
1539 # @paused: whether the job is paused or, if @busy is true, will
1540 #          pause itself as soon as possible.  Since 1.3.
1542 # @offset: the current progress value
1544 # @speed: the rate limit, bytes per second
1546 # @io-status: the status of the job (since 1.3)
1548 # Since: 1.1
1550 { 'type': 'BlockJobInfo',
1551   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1552            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1553            'io-status': 'BlockDeviceIoStatus'} }
1556 # @query-block-jobs:
1558 # Return information about long-running block device operations.
1560 # Returns: a list of @BlockJobInfo for each active block job
1562 # Since: 1.1
1564 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1567 # @quit:
1569 # This command will cause the QEMU process to exit gracefully.  While every
1570 # attempt is made to send the QMP response before terminating, this is not
1571 # guaranteed.  When using this interface, a premature EOF would not be
1572 # unexpected.
1574 # Since: 0.14.0
1576 { 'command': 'quit' }
1579 # @stop:
1581 # Stop all guest VCPU execution.
1583 # Since:  0.14.0
1585 # Notes:  This function will succeed even if the guest is already in the stopped
1586 #         state.  In "inmigrate" state, it will ensure that the guest
1587 #         remains paused once migration finishes, as if the -S option was
1588 #         passed on the command line.
1590 { 'command': 'stop' }
1593 # @system_reset:
1595 # Performs a hard reset of a guest.
1597 # Since: 0.14.0
1599 { 'command': 'system_reset' }
1602 # @system_powerdown:
1604 # Requests that a guest perform a powerdown operation.
1606 # Since: 0.14.0
1608 # Notes: A guest may or may not respond to this command.  This command
1609 #        returning does not indicate that a guest has accepted the request or
1610 #        that it has shut down.  Many guests will respond to this command by
1611 #        prompting the user in some way.
1613 { 'command': 'system_powerdown' }
1616 # @cpu:
1618 # This command is a nop that is only provided for the purposes of compatibility.
1620 # Since: 0.14.0
1622 # Notes: Do not use this command.
1624 { 'command': 'cpu', 'data': {'index': 'int'} }
1627 # @cpu-add
1629 # Adds CPU with specified ID
1631 # @id: ID of CPU to be created, valid values [0..max_cpus)
1633 # Returns: Nothing on success
1635 # Since 1.5
1637 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1640 # @memsave:
1642 # Save a portion of guest memory to a file.
1644 # @val: the virtual address of the guest to start from
1646 # @size: the size of memory region to save
1648 # @filename: the file to save the memory to as binary data
1650 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1651 #                       virtual address (defaults to CPU 0)
1653 # Returns: Nothing on success
1655 # Since: 0.14.0
1657 # Notes: Errors were not reliably returned until 1.1
1659 { 'command': 'memsave',
1660   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1663 # @pmemsave:
1665 # Save a portion of guest physical memory to a file.
1667 # @val: the physical address of the guest to start from
1669 # @size: the size of memory region to save
1671 # @filename: the file to save the memory to as binary data
1673 # Returns: Nothing on success
1675 # Since: 0.14.0
1677 # Notes: Errors were not reliably returned until 1.1
1679 { 'command': 'pmemsave',
1680   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1683 # @cont:
1685 # Resume guest VCPU execution.
1687 # Since:  0.14.0
1689 # Returns:  If successful, nothing
1690 #           If QEMU was started with an encrypted block device and a key has
1691 #              not yet been set, DeviceEncrypted.
1693 # Notes:  This command will succeed if the guest is currently running.  It
1694 #         will also succeed if the guest is in the "inmigrate" state; in
1695 #         this case, the effect of the command is to make sure the guest
1696 #         starts once migration finishes, removing the effect of the -S
1697 #         command line option if it was passed.
1699 { 'command': 'cont' }
1702 # @system_wakeup:
1704 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1706 # Since:  1.1
1708 # Returns:  nothing.
1710 { 'command': 'system_wakeup' }
1713 # @inject-nmi:
1715 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1717 # Returns:  If successful, nothing
1719 # Since:  0.14.0
1721 # Notes: Only x86 Virtual Machines support this command.
1723 { 'command': 'inject-nmi' }
1726 # @set_link:
1728 # Sets the link status of a virtual network adapter.
1730 # @name: the device name of the virtual network adapter
1732 # @up: true to set the link status to be up
1734 # Returns: Nothing on success
1735 #          If @name is not a valid network device, DeviceNotFound
1737 # Since: 0.14.0
1739 # Notes: Not all network adapters support setting link status.  This command
1740 #        will succeed even if the network adapter does not support link status
1741 #        notification.
1743 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1746 # @block_passwd:
1748 # This command sets the password of a block device that has not been open
1749 # with a password and requires one.
1751 # The two cases where this can happen are a block device is created through
1752 # QEMU's initial command line or a block device is changed through the legacy
1753 # @change interface.
1755 # In the event that the block device is created through the initial command
1756 # line, the VM will start in the stopped state regardless of whether '-S' is
1757 # used.  The intention is for a management tool to query the block devices to
1758 # determine which ones are encrypted, set the passwords with this command, and
1759 # then start the guest with the @cont command.
1761 # Either @device or @node-name must be set but not both.
1763 # @device: #optional the name of the block backend device to set the password on
1765 # @node-name: #optional graph node name to set the password on (Since 2.0)
1767 # @password: the password to use for the device
1769 # Returns: nothing on success
1770 #          If @device is not a valid block device, DeviceNotFound
1771 #          If @device is not encrypted, DeviceNotEncrypted
1773 # Notes:  Not all block formats support encryption and some that do are not
1774 #         able to validate that a password is correct.  Disk corruption may
1775 #         occur if an invalid password is specified.
1777 # Since: 0.14.0
1779 { 'command': 'block_passwd', 'data': {'*device': 'str',
1780                                       '*node-name': 'str', 'password': 'str'} }
1783 # @balloon:
1785 # Request the balloon driver to change its balloon size.
1787 # @value: the target size of the balloon in bytes
1789 # Returns: Nothing on success
1790 #          If the balloon driver is enabled but not functional because the KVM
1791 #            kernel module cannot support it, KvmMissingCap
1792 #          If no balloon device is present, DeviceNotActive
1794 # Notes: This command just issues a request to the guest.  When it returns,
1795 #        the balloon size may not have changed.  A guest can change the balloon
1796 #        size independent of this command.
1798 # Since: 0.14.0
1800 { 'command': 'balloon', 'data': {'value': 'int'} }
1803 # @block_resize
1805 # Resize a block image while a guest is running.
1807 # Either @device or @node-name must be set but not both.
1809 # @device: #optional the name of the device to get the image resized
1811 # @node-name: #optional graph node name to get the image resized (Since 2.0)
1813 # @size:  new image size in bytes
1815 # Returns: nothing on success
1816 #          If @device is not a valid block device, DeviceNotFound
1818 # Since: 0.14.0
1820 { 'command': 'block_resize', 'data': { '*device': 'str',
1821                                        '*node-name': 'str',
1822                                        'size': 'int' }}
1825 # @NewImageMode
1827 # An enumeration that tells QEMU how to set the backing file path in
1828 # a new image file.
1830 # @existing: QEMU should look for an existing image file.
1832 # @absolute-paths: QEMU should create a new image with absolute paths
1833 # for the backing file. If there is no backing file available, the new
1834 # image will not be backed either.
1836 # Since: 1.1
1838 { 'enum': 'NewImageMode',
1839   'data': [ 'existing', 'absolute-paths' ] }
1842 # @BlockdevSnapshot
1844 # Either @device or @node-name must be set but not both.
1846 # @device: #optional the name of the device to generate the snapshot from.
1848 # @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
1850 # @snapshot-file: the target of the new image. A new file will be created.
1852 # @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
1854 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1856 # @mode: #optional whether and how QEMU should create a new image, default is
1857 #        'absolute-paths'.
1859 { 'type': 'BlockdevSnapshot',
1860   'data': { '*device': 'str', '*node-name': 'str',
1861             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1862             '*format': 'str', '*mode': 'NewImageMode' } }
1865 # @BlockdevSnapshotInternal
1867 # @device: the name of the device to generate the snapshot from
1869 # @name: the name of the internal snapshot to be created
1871 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1872 #        exists, the operation will fail. Only some image formats support it,
1873 #        for example, qcow2, rbd, and sheepdog.
1875 # Since: 1.7
1877 { 'type': 'BlockdevSnapshotInternal',
1878   'data': { 'device': 'str', 'name': 'str' } }
1881 # @DriveBackup
1883 # @device: the name of the device which should be copied.
1885 # @target: the target of the new image. If the file exists, or if it
1886 #          is a device, the existing file/device will be used as the new
1887 #          destination.  If it does not exist, a new file will be created.
1889 # @format: #optional the format of the new destination, default is to
1890 #          probe if @mode is 'existing', else the format of the source
1892 # @sync: what parts of the disk image should be copied to the destination
1893 #        (all the disk, only the sectors allocated in the topmost image, or
1894 #        only new I/O).
1896 # @mode: #optional whether and how QEMU should create a new image, default is
1897 #        'absolute-paths'.
1899 # @speed: #optional the maximum speed, in bytes per second
1901 # @on-source-error: #optional the action to take on an error on the source,
1902 #                   default 'report'.  'stop' and 'enospc' can only be used
1903 #                   if the block device supports io-status (see BlockInfo).
1905 # @on-target-error: #optional the action to take on an error on the target,
1906 #                   default 'report' (no limitations, since this applies to
1907 #                   a different block device than @device).
1909 # Note that @on-source-error and @on-target-error only affect background I/O.
1910 # If an error occurs during a guest write request, the device's rerror/werror
1911 # actions will be used.
1913 # Since: 1.6
1915 { 'type': 'DriveBackup',
1916   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1917             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1918             '*speed': 'int',
1919             '*on-source-error': 'BlockdevOnError',
1920             '*on-target-error': 'BlockdevOnError' } }
1923 # @Abort
1925 # This action can be used to test transaction failure.
1927 # Since: 1.6
1929 { 'type': 'Abort',
1930   'data': { } }
1933 # @TransactionAction
1935 # A discriminated record of operations that can be performed with
1936 # @transaction.
1938 { 'union': 'TransactionAction',
1939   'data': {
1940        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1941        'drive-backup': 'DriveBackup',
1942        'abort': 'Abort',
1943        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1944    } }
1947 # @transaction
1949 # Executes a number of transactionable QMP commands atomically. If any
1950 # operation fails, then the entire set of actions will be abandoned and the
1951 # appropriate error returned.
1953 #  List of:
1954 #  @TransactionAction: information needed for the respective operation
1956 # Returns: nothing on success
1957 #          Errors depend on the operations of the transaction
1959 # Note: The transaction aborts on the first failure.  Therefore, there will be
1960 # information on only one failed operation returned in an error condition, and
1961 # subsequent actions will not have been attempted.
1963 # Since 1.1
1965 { 'command': 'transaction',
1966   'data': { 'actions': [ 'TransactionAction' ] } }
1969 # @blockdev-snapshot-sync
1971 # Generates a synchronous snapshot of a block device.
1973 # For the arguments, see the documentation of BlockdevSnapshot.
1975 # Returns: nothing on success
1976 #          If @device is not a valid block device, DeviceNotFound
1978 # Since 0.14.0
1980 { 'command': 'blockdev-snapshot-sync',
1981   'data': 'BlockdevSnapshot' }
1984 # @blockdev-snapshot-internal-sync
1986 # Synchronously take an internal snapshot of a block device, when the format
1987 # of the image used supports it.
1989 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1991 # Returns: nothing on success
1992 #          If @device is not a valid block device, DeviceNotFound
1993 #          If any snapshot matching @name exists, or @name is empty,
1994 #          GenericError
1995 #          If the format of the image used does not support it,
1996 #          BlockFormatFeatureNotSupported
1998 # Since 1.7
2000 { 'command': 'blockdev-snapshot-internal-sync',
2001   'data': 'BlockdevSnapshotInternal' }
2004 # @blockdev-snapshot-delete-internal-sync
2006 # Synchronously delete an internal snapshot of a block device, when the format
2007 # of the image used support it. The snapshot is identified by name or id or
2008 # both. One of the name or id is required. Return SnapshotInfo for the
2009 # successfully deleted snapshot.
2011 # @device: the name of the device to delete the snapshot from
2013 # @id: optional the snapshot's ID to be deleted
2015 # @name: optional the snapshot's name to be deleted
2017 # Returns: SnapshotInfo on success
2018 #          If @device is not a valid block device, DeviceNotFound
2019 #          If snapshot not found, GenericError
2020 #          If the format of the image used does not support it,
2021 #          BlockFormatFeatureNotSupported
2022 #          If @id and @name are both not specified, GenericError
2024 # Since 1.7
2026 { 'command': 'blockdev-snapshot-delete-internal-sync',
2027   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
2028   'returns': 'SnapshotInfo' }
2031 # @human-monitor-command:
2033 # Execute a command on the human monitor and return the output.
2035 # @command-line: the command to execute in the human monitor
2037 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2039 # Returns: the output of the command as a string
2041 # Since: 0.14.0
2043 # Notes: This command only exists as a stop-gap.  Its use is highly
2044 #        discouraged.  The semantics of this command are not guaranteed.
2046 #        Known limitations:
2048 #        o This command is stateless, this means that commands that depend
2049 #          on state information (such as getfd) might not work
2051 #       o Commands that prompt the user for data (eg. 'cont' when the block
2052 #         device is encrypted) don't currently work
2054 { 'command': 'human-monitor-command',
2055   'data': {'command-line': 'str', '*cpu-index': 'int'},
2056   'returns': 'str' }
2059 # @block-commit
2061 # Live commit of data from overlay image nodes into backing nodes - i.e.,
2062 # writes data between 'top' and 'base' into 'base'.
2064 # @device:  the name of the device
2066 # @base:   #optional The file name of the backing image to write data into.
2067 #                    If not specified, this is the deepest backing image
2069 # @top:              The file name of the backing image within the image chain,
2070 #                    which contains the topmost data to be committed down.
2072 #                    If top == base, that is an error.
2073 #                    If top == active, the job will not be completed by itself,
2074 #                    user needs to complete the job with the block-job-complete
2075 #                    command after getting the ready event. (Since 2.0)
2077 #                    If the base image is smaller than top, then the base image
2078 #                    will be resized to be the same size as top.  If top is
2079 #                    smaller than the base image, the base will not be
2080 #                    truncated.  If you want the base image size to match the
2081 #                    size of the smaller top, you can safely truncate it
2082 #                    yourself once the commit operation successfully completes.
2085 # @speed:  #optional the maximum speed, in bytes per second
2087 # Returns: Nothing on success
2088 #          If commit or stream is already active on this device, DeviceInUse
2089 #          If @device does not exist, DeviceNotFound
2090 #          If image commit is not supported by this device, NotSupported
2091 #          If @base or @top is invalid, a generic error is returned
2092 #          If @speed is invalid, InvalidParameter
2094 # Since: 1.3
2097 { 'command': 'block-commit',
2098   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
2099             '*speed': 'int' } }
2102 # @drive-backup
2104 # Start a point-in-time copy of a block device to a new destination.  The
2105 # status of ongoing drive-backup operations can be checked with
2106 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
2107 # The operation can be stopped before it has completed using the
2108 # block-job-cancel command.
2110 # For the arguments, see the documentation of DriveBackup.
2112 # Returns: nothing on success
2113 #          If @device is not a valid block device, DeviceNotFound
2115 # Since 1.6
2117 { 'command': 'drive-backup', 'data': 'DriveBackup' }
2120 # @query-named-block-nodes
2122 # Get the named block driver list
2124 # Returns: the list of BlockDeviceInfo
2126 # Since 2.0
2128 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
2131 # @drive-mirror
2133 # Start mirroring a block device's writes to a new destination.
2135 # @device:  the name of the device whose writes should be mirrored.
2137 # @target: the target of the new image. If the file exists, or if it
2138 #          is a device, the existing file/device will be used as the new
2139 #          destination.  If it does not exist, a new file will be created.
2141 # @format: #optional the format of the new destination, default is to
2142 #          probe if @mode is 'existing', else the format of the source
2144 # @mode: #optional whether and how QEMU should create a new image, default is
2145 #        'absolute-paths'.
2147 # @speed:  #optional the maximum speed, in bytes per second
2149 # @sync: what parts of the disk image should be copied to the destination
2150 #        (all the disk, only the sectors allocated in the topmost image, or
2151 #        only new I/O).
2153 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2154 #               if the image format doesn't have clusters, 4K if the clusters
2155 #               are smaller than that, else the cluster size.  Must be a
2156 #               power of 2 between 512 and 64M (since 1.4).
2158 # @buf-size: #optional maximum amount of data in flight from source to
2159 #            target (since 1.4).
2161 # @on-source-error: #optional the action to take on an error on the source,
2162 #                   default 'report'.  'stop' and 'enospc' can only be used
2163 #                   if the block device supports io-status (see BlockInfo).
2165 # @on-target-error: #optional the action to take on an error on the target,
2166 #                   default 'report' (no limitations, since this applies to
2167 #                   a different block device than @device).
2169 # Returns: nothing on success
2170 #          If @device is not a valid block device, DeviceNotFound
2172 # Since 1.3
2174 { 'command': 'drive-mirror',
2175   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2176             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2177             '*speed': 'int', '*granularity': 'uint32',
2178             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2179             '*on-target-error': 'BlockdevOnError' } }
2182 # @migrate_cancel
2184 # Cancel the current executing migration process.
2186 # Returns: nothing on success
2188 # Notes: This command succeeds even if there is no migration process running.
2190 # Since: 0.14.0
2192 { 'command': 'migrate_cancel' }
2195 # @migrate_set_downtime
2197 # Set maximum tolerated downtime for migration.
2199 # @value: maximum downtime in seconds
2201 # Returns: nothing on success
2203 # Since: 0.14.0
2205 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2208 # @migrate_set_speed
2210 # Set maximum speed for migration.
2212 # @value: maximum speed in bytes.
2214 # Returns: nothing on success
2216 # Notes: A value lesser than zero will be automatically round up to zero.
2218 # Since: 0.14.0
2220 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2223 # @migrate-set-cache-size
2225 # Set XBZRLE cache size
2227 # @value: cache size in bytes
2229 # The size will be rounded down to the nearest power of 2.
2230 # The cache size can be modified before and during ongoing migration
2232 # Returns: nothing on success
2234 # Since: 1.2
2236 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2239 # @query-migrate-cache-size
2241 # query XBZRLE cache size
2243 # Returns: XBZRLE cache size in bytes
2245 # Since: 1.2
2247 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2250 # @ObjectPropertyInfo:
2252 # @name: the name of the property
2254 # @type: the type of the property.  This will typically come in one of four
2255 #        forms:
2257 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2258 #           These types are mapped to the appropriate JSON type.
2260 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
2261 #           legacy qdev typename.  These types are always treated as strings.
2263 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
2264 #           device type name.  Child properties create the composition tree.
2266 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
2267 #           device type name.  Link properties form the device model graph.
2269 # Since: 1.2
2271 { 'type': 'ObjectPropertyInfo',
2272   'data': { 'name': 'str', 'type': 'str' } }
2275 # @qom-list:
2277 # This command will list any properties of a object given a path in the object
2278 # model.
2280 # @path: the path within the object model.  See @qom-get for a description of
2281 #        this parameter.
2283 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2284 #          object.
2286 # Since: 1.2
2288 { 'command': 'qom-list',
2289   'data': { 'path': 'str' },
2290   'returns': [ 'ObjectPropertyInfo' ] }
2293 # @qom-get:
2295 # This command will get a property from a object model path and return the
2296 # value.
2298 # @path: The path within the object model.  There are two forms of supported
2299 #        paths--absolute and partial paths.
2301 #        Absolute paths are derived from the root object and can follow child<>
2302 #        or link<> properties.  Since they can follow link<> properties, they
2303 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2304 #        and are prefixed  with a leading slash.
2306 #        Partial paths look like relative filenames.  They do not begin
2307 #        with a prefix.  The matching rules for partial paths are subtle but
2308 #        designed to make specifying objects easy.  At each level of the
2309 #        composition tree, the partial path is matched as an absolute path.
2310 #        The first match is not returned.  At least two matches are searched
2311 #        for.  A successful result is only returned if only one match is
2312 #        found.  If more than one match is found, a flag is return to
2313 #        indicate that the match was ambiguous.
2315 # @property: The property name to read
2317 # Returns: The property value.  The type depends on the property type.  legacy<>
2318 #          properties are returned as #str.  child<> and link<> properties are
2319 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2320 #          are returned as #int.
2322 # Since: 1.2
2324 { 'command': 'qom-get',
2325   'data': { 'path': 'str', 'property': 'str' },
2326   'returns': 'visitor',
2327   'gen': 'no' }
2330 # @qom-set:
2332 # This command will set a property from a object model path.
2334 # @path: see @qom-get for a description of this parameter
2336 # @property: the property name to set
2338 # @value: a value who's type is appropriate for the property type.  See @qom-get
2339 #         for a description of type mapping.
2341 # Since: 1.2
2343 { 'command': 'qom-set',
2344   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2345   'gen': 'no' }
2348 # @set_password:
2350 # Sets the password of a remote display session.
2352 # @protocol: `vnc' to modify the VNC server password
2353 #            `spice' to modify the Spice server password
2355 # @password: the new password
2357 # @connected: #optional how to handle existing clients when changing the
2358 #                       password.  If nothing is specified, defaults to `keep'
2359 #                       `fail' to fail the command if clients are connected
2360 #                       `disconnect' to disconnect existing clients
2361 #                       `keep' to maintain existing clients
2363 # Returns: Nothing on success
2364 #          If Spice is not enabled, DeviceNotFound
2366 # Since: 0.14.0
2368 { 'command': 'set_password',
2369   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2372 # @expire_password:
2374 # Expire the password of a remote display server.
2376 # @protocol: the name of the remote display protocol `vnc' or `spice'
2378 # @time: when to expire the password.
2379 #        `now' to expire the password immediately
2380 #        `never' to cancel password expiration
2381 #        `+INT' where INT is the number of seconds from now (integer)
2382 #        `INT' where INT is the absolute time in seconds
2384 # Returns: Nothing on success
2385 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2387 # Since: 0.14.0
2389 # Notes: Time is relative to the server and currently there is no way to
2390 #        coordinate server time with client time.  It is not recommended to
2391 #        use the absolute time version of the @time parameter unless you're
2392 #        sure you are on the same machine as the QEMU instance.
2394 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2397 # @eject:
2399 # Ejects a device from a removable drive.
2401 # @device:  The name of the device
2403 # @force:   @optional If true, eject regardless of whether the drive is locked.
2404 #           If not specified, the default value is false.
2406 # Returns:  Nothing on success
2407 #           If @device is not a valid block device, DeviceNotFound
2409 # Notes:    Ejecting a device will no media results in success
2411 # Since: 0.14.0
2413 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2416 # @change-vnc-password:
2418 # Change the VNC server password.
2420 # @target:  the new password to use with VNC authentication
2422 # Since: 1.1
2424 # Notes:  An empty password in this command will set the password to the empty
2425 #         string.  Existing clients are unaffected by executing this command.
2427 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2430 # @change:
2432 # This command is multiple commands multiplexed together.
2434 # @device: This is normally the name of a block device but it may also be 'vnc'.
2435 #          when it's 'vnc', then sub command depends on @target
2437 # @target: If @device is a block device, then this is the new filename.
2438 #          If @device is 'vnc', then if the value 'password' selects the vnc
2439 #          change password command.   Otherwise, this specifies a new server URI
2440 #          address to listen to for VNC connections.
2442 # @arg:    If @device is a block device, then this is an optional format to open
2443 #          the device with.
2444 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2445 #          password to set.  If this argument is an empty string, then no future
2446 #          logins will be allowed.
2448 # Returns: Nothing on success.
2449 #          If @device is not a valid block device, DeviceNotFound
2450 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2451 #          if this error is returned, the device has been opened successfully
2452 #          and an additional call to @block_passwd is required to set the
2453 #          device's password.  The behavior of reads and writes to the block
2454 #          device between when these calls are executed is undefined.
2456 # Notes:  It is strongly recommended that this interface is not used especially
2457 #         for changing block devices.
2459 # Since: 0.14.0
2461 { 'command': 'change',
2462   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2465 # @block_set_io_throttle:
2467 # Change I/O throttle limits for a block drive.
2469 # @device: The name of the device
2471 # @bps: total throughput limit in bytes per second
2473 # @bps_rd: read throughput limit in bytes per second
2475 # @bps_wr: write throughput limit in bytes per second
2477 # @iops: total I/O operations per second
2479 # @ops_rd: read I/O operations per second
2481 # @iops_wr: write I/O operations per second
2483 # @bps_max: #optional total max in bytes (Since 1.7)
2485 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2487 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2489 # @iops_max: #optional total I/O operations max (Since 1.7)
2491 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2493 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2495 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2497 # Returns: Nothing on success
2498 #          If @device is not a valid block device, DeviceNotFound
2500 # Since: 1.1
2502 { 'command': 'block_set_io_throttle',
2503   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2504             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2505             '*bps_max': 'int', '*bps_rd_max': 'int',
2506             '*bps_wr_max': 'int', '*iops_max': 'int',
2507             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2508             '*iops_size': 'int' } }
2511 # @block-stream:
2513 # Copy data from a backing file into a block device.
2515 # The block streaming operation is performed in the background until the entire
2516 # backing file has been copied.  This command returns immediately once streaming
2517 # has started.  The status of ongoing block streaming operations can be checked
2518 # with query-block-jobs.  The operation can be stopped before it has completed
2519 # using the block-job-cancel command.
2521 # If a base file is specified then sectors are not copied from that base file and
2522 # its backing chain.  When streaming completes the image file will have the base
2523 # file as its backing file.  This can be used to stream a subset of the backing
2524 # file chain instead of flattening the entire image.
2526 # On successful completion the image file is updated to drop the backing file
2527 # and the BLOCK_JOB_COMPLETED event is emitted.
2529 # @device: the device name
2531 # @base:   #optional the common backing file name
2533 # @speed:  #optional the maximum speed, in bytes per second
2535 # @on-error: #optional the action to take on an error (default report).
2536 #            'stop' and 'enospc' can only be used if the block device
2537 #            supports io-status (see BlockInfo).  Since 1.3.
2539 # Returns: Nothing on success
2540 #          If @device does not exist, DeviceNotFound
2542 # Since: 1.1
2544 { 'command': 'block-stream',
2545   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2546             '*on-error': 'BlockdevOnError' } }
2549 # @block-job-set-speed:
2551 # Set maximum speed for a background block operation.
2553 # This command can only be issued when there is an active block job.
2555 # Throttling can be disabled by setting the speed to 0.
2557 # @device: the device name
2559 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2560 #          Defaults to 0.
2562 # Returns: Nothing on success
2563 #          If no background operation is active on this device, DeviceNotActive
2565 # Since: 1.1
2567 { 'command': 'block-job-set-speed',
2568   'data': { 'device': 'str', 'speed': 'int' } }
2571 # @block-job-cancel:
2573 # Stop an active background block operation.
2575 # This command returns immediately after marking the active background block
2576 # operation for cancellation.  It is an error to call this command if no
2577 # operation is in progress.
2579 # The operation will cancel as soon as possible and then emit the
2580 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2581 # enumerated using query-block-jobs.
2583 # For streaming, the image file retains its backing file unless the streaming
2584 # operation happens to complete just as it is being cancelled.  A new streaming
2585 # operation can be started at a later time to finish copying all data from the
2586 # backing file.
2588 # @device: the device name
2590 # @force: #optional whether to allow cancellation of a paused job (default
2591 #         false).  Since 1.3.
2593 # Returns: Nothing on success
2594 #          If no background operation is active on this device, DeviceNotActive
2596 # Since: 1.1
2598 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2601 # @block-job-pause:
2603 # Pause an active background block operation.
2605 # This command returns immediately after marking the active background block
2606 # operation for pausing.  It is an error to call this command if no
2607 # operation is in progress.  Pausing an already paused job has no cumulative
2608 # effect; a single block-job-resume command will resume the job.
2610 # The operation will pause as soon as possible.  No event is emitted when
2611 # the operation is actually paused.  Cancelling a paused job automatically
2612 # resumes it.
2614 # @device: the device name
2616 # Returns: Nothing on success
2617 #          If no background operation is active on this device, DeviceNotActive
2619 # Since: 1.3
2621 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2624 # @block-job-resume:
2626 # Resume an active background block operation.
2628 # This command returns immediately after resuming a paused background block
2629 # operation.  It is an error to call this command if no operation is in
2630 # progress.  Resuming an already running job is not an error.
2632 # This command also clears the error status of the job.
2634 # @device: the device name
2636 # Returns: Nothing on success
2637 #          If no background operation is active on this device, DeviceNotActive
2639 # Since: 1.3
2641 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2644 # @block-job-complete:
2646 # Manually trigger completion of an active background block operation.  This
2647 # is supported for drive mirroring, where it also switches the device to
2648 # write to the target path only.  The ability to complete is signaled with
2649 # a BLOCK_JOB_READY event.
2651 # This command completes an active background block operation synchronously.
2652 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2653 # is not defined.  Note that if an I/O error occurs during the processing of
2654 # this command: 1) the command itself will fail; 2) the error will be processed
2655 # according to the rerror/werror arguments that were specified when starting
2656 # the operation.
2658 # A cancelled or paused job cannot be completed.
2660 # @device: the device name
2662 # Returns: Nothing on success
2663 #          If no background operation is active on this device, DeviceNotActive
2665 # Since: 1.3
2667 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2670 # @ObjectTypeInfo:
2672 # This structure describes a search result from @qom-list-types
2674 # @name: the type name found in the search
2676 # Since: 1.1
2678 # Notes: This command is experimental and may change syntax in future releases.
2680 { 'type': 'ObjectTypeInfo',
2681   'data': { 'name': 'str' } }
2684 # @qom-list-types:
2686 # This command will return a list of types given search parameters
2688 # @implements: if specified, only return types that implement this type name
2690 # @abstract: if true, include abstract types in the results
2692 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2694 # Since: 1.1
2696 { 'command': 'qom-list-types',
2697   'data': { '*implements': 'str', '*abstract': 'bool' },
2698   'returns': [ 'ObjectTypeInfo' ] }
2701 # @DevicePropertyInfo:
2703 # Information about device properties.
2705 # @name: the name of the property
2706 # @type: the typename of the property
2708 # Since: 1.2
2710 { 'type': 'DevicePropertyInfo',
2711   'data': { 'name': 'str', 'type': 'str' } }
2714 # @device-list-properties:
2716 # List properties associated with a device.
2718 # @typename: the type name of a device
2720 # Returns: a list of DevicePropertyInfo describing a devices properties
2722 # Since: 1.2
2724 { 'command': 'device-list-properties',
2725   'data': { 'typename': 'str'},
2726   'returns': [ 'DevicePropertyInfo' ] }
2729 # @migrate
2731 # Migrates the current running guest to another Virtual Machine.
2733 # @uri: the Uniform Resource Identifier of the destination VM
2735 # @blk: #optional do block migration (full disk copy)
2737 # @inc: #optional incremental disk copy migration
2739 # @detach: this argument exists only for compatibility reasons and
2740 #          is ignored by QEMU
2742 # Returns: nothing on success
2744 # Since: 0.14.0
2746 { 'command': 'migrate',
2747   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2749 # @xen-save-devices-state:
2751 # Save the state of all devices to file. The RAM and the block devices
2752 # of the VM are not saved by this command.
2754 # @filename: the file to save the state of the devices to as binary
2755 # data. See xen-save-devices-state.txt for a description of the binary
2756 # format.
2758 # Returns: Nothing on success
2760 # Since: 1.1
2762 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2765 # @xen-set-global-dirty-log
2767 # Enable or disable the global dirty log mode.
2769 # @enable: true to enable, false to disable.
2771 # Returns: nothing
2773 # Since: 1.3
2775 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2778 # @device_del:
2780 # Remove a device from a guest
2782 # @id: the name of the device
2784 # Returns: Nothing on success
2785 #          If @id is not a valid device, DeviceNotFound
2787 # Notes: When this command completes, the device may not be removed from the
2788 #        guest.  Hot removal is an operation that requires guest cooperation.
2789 #        This command merely requests that the guest begin the hot removal
2790 #        process.  Completion of the device removal process is signaled with a
2791 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2792 #        for all devices.
2794 # Since: 0.14.0
2796 { 'command': 'device_del', 'data': {'id': 'str'} }
2799 # @dump-guest-memory
2801 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2802 # very long depending on the amount of guest memory. This command is only
2803 # supported on i386 and x86_64.
2805 # @paging: if true, do paging to get guest's memory mapping. This allows
2806 #          using gdb to process the core file.
2808 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2809 #                     of RAM. This can happen for a large guest, or a
2810 #                     malicious guest pretending to be large.
2812 #          Also, paging=true has the following limitations:
2814 #             1. The guest may be in a catastrophic state or can have corrupted
2815 #                memory, which cannot be trusted
2816 #             2. The guest can be in real-mode even if paging is enabled. For
2817 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2818 #                goes in real-mode
2820 # @protocol: the filename or file descriptor of the vmcore. The supported
2821 #            protocols are:
2823 #            1. file: the protocol starts with "file:", and the following
2824 #               string is the file's path.
2825 #            2. fd: the protocol starts with "fd:", and the following string
2826 #               is the fd's name.
2828 # @begin: #optional if specified, the starting physical address.
2830 # @length: #optional if specified, the memory size, in bytes. If you don't
2831 #          want to dump all guest's memory, please specify the start @begin
2832 #          and @length
2834 # Returns: nothing on success
2836 # Since: 1.2
2838 { 'command': 'dump-guest-memory',
2839   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2840             '*length': 'int' } }
2843 # @netdev_add:
2845 # Add a network backend.
2847 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2848 #        'vde', 'socket', 'dump' and 'bridge'
2850 # @id: the name of the new network backend
2852 # @props: #optional a list of properties to be passed to the backend in
2853 #         the format 'name=value', like 'ifname=tap0,script=no'
2855 # Notes: The semantics of @props is not well defined.  Future commands will be
2856 #        introduced that provide stronger typing for backend creation.
2858 # Since: 0.14.0
2860 # Returns: Nothing on success
2861 #          If @type is not a valid network backend, DeviceNotFound
2863 { 'command': 'netdev_add',
2864   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2865   'gen': 'no' }
2868 # @netdev_del:
2870 # Remove a network backend.
2872 # @id: the name of the network backend to remove
2874 # Returns: Nothing on success
2875 #          If @id is not a valid network backend, DeviceNotFound
2877 # Since: 0.14.0
2879 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2882 # @object-add:
2884 # Create a QOM object.
2886 # @qom-type: the class name for the object to be created
2888 # @id: the name of the new object
2890 # @props: #optional a dictionary of properties to be passed to the backend
2892 # Returns: Nothing on success
2893 #          Error if @qom-type is not a valid class name
2895 # Since: 2.0
2897 { 'command': 'object-add',
2898   'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
2899   'gen': 'no' }
2902 # @object-del:
2904 # Remove a QOM object.
2906 # @id: the name of the QOM object to remove
2908 # Returns: Nothing on success
2909 #          Error if @id is not a valid id for a QOM object
2911 # Since: 2.0
2913 { 'command': 'object-del', 'data': {'id': 'str'} }
2916 # @NetdevNoneOptions
2918 # Use it alone to have zero network devices.
2920 # Since 1.2
2922 { 'type': 'NetdevNoneOptions',
2923   'data': { } }
2926 # @NetLegacyNicOptions
2928 # Create a new Network Interface Card.
2930 # @netdev: #optional id of -netdev to connect to
2932 # @macaddr: #optional MAC address
2934 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2936 # @addr: #optional PCI device address
2938 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2940 # Since 1.2
2942 { 'type': 'NetLegacyNicOptions',
2943   'data': {
2944     '*netdev':  'str',
2945     '*macaddr': 'str',
2946     '*model':   'str',
2947     '*addr':    'str',
2948     '*vectors': 'uint32' } }
2951 # @String
2953 # A fat type wrapping 'str', to be embedded in lists.
2955 # Since 1.2
2957 { 'type': 'String',
2958   'data': {
2959     'str': 'str' } }
2962 # @NetdevUserOptions
2964 # Use the user mode network stack which requires no administrator privilege to
2965 # run.
2967 # @hostname: #optional client hostname reported by the builtin DHCP server
2969 # @restrict: #optional isolate the guest from the host
2971 # @ip: #optional legacy parameter, use net= instead
2973 # @net: #optional IP address and optional netmask
2975 # @host: #optional guest-visible address of the host
2977 # @tftp: #optional root directory of the built-in TFTP server
2979 # @bootfile: #optional BOOTP filename, for use with tftp=
2981 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2982 #             assign
2984 # @dns: #optional guest-visible address of the virtual nameserver
2986 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2987 #             to the guest
2989 # @smb: #optional root directory of the built-in SMB server
2991 # @smbserver: #optional IP address of the built-in SMB server
2993 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2994 #           endpoints
2996 # @guestfwd: #optional forward guest TCP connections
2998 # Since 1.2
3000 { 'type': 'NetdevUserOptions',
3001   'data': {
3002     '*hostname':  'str',
3003     '*restrict':  'bool',
3004     '*ip':        'str',
3005     '*net':       'str',
3006     '*host':      'str',
3007     '*tftp':      'str',
3008     '*bootfile':  'str',
3009     '*dhcpstart': 'str',
3010     '*dns':       'str',
3011     '*dnssearch': ['String'],
3012     '*smb':       'str',
3013     '*smbserver': 'str',
3014     '*hostfwd':   ['String'],
3015     '*guestfwd':  ['String'] } }
3018 # @NetdevTapOptions
3020 # Connect the host TAP network interface name to the VLAN.
3022 # @ifname: #optional interface name
3024 # @fd: #optional file descriptor of an already opened tap
3026 # @fds: #optional multiple file descriptors of already opened multiqueue capable
3027 # tap
3029 # @script: #optional script to initialize the interface
3031 # @downscript: #optional script to shut down the interface
3033 # @helper: #optional command to execute to configure bridge
3035 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3037 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3039 # @vhost: #optional enable vhost-net network accelerator
3041 # @vhostfd: #optional file descriptor of an already opened vhost net device
3043 # @vhostfds: #optional file descriptors of multiple already opened vhost net
3044 # devices
3046 # @vhostforce: #optional vhost on for non-MSIX virtio guests
3048 # @queues: #optional number of queues to be created for multiqueue capable tap
3050 # Since 1.2
3052 { 'type': 'NetdevTapOptions',
3053   'data': {
3054     '*ifname':     'str',
3055     '*fd':         'str',
3056     '*fds':        'str',
3057     '*script':     'str',
3058     '*downscript': 'str',
3059     '*helper':     'str',
3060     '*sndbuf':     'size',
3061     '*vnet_hdr':   'bool',
3062     '*vhost':      'bool',
3063     '*vhostfd':    'str',
3064     '*vhostfds':   'str',
3065     '*vhostforce': 'bool',
3066     '*queues':     'uint32'} }
3069 # @NetdevSocketOptions
3071 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3072 # socket connection.
3074 # @fd: #optional file descriptor of an already opened socket
3076 # @listen: #optional port number, and optional hostname, to listen on
3078 # @connect: #optional port number, and optional hostname, to connect to
3080 # @mcast: #optional UDP multicast address and port number
3082 # @localaddr: #optional source address and port for multicast and udp packets
3084 # @udp: #optional UDP unicast address and port number
3086 # Since 1.2
3088 { 'type': 'NetdevSocketOptions',
3089   'data': {
3090     '*fd':        'str',
3091     '*listen':    'str',
3092     '*connect':   'str',
3093     '*mcast':     'str',
3094     '*localaddr': 'str',
3095     '*udp':       'str' } }
3098 # @NetdevVdeOptions
3100 # Connect the VLAN to a vde switch running on the host.
3102 # @sock: #optional socket path
3104 # @port: #optional port number
3106 # @group: #optional group owner of socket
3108 # @mode: #optional permissions for socket
3110 # Since 1.2
3112 { 'type': 'NetdevVdeOptions',
3113   'data': {
3114     '*sock':  'str',
3115     '*port':  'uint16',
3116     '*group': 'str',
3117     '*mode':  'uint16' } }
3120 # @NetdevDumpOptions
3122 # Dump VLAN network traffic to a file.
3124 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3125 # suffixes.
3127 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3129 # Since 1.2
3131 { 'type': 'NetdevDumpOptions',
3132   'data': {
3133     '*len':  'size',
3134     '*file': 'str' } }
3137 # @NetdevBridgeOptions
3139 # Connect a host TAP network interface to a host bridge device.
3141 # @br: #optional bridge name
3143 # @helper: #optional command to execute to configure bridge
3145 # Since 1.2
3147 { 'type': 'NetdevBridgeOptions',
3148   'data': {
3149     '*br':     'str',
3150     '*helper': 'str' } }
3153 # @NetdevHubPortOptions
3155 # Connect two or more net clients through a software hub.
3157 # @hubid: hub identifier number
3159 # Since 1.2
3161 { 'type': 'NetdevHubPortOptions',
3162   'data': {
3163     'hubid':     'int32' } }
3166 # @NetdevNetmapOptions
3168 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3170 # @ifname: Either the name of an existing network interface supported by
3171 #          netmap, or the name of a VALE port (created on the fly).
3172 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3173 #          YYY are non-negative integers. XXX identifies a switch and
3174 #          YYY identifies a port of the switch. VALE ports having the
3175 #          same XXX are therefore connected to the same switch.
3177 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3179 # Since 2.0
3181 { 'type': 'NetdevNetmapOptions',
3182   'data': {
3183     'ifname':     'str',
3184     '*devname':    'str' } }
3187 # @NetClientOptions
3189 # A discriminated record of network device traits.
3191 # Since 1.2
3193 { 'union': 'NetClientOptions',
3194   'data': {
3195     'none':     'NetdevNoneOptions',
3196     'nic':      'NetLegacyNicOptions',
3197     'user':     'NetdevUserOptions',
3198     'tap':      'NetdevTapOptions',
3199     'socket':   'NetdevSocketOptions',
3200     'vde':      'NetdevVdeOptions',
3201     'dump':     'NetdevDumpOptions',
3202     'bridge':   'NetdevBridgeOptions',
3203     'hubport':  'NetdevHubPortOptions',
3204     'netmap':   'NetdevNetmapOptions' } }
3207 # @NetLegacy
3209 # Captures the configuration of a network device; legacy.
3211 # @vlan: #optional vlan number
3213 # @id: #optional identifier for monitor commands
3215 # @name: #optional identifier for monitor commands, ignored if @id is present
3217 # @opts: device type specific properties (legacy)
3219 # Since 1.2
3221 { 'type': 'NetLegacy',
3222   'data': {
3223     '*vlan': 'int32',
3224     '*id':   'str',
3225     '*name': 'str',
3226     'opts':  'NetClientOptions' } }
3229 # @Netdev
3231 # Captures the configuration of a network device.
3233 # @id: identifier for monitor commands.
3235 # @opts: device type specific properties
3237 # Since 1.2
3239 { 'type': 'Netdev',
3240   'data': {
3241     'id':   'str',
3242     'opts': 'NetClientOptions' } }
3245 # @InetSocketAddress
3247 # Captures a socket address or address range in the Internet namespace.
3249 # @host: host part of the address
3251 # @port: port part of the address, or lowest port if @to is present
3253 # @to: highest port to try
3255 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3256 #        #optional
3258 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3259 #        #optional
3261 # Since 1.3
3263 { 'type': 'InetSocketAddress',
3264   'data': {
3265     'host': 'str',
3266     'port': 'str',
3267     '*to': 'uint16',
3268     '*ipv4': 'bool',
3269     '*ipv6': 'bool' } }
3272 # @UnixSocketAddress
3274 # Captures a socket address in the local ("Unix socket") namespace.
3276 # @path: filesystem path to use
3278 # Since 1.3
3280 { 'type': 'UnixSocketAddress',
3281   'data': {
3282     'path': 'str' } }
3285 # @SocketAddress
3287 # Captures the address of a socket, which could also be a named file descriptor
3289 # Since 1.3
3291 { 'union': 'SocketAddress',
3292   'data': {
3293     'inet': 'InetSocketAddress',
3294     'unix': 'UnixSocketAddress',
3295     'fd': 'String' } }
3298 # @getfd:
3300 # Receive a file descriptor via SCM rights and assign it a name
3302 # @fdname: file descriptor name
3304 # Returns: Nothing on success
3306 # Since: 0.14.0
3308 # Notes: If @fdname already exists, the file descriptor assigned to
3309 #        it will be closed and replaced by the received file
3310 #        descriptor.
3311 #        The 'closefd' command can be used to explicitly close the
3312 #        file descriptor when it is no longer needed.
3314 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3317 # @closefd:
3319 # Close a file descriptor previously passed via SCM rights
3321 # @fdname: file descriptor name
3323 # Returns: Nothing on success
3325 # Since: 0.14.0
3327 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3330 # @MachineInfo:
3332 # Information describing a machine.
3334 # @name: the name of the machine
3336 # @alias: #optional an alias for the machine name
3338 # @default: #optional whether the machine is default
3340 # @cpu-max: maximum number of CPUs supported by the machine type
3341 #           (since 1.5.0)
3343 # Since: 1.2.0
3345 { 'type': 'MachineInfo',
3346   'data': { 'name': 'str', '*alias': 'str',
3347             '*is-default': 'bool', 'cpu-max': 'int' } }
3350 # @query-machines:
3352 # Return a list of supported machines
3354 # Returns: a list of MachineInfo
3356 # Since: 1.2.0
3358 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3361 # @CpuDefinitionInfo:
3363 # Virtual CPU definition.
3365 # @name: the name of the CPU definition
3367 # Since: 1.2.0
3369 { 'type': 'CpuDefinitionInfo',
3370   'data': { 'name': 'str' } }
3373 # @query-cpu-definitions:
3375 # Return a list of supported virtual CPU definitions
3377 # Returns: a list of CpuDefInfo
3379 # Since: 1.2.0
3381 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3383 # @AddfdInfo:
3385 # Information about a file descriptor that was added to an fd set.
3387 # @fdset-id: The ID of the fd set that @fd was added to.
3389 # @fd: The file descriptor that was received via SCM rights and
3390 #      added to the fd set.
3392 # Since: 1.2.0
3394 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3397 # @add-fd:
3399 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3401 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3403 # @opaque: #optional A free-form string that can be used to describe the fd.
3405 # Returns: @AddfdInfo on success
3406 #          If file descriptor was not received, FdNotSupplied
3407 #          If @fdset-id is a negative value, InvalidParameterValue
3409 # Notes: The list of fd sets is shared by all monitor connections.
3411 #        If @fdset-id is not specified, a new fd set will be created.
3413 # Since: 1.2.0
3415 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3416   'returns': 'AddfdInfo' }
3419 # @remove-fd:
3421 # Remove a file descriptor from an fd set.
3423 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3425 # @fd: #optional The file descriptor that is to be removed.
3427 # Returns: Nothing on success
3428 #          If @fdset-id or @fd is not found, FdNotFound
3430 # Since: 1.2.0
3432 # Notes: The list of fd sets is shared by all monitor connections.
3434 #        If @fd is not specified, all file descriptors in @fdset-id
3435 #        will be removed.
3437 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3440 # @FdsetFdInfo:
3442 # Information about a file descriptor that belongs to an fd set.
3444 # @fd: The file descriptor value.
3446 # @opaque: #optional A free-form string that can be used to describe the fd.
3448 # Since: 1.2.0
3450 { 'type': 'FdsetFdInfo',
3451   'data': {'fd': 'int', '*opaque': 'str'} }
3454 # @FdsetInfo:
3456 # Information about an fd set.
3458 # @fdset-id: The ID of the fd set.
3460 # @fds: A list of file descriptors that belong to this fd set.
3462 # Since: 1.2.0
3464 { 'type': 'FdsetInfo',
3465   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3468 # @query-fdsets:
3470 # Return information describing all fd sets.
3472 # Returns: A list of @FdsetInfo
3474 # Since: 1.2.0
3476 # Note: The list of fd sets is shared by all monitor connections.
3479 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3482 # @TargetInfo:
3484 # Information describing the QEMU target.
3486 # @arch: the target architecture (eg "x86_64", "i386", etc)
3488 # Since: 1.2.0
3490 { 'type': 'TargetInfo',
3491   'data': { 'arch': 'str' } }
3494 # @query-target:
3496 # Return information about the target for this QEMU
3498 # Returns: TargetInfo
3500 # Since: 1.2.0
3502 { 'command': 'query-target', 'returns': 'TargetInfo' }
3505 # @QKeyCode:
3507 # An enumeration of key name.
3509 # This is used by the send-key command.
3511 # Since: 1.3.0
3513 { 'enum': 'QKeyCode',
3514   'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3515             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3516             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3517             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3518             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3519             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3520             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3521             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3522             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3523             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3524             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3525             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3526             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3527             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3528              'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3531 # @KeyValue
3533 # Represents a keyboard key.
3535 # Since: 1.3.0
3537 { 'union': 'KeyValue',
3538   'data': {
3539     'number': 'int',
3540     'qcode': 'QKeyCode' } }
3543 # @send-key:
3545 # Send keys to guest.
3547 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3548 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3549 #        directly to the guest, while @KeyValue.qcode must be a valid
3550 #        @QKeyCode value
3552 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3553 #             to 100
3555 # Returns: Nothing on success
3556 #          If key is unknown or redundant, InvalidParameter
3558 # Since: 1.3.0
3561 { 'command': 'send-key',
3562   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3565 # @screendump:
3567 # Write a PPM of the VGA screen to a file.
3569 # @filename: the path of a new PPM file to store the image
3571 # Returns: Nothing on success
3573 # Since: 0.14.0
3575 { 'command': 'screendump', 'data': {'filename': 'str'} }
3578 # @nbd-server-start:
3580 # Start an NBD server listening on the given host and port.  Block
3581 # devices can then be exported using @nbd-server-add.  The NBD
3582 # server will present them as named exports; for example, another
3583 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3585 # @addr: Address on which to listen.
3587 # Returns: error if the server is already running.
3589 # Since: 1.3.0
3591 { 'command': 'nbd-server-start',
3592   'data': { 'addr': 'SocketAddress' } }
3595 # @nbd-server-add:
3597 # Export a device to QEMU's embedded NBD server.
3599 # @device: Block device to be exported
3601 # @writable: Whether clients should be able to write to the device via the
3602 #     NBD connection (default false). #optional
3604 # Returns: error if the device is already marked for export.
3606 # Since: 1.3.0
3608 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3611 # @nbd-server-stop:
3613 # Stop QEMU's embedded NBD server, and unregister all devices previously
3614 # added via @nbd-server-add.
3616 # Since: 1.3.0
3618 { 'command': 'nbd-server-stop' }
3621 # @ChardevFile:
3623 # Configuration info for file chardevs.
3625 # @in:  #optional The name of the input file
3626 # @out: The name of the output file
3628 # Since: 1.4
3630 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3631                                    'out' : 'str' } }
3634 # @ChardevHostdev:
3636 # Configuration info for device and pipe chardevs.
3638 # @device: The name of the special file for the device,
3639 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3640 # @type: What kind of device this is.
3642 # Since: 1.4
3644 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3647 # @ChardevSocket:
3649 # Configuration info for (stream) socket chardevs.
3651 # @addr: socket address to listen on (server=true)
3652 #        or connect to (server=false)
3653 # @server: #optional create server socket (default: true)
3654 # @wait: #optional wait for incoming connection on server
3655 #        sockets (default: false).
3656 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3657 # @telnet: #optional enable telnet protocol on server
3658 #          sockets (default: false)
3660 # Since: 1.4
3662 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3663                                      '*server'  : 'bool',
3664                                      '*wait'    : 'bool',
3665                                      '*nodelay' : 'bool',
3666                                      '*telnet'  : 'bool' } }
3669 # @ChardevUdp:
3671 # Configuration info for datagram socket chardevs.
3673 # @remote: remote address
3674 # @local: #optional local address
3676 # Since: 1.5
3678 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3679                                   '*local' : 'SocketAddress' } }
3682 # @ChardevMux:
3684 # Configuration info for mux chardevs.
3686 # @chardev: name of the base chardev.
3688 # Since: 1.5
3690 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3693 # @ChardevStdio:
3695 # Configuration info for stdio chardevs.
3697 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3698 #          be delivered to qemu.  Default: true in -nographic mode,
3699 #          false otherwise.
3701 # Since: 1.5
3703 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3706 # @ChardevSpiceChannel:
3708 # Configuration info for spice vm channel chardevs.
3710 # @type: kind of channel (for example vdagent).
3712 # Since: 1.5
3714 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3717 # @ChardevSpicePort:
3719 # Configuration info for spice port chardevs.
3721 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3723 # Since: 1.5
3725 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3728 # @ChardevVC:
3730 # Configuration info for virtual console chardevs.
3732 # @width:  console width,  in pixels
3733 # @height: console height, in pixels
3734 # @cols:   console width,  in chars
3735 # @rows:   console height, in chars
3737 # Since: 1.5
3739 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3740                                  '*height' : 'int',
3741                                  '*cols'   : 'int',
3742                                  '*rows'   : 'int' } }
3745 # @ChardevRingbuf:
3747 # Configuration info for ring buffer chardevs.
3749 # @size: #optional ring buffer size, must be power of two, default is 65536
3751 # Since: 1.5
3753 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3756 # @ChardevBackend:
3758 # Configuration info for the new chardev backend.
3760 # Since: 1.4
3762 { 'type': 'ChardevDummy', 'data': { } }
3764 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3765                                        'serial' : 'ChardevHostdev',
3766                                        'parallel': 'ChardevHostdev',
3767                                        'pipe'   : 'ChardevHostdev',
3768                                        'socket' : 'ChardevSocket',
3769                                        'udp'    : 'ChardevUdp',
3770                                        'pty'    : 'ChardevDummy',
3771                                        'null'   : 'ChardevDummy',
3772                                        'mux'    : 'ChardevMux',
3773                                        'msmouse': 'ChardevDummy',
3774                                        'braille': 'ChardevDummy',
3775                                        'stdio'  : 'ChardevStdio',
3776                                        'console': 'ChardevDummy',
3777                                        'spicevmc' : 'ChardevSpiceChannel',
3778                                        'spiceport' : 'ChardevSpicePort',
3779                                        'vc'     : 'ChardevVC',
3780                                        'ringbuf': 'ChardevRingbuf',
3781                                        # next one is just for compatibility
3782                                        'memory' : 'ChardevRingbuf' } }
3785 # @ChardevReturn:
3787 # Return info about the chardev backend just created.
3789 # @pty: #optional name of the slave pseudoterminal device, present if
3790 #       and only if a chardev of type 'pty' was created
3792 # Since: 1.4
3794 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3797 # @chardev-add:
3799 # Add a character device backend
3801 # @id: the chardev's ID, must be unique
3802 # @backend: backend type and parameters
3804 # Returns: ChardevReturn.
3806 # Since: 1.4
3808 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3809                                      'backend' : 'ChardevBackend' },
3810   'returns': 'ChardevReturn' }
3813 # @chardev-remove:
3815 # Remove a character device backend
3817 # @id: the chardev's ID, must exist and not be in use
3819 # Returns: Nothing on success
3821 # Since: 1.4
3823 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3826 # @TpmModel:
3828 # An enumeration of TPM models
3830 # @tpm-tis: TPM TIS model
3832 # Since: 1.5
3834 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3837 # @query-tpm-models:
3839 # Return a list of supported TPM models
3841 # Returns: a list of TpmModel
3843 # Since: 1.5
3845 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3848 # @TpmType:
3850 # An enumeration of TPM types
3852 # @passthrough: TPM passthrough type
3854 # Since: 1.5
3856 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3859 # @query-tpm-types:
3861 # Return a list of supported TPM types
3863 # Returns: a list of TpmType
3865 # Since: 1.5
3867 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3870 # @TPMPassthroughOptions:
3872 # Information about the TPM passthrough type
3874 # @path: #optional string describing the path used for accessing the TPM device
3876 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3877 #               for cancellation of TPM commands while they are executing
3879 # Since: 1.5
3881 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3882                                              '*cancel-path' : 'str'} }
3885 # @TpmTypeOptions:
3887 # A union referencing different TPM backend types' configuration options
3889 # @passthrough: The configuration options for the TPM passthrough type
3891 # Since: 1.5
3893 { 'union': 'TpmTypeOptions',
3894    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3897 # @TpmInfo:
3899 # Information about the TPM
3901 # @id: The Id of the TPM
3903 # @model: The TPM frontend model
3905 # @options: The TPM (backend) type configuration options
3907 # Since: 1.5
3909 { 'type': 'TPMInfo',
3910   'data': {'id': 'str',
3911            'model': 'TpmModel',
3912            'options': 'TpmTypeOptions' } }
3915 # @query-tpm:
3917 # Return information about the TPM device
3919 # Returns: @TPMInfo on success
3921 # Since: 1.5
3923 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3926 # @AcpiTableOptions
3928 # Specify an ACPI table on the command line to load.
3930 # At most one of @file and @data can be specified. The list of files specified
3931 # by any one of them is loaded and concatenated in order. If both are omitted,
3932 # @data is implied.
3934 # Other fields / optargs can be used to override fields of the generic ACPI
3935 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3936 # Description Table Header. If a header field is not overridden, then the
3937 # corresponding value from the concatenated blob is used (in case of @file), or
3938 # it is filled in with a hard-coded value (in case of @data).
3940 # String fields are copied into the matching ACPI member from lowest address
3941 # upwards, and silently truncated / NUL-padded to length.
3943 # @sig: #optional table signature / identifier (4 bytes)
3945 # @rev: #optional table revision number (dependent on signature, 1 byte)
3947 # @oem_id: #optional OEM identifier (6 bytes)
3949 # @oem_table_id: #optional OEM table identifier (8 bytes)
3951 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3953 # @asl_compiler_id: #optional identifier of the utility that created the table
3954 #                   (4 bytes)
3956 # @asl_compiler_rev: #optional revision number of the utility that created the
3957 #                    table (4 bytes)
3959 # @file: #optional colon (:) separated list of pathnames to load and
3960 #        concatenate as table data. The resultant binary blob is expected to
3961 #        have an ACPI table header. At least one file is required. This field
3962 #        excludes @data.
3964 # @data: #optional colon (:) separated list of pathnames to load and
3965 #        concatenate as table data. The resultant binary blob must not have an
3966 #        ACPI table header. At least one file is required. This field excludes
3967 #        @file.
3969 # Since 1.5
3971 { 'type': 'AcpiTableOptions',
3972   'data': {
3973     '*sig':               'str',
3974     '*rev':               'uint8',
3975     '*oem_id':            'str',
3976     '*oem_table_id':      'str',
3977     '*oem_rev':           'uint32',
3978     '*asl_compiler_id':   'str',
3979     '*asl_compiler_rev':  'uint32',
3980     '*file':              'str',
3981     '*data':              'str' }}
3984 # @CommandLineParameterType:
3986 # Possible types for an option parameter.
3988 # @string: accepts a character string
3990 # @boolean: accepts "on" or "off"
3992 # @number: accepts a number
3994 # @size: accepts a number followed by an optional suffix (K)ilo,
3995 #        (M)ega, (G)iga, (T)era
3997 # Since 1.5
3999 { 'enum': 'CommandLineParameterType',
4000   'data': ['string', 'boolean', 'number', 'size'] }
4003 # @CommandLineParameterInfo:
4005 # Details about a single parameter of a command line option.
4007 # @name: parameter name
4009 # @type: parameter @CommandLineParameterType
4011 # @help: #optional human readable text string, not suitable for parsing.
4013 # Since 1.5
4015 { 'type': 'CommandLineParameterInfo',
4016   'data': { 'name': 'str',
4017             'type': 'CommandLineParameterType',
4018             '*help': 'str' } }
4021 # @CommandLineOptionInfo:
4023 # Details about a command line option, including its list of parameter details
4025 # @option: option name
4027 # @parameters: an array of @CommandLineParameterInfo
4029 # Since 1.5
4031 { 'type': 'CommandLineOptionInfo',
4032   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
4035 # @query-command-line-options:
4037 # Query command line option schema.
4039 # @option: #optional option name
4041 # Returns: list of @CommandLineOptionInfo for all options (or for the given
4042 #          @option).  Returns an error if the given @option doesn't exist.
4044 # Since 1.5
4046 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
4047  'returns': ['CommandLineOptionInfo'] }
4050 # @X86CPURegister32
4052 # A X86 32-bit register
4054 # Since: 1.5
4056 { 'enum': 'X86CPURegister32',
4057   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
4060 # @X86CPUFeatureWordInfo
4062 # Information about a X86 CPU feature word
4064 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
4066 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
4067 #                   feature word
4069 # @cpuid-register: Output register containing the feature bits
4071 # @features: value of output register, containing the feature bits
4073 # Since: 1.5
4075 { 'type': 'X86CPUFeatureWordInfo',
4076   'data': { 'cpuid-input-eax': 'int',
4077             '*cpuid-input-ecx': 'int',
4078             'cpuid-register': 'X86CPURegister32',
4079             'features': 'int' } }
4082 # @RxState:
4084 # Packets receiving state
4086 # @normal: filter assigned packets according to the mac-table
4088 # @none: don't receive any assigned packet
4090 # @all: receive all assigned packets
4092 # Since: 1.6
4094 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4097 # @RxFilterInfo:
4099 # Rx-filter information for a NIC.
4101 # @name: net client name
4103 # @promiscuous: whether promiscuous mode is enabled
4105 # @multicast: multicast receive state
4107 # @unicast: unicast receive state
4109 # @broadcast-allowed: whether to receive broadcast
4111 # @multicast-overflow: multicast table is overflowed or not
4113 # @unicast-overflow: unicast table is overflowed or not
4115 # @main-mac: the main macaddr string
4117 # @vlan-table: a list of active vlan id
4119 # @unicast-table: a list of unicast macaddr string
4121 # @multicast-table: a list of multicast macaddr string
4123 # Since 1.6
4126 { 'type': 'RxFilterInfo',
4127   'data': {
4128     'name':               'str',
4129     'promiscuous':        'bool',
4130     'multicast':          'RxState',
4131     'unicast':            'RxState',
4132     'broadcast-allowed':  'bool',
4133     'multicast-overflow': 'bool',
4134     'unicast-overflow':   'bool',
4135     'main-mac':           'str',
4136     'vlan-table':         ['int'],
4137     'unicast-table':      ['str'],
4138     'multicast-table':    ['str'] }}
4141 # @query-rx-filter:
4143 # Return rx-filter information for all NICs (or for the given NIC).
4145 # @name: #optional net client name
4147 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4148 #          Returns an error if the given @name doesn't exist, or given
4149 #          NIC doesn't support rx-filter querying, or given net client
4150 #          isn't a NIC.
4152 # Since: 1.6
4154 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4155   'returns': ['RxFilterInfo'] }
4159 # @BlockdevDiscardOptions
4161 # Determines how to handle discard requests.
4163 # @ignore:      Ignore the request
4164 # @unmap:       Forward as an unmap request
4166 # Since: 1.7
4168 { 'enum': 'BlockdevDiscardOptions',
4169   'data': [ 'ignore', 'unmap' ] }
4172 # @BlockdevAioOptions
4174 # Selects the AIO backend to handle I/O requests
4176 # @threads:     Use qemu's thread pool
4177 # @native:      Use native AIO backend (only Linux and Windows)
4179 # Since: 1.7
4181 { 'enum': 'BlockdevAioOptions',
4182   'data': [ 'threads', 'native' ] }
4185 # @BlockdevCacheOptions
4187 # Includes cache-related options for block devices
4189 # @writeback:   #optional enables writeback mode for any caches (default: true)
4190 # @direct:      #optional enables use of O_DIRECT (bypass the host page cache;
4191 #               default: false)
4192 # @no-flush:    #optional ignore any flush requests for the device (default:
4193 #               false)
4195 # Since: 1.7
4197 { 'type': 'BlockdevCacheOptions',
4198   'data': { '*writeback': 'bool',
4199             '*direct': 'bool',
4200             '*no-flush': 'bool' } }
4203 # @BlockdevOptionsBase
4205 # Options that are available for all block devices, independent of the block
4206 # driver.
4208 # @driver:      block driver name
4209 # @id:          #optional id by which the new block device can be referred to.
4210 #               This is a required option on the top level of blockdev-add, and
4211 #               currently not allowed on any other level.
4212 # @node-name:   #optional the name of a block driver state node (Since 2.0)
4213 # @discard:     #optional discard-related options (default: ignore)
4214 # @cache:       #optional cache-related options
4215 # @aio:         #optional AIO backend (default: threads)
4216 # @rerror:      #optional how to handle read errors on the device
4217 #               (default: report)
4218 # @werror:      #optional how to handle write errors on the device
4219 #               (default: enospc)
4220 # @read-only:   #optional whether the block device should be read-only
4221 #               (default: false)
4223 # Since: 1.7
4225 { 'type': 'BlockdevOptionsBase',
4226   'data': { 'driver': 'str',
4227             '*id': 'str',
4228             '*node-name': 'str',
4229             '*discard': 'BlockdevDiscardOptions',
4230             '*cache': 'BlockdevCacheOptions',
4231             '*aio': 'BlockdevAioOptions',
4232             '*rerror': 'BlockdevOnError',
4233             '*werror': 'BlockdevOnError',
4234             '*read-only': 'bool' } }
4237 # @BlockdevOptionsFile
4239 # Driver specific block device options for the file backend and similar
4240 # protocols.
4242 # @filename:    path to the image file
4244 # Since: 1.7
4246 { 'type': 'BlockdevOptionsFile',
4247   'data': { 'filename': 'str' } }
4250 # @BlockdevOptionsVVFAT
4252 # Driver specific block device options for the vvfat protocol.
4254 # @dir:         directory to be exported as FAT image
4255 # @fat-type:    #optional FAT type: 12, 16 or 32
4256 # @floppy:      #optional whether to export a floppy image (true) or
4257 #               partitioned hard disk (false; default)
4258 # @rw:          #optional whether to allow write operations (default: false)
4260 # Since: 1.7
4262 { 'type': 'BlockdevOptionsVVFAT',
4263   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4264             '*rw': 'bool' } }
4267 # @BlockdevOptionsGenericFormat
4269 # Driver specific block device options for image format that have no option
4270 # besides their data source.
4272 # @file:        reference to or definition of the data source block device
4274 # Since: 1.7
4276 { 'type': 'BlockdevOptionsGenericFormat',
4277   'data': { 'file': 'BlockdevRef' } }
4280 # @BlockdevOptionsGenericCOWFormat
4282 # Driver specific block device options for image format that have no option
4283 # besides their data source and an optional backing file.
4285 # @backing:     #optional reference to or definition of the backing file block
4286 #               device (if missing, taken from the image file content). It is
4287 #               allowed to pass an empty string here in order to disable the
4288 #               default backing file.
4290 # Since: 1.7
4292 { 'type': 'BlockdevOptionsGenericCOWFormat',
4293   'base': 'BlockdevOptionsGenericFormat',
4294   'data': { '*backing': 'BlockdevRef' } }
4297 # @BlockdevOptionsQcow2
4299 # Driver specific block device options for qcow2.
4301 # @lazy-refcounts:        #optional whether to enable the lazy refcounts
4302 #                         feature (default is taken from the image file)
4304 # @pass-discard-request:  #optional whether discard requests to the qcow2
4305 #                         device should be forwarded to the data source
4307 # @pass-discard-snapshot: #optional whether discard requests for the data source
4308 #                         should be issued when a snapshot operation (e.g.
4309 #                         deleting a snapshot) frees clusters in the qcow2 file
4311 # @pass-discard-other:    #optional whether discard requests for the data source
4312 #                         should be issued on other occasions where a cluster
4313 #                         gets freed
4315 # Since: 1.7
4317 { 'type': 'BlockdevOptionsQcow2',
4318   'base': 'BlockdevOptionsGenericCOWFormat',
4319   'data': { '*lazy-refcounts': 'bool',
4320             '*pass-discard-request': 'bool',
4321             '*pass-discard-snapshot': 'bool',
4322             '*pass-discard-other': 'bool' } }
4325 # @BlkdebugEvent
4327 # Trigger events supported by blkdebug.
4329 { 'enum': 'BlkdebugEvent',
4330   'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
4331             'l1_grow.activate_table', 'l2_load', 'l2_update',
4332             'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
4333             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
4334             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
4335             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
4336             'refblock_load', 'refblock_update', 'refblock_update_part',
4337             'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
4338             'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
4339             'refblock_alloc.switch_table', 'cluster_alloc',
4340             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
4341             'flush_to_disk' ] }
4344 # @BlkdebugInjectErrorOptions
4346 # Describes a single error injection for blkdebug.
4348 # @event:       trigger event
4350 # @state:       #optional the state identifier blkdebug needs to be in to
4351 #               actually trigger the event; defaults to "any"
4353 # @errno:       #optional error identifier (errno) to be returned; defaults to
4354 #               EIO
4356 # @sector:      #optional specifies the sector index which has to be affected
4357 #               in order to actually trigger the event; defaults to "any
4358 #               sector"
4360 # @once:        #optional disables further events after this one has been
4361 #               triggered; defaults to false
4363 # @immediately: #optional fail immediately; defaults to false
4365 # Since: 2.0
4367 { 'type': 'BlkdebugInjectErrorOptions',
4368   'data': { 'event': 'BlkdebugEvent',
4369             '*state': 'int',
4370             '*errno': 'int',
4371             '*sector': 'int',
4372             '*once': 'bool',
4373             '*immediately': 'bool' } }
4376 # @BlkdebugSetStateOptions
4378 # Describes a single state-change event for blkdebug.
4380 # @event:       trigger event
4382 # @state:       #optional the current state identifier blkdebug needs to be in;
4383 #               defaults to "any"
4385 # @new_state:   the state identifier blkdebug is supposed to assume if
4386 #               this event is triggered
4388 # Since: 2.0
4390 { 'type': 'BlkdebugSetStateOptions',
4391   'data': { 'event': 'BlkdebugEvent',
4392             '*state': 'int',
4393             'new_state': 'int' } }
4396 # @BlockdevOptionsBlkdebug
4398 # Driver specific block device options for blkdebug.
4400 # @image:           underlying raw block device (or image file)
4402 # @config:          #optional filename of the configuration file
4404 # @align:           #optional required alignment for requests in bytes
4406 # @inject-error:    #optional array of error injection descriptions
4408 # @set-state:       #optional array of state-change descriptions
4410 # Since: 2.0
4412 { 'type': 'BlockdevOptionsBlkdebug',
4413   'data': { 'image': 'BlockdevRef',
4414             '*config': 'str',
4415             '*align': 'int',
4416             '*inject-error': ['BlkdebugInjectErrorOptions'],
4417             '*set-state': ['BlkdebugSetStateOptions'] } }
4420 # @BlockdevOptionsBlkverify
4422 # Driver specific block device options for blkverify.
4424 # @test:    block device to be tested
4426 # @raw:     raw image used for verification
4428 # Since: 2.0
4430 { 'type': 'BlockdevOptionsBlkverify',
4431   'data': { 'test': 'BlockdevRef',
4432             'raw': 'BlockdevRef' } }
4435 # @BlockdevOptionsQuorum
4437 # Driver specific block device options for Quorum
4439 # @blkverify:      #optional true if the driver must print content mismatch
4441 # @children:       the children block device to use
4443 # @vote_threshold: the vote limit under which a read will fail
4445 # Since: 2.0
4447 { 'type': 'BlockdevOptionsQuorum',
4448   'data': { '*blkverify': 'bool',
4449             'children': [ 'BlockdevRef' ],
4450             'vote-threshold': 'int' } }
4453 # @BlockdevOptions
4455 # Options for creating a block device.
4457 # Since: 1.7
4459 { 'union': 'BlockdevOptions',
4460   'base': 'BlockdevOptionsBase',
4461   'discriminator': 'driver',
4462   'data': {
4463       'file':       'BlockdevOptionsFile',
4464       'http':       'BlockdevOptionsFile',
4465       'https':      'BlockdevOptionsFile',
4466       'ftp':        'BlockdevOptionsFile',
4467       'ftps':       'BlockdevOptionsFile',
4468       'tftp':       'BlockdevOptionsFile',
4469 # TODO gluster: Wait for structured options
4470 # TODO iscsi: Wait for structured options
4471 # TODO nbd: Should take InetSocketAddress for 'host'?
4472 # TODO nfs: Wait for structured options
4473 # TODO rbd: Wait for structured options
4474 # TODO sheepdog: Wait for structured options
4475 # TODO ssh: Should take InetSocketAddress for 'host'?
4476       'vvfat':      'BlockdevOptionsVVFAT',
4477       'blkdebug':   'BlockdevOptionsBlkdebug',
4478       'blkverify':  'BlockdevOptionsBlkverify',
4479       'bochs':      'BlockdevOptionsGenericFormat',
4480       'cloop':      'BlockdevOptionsGenericFormat',
4481       'cow':        'BlockdevOptionsGenericCOWFormat',
4482       'dmg':        'BlockdevOptionsGenericFormat',
4483       'parallels':  'BlockdevOptionsGenericFormat',
4484       'qcow':       'BlockdevOptionsGenericCOWFormat',
4485       'qcow2':      'BlockdevOptionsQcow2',
4486       'qed':        'BlockdevOptionsGenericCOWFormat',
4487       'raw':        'BlockdevOptionsGenericFormat',
4488       'vdi':        'BlockdevOptionsGenericFormat',
4489       'vhdx':       'BlockdevOptionsGenericFormat',
4490       'vmdk':       'BlockdevOptionsGenericCOWFormat',
4491       'vpc':        'BlockdevOptionsGenericFormat',
4492       'quorum':     'BlockdevOptionsQuorum'
4493   } }
4496 # @BlockdevRef
4498 # Reference to a block device.
4500 # @definition:      defines a new block device inline
4501 # @reference:       references the ID of an existing block device. An
4502 #                   empty string means that no block device should be
4503 #                   referenced.
4505 # Since: 1.7
4507 { 'union': 'BlockdevRef',
4508   'discriminator': {},
4509   'data': { 'definition': 'BlockdevOptions',
4510             'reference': 'str' } }
4513 # @blockdev-add:
4515 # Creates a new block device.
4517 # @options: block device options for the new device
4519 # Since: 1.7
4521 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }