qdev: Add enum property types to QAPI schema
[qemu-kvm.git] / qapi-schema.json
blob2d64ce67d9b1a5f6c05243fee0257e4c3fcb9e65
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 # @DataFormat:
500 # An enumeration of data format.
502 # @utf8: Data is a UTF-8 string (RFC 3629)
504 # @base64: Data is Base64 encoded binary (RFC 3548)
506 # Since: 1.4
508 { 'enum': 'DataFormat',
509   'data': [ 'utf8', 'base64' ] }
512 # @ringbuf-write:
514 # Write to a ring buffer character device.
516 # @device: the ring buffer character device name
518 # @data: data to write
520 # @format: #optional data encoding (default 'utf8').
521 #          - base64: data must be base64 encoded text.  Its binary
522 #            decoding gets written.
523 #            Bug: invalid base64 is currently not rejected.
524 #            Whitespace *is* invalid.
525 #          - utf8: data's UTF-8 encoding is written
526 #          - data itself is always Unicode regardless of format, like
527 #            any other string.
529 # Returns: Nothing on success
531 # Since: 1.4
533 { 'command': 'ringbuf-write',
534   'data': {'device': 'str', 'data': 'str',
535            '*format': 'DataFormat'} }
538 # @ringbuf-read:
540 # Read from a ring buffer character device.
542 # @device: the ring buffer character device name
544 # @size: how many bytes to read at most
546 # @format: #optional data encoding (default 'utf8').
547 #          - base64: the data read is returned in base64 encoding.
548 #          - utf8: the data read is interpreted as UTF-8.
549 #            Bug: can screw up when the buffer contains invalid UTF-8
550 #            sequences, NUL characters, after the ring buffer lost
551 #            data, and when reading stops because the size limit is
552 #            reached.
553 #          - The return value is always Unicode regardless of format,
554 #            like any other string.
556 # Returns: data read from the device
558 # Since: 1.4
560 { 'command': 'ringbuf-read',
561   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
562   'returns': 'str' }
565 # @CommandInfo:
567 # Information about a QMP command
569 # @name: The command name
571 # Since: 0.14.0
573 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
576 # @query-commands:
578 # Return a list of supported QMP commands by this server
580 # Returns: A list of @CommandInfo for all supported commands
582 # Since: 0.14.0
584 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
587 # @EventInfo:
589 # Information about a QMP event
591 # @name: The event name
593 # Since: 1.2.0
595 { 'type': 'EventInfo', 'data': {'name': 'str'} }
598 # @query-events:
600 # Return a list of supported QMP events by this server
602 # Returns: A list of @EventInfo for all supported events
604 # Since: 1.2.0
606 { 'command': 'query-events', 'returns': ['EventInfo'] }
609 # @MigrationStats
611 # Detailed migration status.
613 # @transferred: amount of bytes already transferred to the target VM
615 # @remaining: amount of bytes remaining to be transferred to the target VM
617 # @total: total amount of bytes involved in the migration process
619 # @duplicate: number of duplicate (zero) pages (since 1.2)
621 # @skipped: number of skipped zero pages (since 1.5)
623 # @normal : number of normal pages (since 1.2)
625 # @normal-bytes: number of normal bytes sent (since 1.2)
627 # @dirty-pages-rate: number of pages dirtied by second by the
628 #        guest (since 1.3)
630 # @mbps: throughput in megabits/sec. (since 1.6)
632 # Since: 0.14.0
634 { 'type': 'MigrationStats',
635   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
636            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
637            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
638            'mbps' : 'number' } }
641 # @XBZRLECacheStats
643 # Detailed XBZRLE migration cache statistics
645 # @cache-size: XBZRLE cache size
647 # @bytes: amount of bytes already transferred to the target VM
649 # @pages: amount of pages transferred to the target VM
651 # @cache-miss: number of cache miss
653 # @overflow: number of overflows
655 # Since: 1.2
657 { 'type': 'XBZRLECacheStats',
658   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
659            'cache-miss': 'int', 'overflow': 'int' } }
662 # @MigrationInfo
664 # Information about current migration process.
666 # @status: #optional string describing the current migration status.
667 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
668 #          'cancelled'. If this field is not returned, no migration process
669 #          has been initiated
671 # @ram: #optional @MigrationStats containing detailed migration
672 #       status, only returned if status is 'active' or
673 #       'completed'. 'comppleted' (since 1.2)
675 # @disk: #optional @MigrationStats containing detailed disk migration
676 #        status, only returned if status is 'active' and it is a block
677 #        migration
679 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
680 #                migration statistics, only returned if XBZRLE feature is on and
681 #                status is 'active' or 'completed' (since 1.2)
683 # @total-time: #optional total amount of milliseconds since migration started.
684 #        If migration has ended, it returns the total migration
685 #        time. (since 1.2)
687 # @downtime: #optional only present when migration finishes correctly
688 #        total downtime in milliseconds for the guest.
689 #        (since 1.3)
691 # @expected-downtime: #optional only present while migration is active
692 #        expected downtime in milliseconds for the guest in last walk
693 #        of the dirty bitmap. (since 1.3)
695 # @setup-time: #optional amount of setup time in milliseconds _before_ the
696 #        iterations begin but _after_ the QMP command is issued. This is designed
697 #        to provide an accounting of any activities (such as RDMA pinning) which
698 #        may be expensive, but do not actually occur during the iterative
699 #        migration rounds themselves. (since 1.6)
701 # Since: 0.14.0
703 { 'type': 'MigrationInfo',
704   'data': {'*status': 'str', '*ram': 'MigrationStats',
705            '*disk': 'MigrationStats',
706            '*xbzrle-cache': 'XBZRLECacheStats',
707            '*total-time': 'int',
708            '*expected-downtime': 'int',
709            '*downtime': 'int',
710            '*setup-time': 'int'} }
713 # @query-migrate
715 # Returns information about current migration process.
717 # Returns: @MigrationInfo
719 # Since: 0.14.0
721 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
724 # @MigrationCapability
726 # Migration capabilities enumeration
728 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
729 #          This feature allows us to minimize migration traffic for certain work
730 #          loads, by sending compressed difference of the pages
732 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
733 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
734 #          Disabled by default. Experimental: may (or may not) be renamed after
735 #          further testing is complete. (since 1.6)
737 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
738 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
739 #          source and target VM to support this feature. To enable it is sufficient
740 #          to enable the capability on the source VM. The feature is disabled by
741 #          default. (since 1.6)
743 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
744 #          to speed up convergence of RAM migration. (since 1.6)
746 # Since: 1.2
748 { 'enum': 'MigrationCapability',
749   'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
752 # @MigrationCapabilityStatus
754 # Migration capability information
756 # @capability: capability enum
758 # @state: capability state bool
760 # Since: 1.2
762 { 'type': 'MigrationCapabilityStatus',
763   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
766 # @migrate-set-capabilities
768 # Enable/Disable the following migration capabilities (like xbzrle)
770 # @capabilities: json array of capability modifications to make
772 # Since: 1.2
774 { 'command': 'migrate-set-capabilities',
775   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
778 # @query-migrate-capabilities
780 # Returns information about the current migration capabilities status
782 # Returns: @MigrationCapabilitiesStatus
784 # Since: 1.2
786 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
789 # @MouseInfo:
791 # Information about a mouse device.
793 # @name: the name of the mouse device
795 # @index: the index of the mouse device
797 # @current: true if this device is currently receiving mouse events
799 # @absolute: true if this device supports absolute coordinates as input
801 # Since: 0.14.0
803 { 'type': 'MouseInfo',
804   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
805            'absolute': 'bool'} }
808 # @query-mice:
810 # Returns information about each active mouse device
812 # Returns: a list of @MouseInfo for each device
814 # Since: 0.14.0
816 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
819 # @CpuInfo:
821 # Information about a virtual CPU
823 # @CPU: the index of the virtual CPU
825 # @current: this only exists for backwards compatible and should be ignored
827 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
828 #          to a processor specific low power mode.
830 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
831 #                pointer.
832 #                If the target is Sparc, this is the PC component of the
833 #                instruction pointer.
835 # @nip: #optional If the target is PPC, the instruction pointer
837 # @npc: #optional If the target is Sparc, the NPC component of the instruction
838 #                 pointer
840 # @PC: #optional If the target is MIPS, the instruction pointer
842 # @thread_id: ID of the underlying host thread
844 # Since: 0.14.0
846 # Notes: @halted is a transient state that changes frequently.  By the time the
847 #        data is sent to the client, the guest may no longer be halted.
849 { 'type': 'CpuInfo',
850   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
851            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
854 # @query-cpus:
856 # Returns a list of information about each virtual CPU.
858 # Returns: a list of @CpuInfo for each virtual CPU
860 # Since: 0.14.0
862 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
865 # @BlockDeviceInfo:
867 # Information about the backing device for a block device.
869 # @file: the filename of the backing device
871 # @node-name: #optional the name of the block driver node (Since 2.0)
873 # @ro: true if the backing device was open read-only
875 # @drv: the name of the block format used to open the backing device. As of
876 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
877 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
878 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
879 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
881 # @backing_file: #optional the name of the backing file (for copy-on-write)
883 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
885 # @encrypted: true if the backing device is encrypted
887 # @encryption_key_missing: true if the backing device is encrypted but an
888 #                          valid encryption key is missing
890 # @bps: total throughput limit in bytes per second is specified
892 # @bps_rd: read throughput limit in bytes per second is specified
894 # @bps_wr: write throughput limit in bytes per second is specified
896 # @iops: total I/O operations per second is specified
898 # @iops_rd: read I/O operations per second is specified
900 # @iops_wr: write I/O operations per second is specified
902 # @image: the info of image used (since: 1.6)
904 # @bps_max: #optional total max in bytes (Since 1.7)
906 # @bps_rd_max: #optional read max in bytes (Since 1.7)
908 # @bps_wr_max: #optional write max in bytes (Since 1.7)
910 # @iops_max: #optional total I/O operations max (Since 1.7)
912 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
914 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
916 # @iops_size: #optional an I/O size in bytes (Since 1.7)
918 # Since: 0.14.0
921 { 'type': 'BlockDeviceInfo',
922   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
923             '*backing_file': 'str', 'backing_file_depth': 'int',
924             'encrypted': 'bool', 'encryption_key_missing': 'bool',
925             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
926             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
927             'image': 'ImageInfo',
928             '*bps_max': 'int', '*bps_rd_max': 'int',
929             '*bps_wr_max': 'int', '*iops_max': 'int',
930             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
931             '*iops_size': 'int' } }
934 # @BlockDeviceIoStatus:
936 # An enumeration of block device I/O status.
938 # @ok: The last I/O operation has succeeded
940 # @failed: The last I/O operation has failed
942 # @nospace: The last I/O operation has failed due to a no-space condition
944 # Since: 1.0
946 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
949 # @BlockDeviceMapEntry:
951 # Entry in the metadata map of the device (returned by "qemu-img map")
953 # @start: Offset in the image of the first byte described by this entry
954 #         (in bytes)
956 # @length: Length of the range described by this entry (in bytes)
958 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
959 #         before reaching one for which the range is allocated.  The value is
960 #         in the range 0 to the depth of the image chain - 1.
962 # @zero: the sectors in this range read as zeros
964 # @data: reading the image will actually read data from a file (in particular,
965 #        if @offset is present this means that the sectors are not simply
966 #        preallocated, but contain actual data in raw format)
968 # @offset: if present, the image file stores the data for this range in
969 #          raw format at the given offset.
971 # Since 1.7
973 { 'type': 'BlockDeviceMapEntry',
974   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
975             'data': 'bool', '*offset': 'int' } }
978 # @BlockDirtyInfo:
980 # Block dirty bitmap information.
982 # @count: number of dirty bytes according to the dirty bitmap
984 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
986 # Since: 1.3
988 { 'type': 'BlockDirtyInfo',
989   'data': {'count': 'int', 'granularity': 'int'} }
992 # @BlockInfo:
994 # Block device information.  This structure describes a virtual device and
995 # the backing device associated with it.
997 # @device: The device name associated with the virtual device.
999 # @type: This field is returned only for compatibility reasons, it should
1000 #        not be used (always returns 'unknown')
1002 # @removable: True if the device supports removable media.
1004 # @locked: True if the guest has locked this device from having its media
1005 #          removed
1007 # @tray_open: #optional True if the device has a tray and it is open
1008 #             (only present if removable is true)
1010 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
1011 #                 driver has one or more dirty bitmaps) (Since 2.0)
1013 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
1014 #             supports it and the VM is configured to stop on errors
1016 # @inserted: #optional @BlockDeviceInfo describing the device if media is
1017 #            present
1019 # Since:  0.14.0
1021 { 'type': 'BlockInfo',
1022   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
1023            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
1024            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
1025            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
1028 # @query-block:
1030 # Get a list of BlockInfo for all virtual block devices.
1032 # Returns: a list of @BlockInfo describing each virtual block device
1034 # Since: 0.14.0
1036 { 'command': 'query-block', 'returns': ['BlockInfo'] }
1039 # @BlockDeviceStats:
1041 # Statistics of a virtual block device or a block backing device.
1043 # @rd_bytes:      The number of bytes read by the device.
1045 # @wr_bytes:      The number of bytes written by the device.
1047 # @rd_operations: The number of read operations performed by the device.
1049 # @wr_operations: The number of write operations performed by the device.
1051 # @flush_operations: The number of cache flush operations performed by the
1052 #                    device (since 0.15.0)
1054 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
1055 #                       (since 0.15.0).
1057 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1059 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1061 # @wr_highest_offset: The offset after the greatest byte written to the
1062 #                     device.  The intended use of this information is for
1063 #                     growable sparse files (like qcow2) that are used on top
1064 #                     of a physical device.
1066 # Since: 0.14.0
1068 { 'type': 'BlockDeviceStats',
1069   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1070            'wr_operations': 'int', 'flush_operations': 'int',
1071            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1072            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1075 # @BlockStats:
1077 # Statistics of a virtual block device or a block backing device.
1079 # @device: #optional If the stats are for a virtual block device, the name
1080 #          corresponding to the virtual block device.
1082 # @stats:  A @BlockDeviceStats for the device.
1084 # @parent: #optional This describes the file block device if it has one.
1086 # @backing: #optional This describes the backing block device if it has one.
1087 #           (Since 2.0)
1089 # Since: 0.14.0
1091 { 'type': 'BlockStats',
1092   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1093            '*parent': 'BlockStats',
1094            '*backing': 'BlockStats'} }
1097 # @query-blockstats:
1099 # Query the @BlockStats for all virtual block devices.
1101 # Returns: A list of @BlockStats for each virtual block devices.
1103 # Since: 0.14.0
1105 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1108 # @VncClientInfo:
1110 # Information about a connected VNC client.
1112 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1113 #        when possible.
1115 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1116 #          'ipv4' if the client is connected via IPv4 and TCP
1117 #          'unix' if the client is connected via a unix domain socket
1118 #          'unknown' otherwise
1120 # @service: The service name of the client's port.  This may depends on the
1121 #           host system's service database so symbolic names should not be
1122 #           relied on.
1124 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1125 #              Name of the client.
1127 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1128 #                 used for authentication.
1130 # Since: 0.14.0
1132 { 'type': 'VncClientInfo',
1133   'data': {'host': 'str', 'family': 'str', 'service': 'str',
1134            '*x509_dname': 'str', '*sasl_username': 'str'} }
1137 # @VncInfo:
1139 # Information about the VNC session.
1141 # @enabled: true if the VNC server is enabled, false otherwise
1143 # @host: #optional The hostname the VNC server is bound to.  This depends on
1144 #        the name resolution on the host and may be an IP address.
1146 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1147 #                    'ipv4' if the host is listening for IPv4 connections
1148 #                    'unix' if the host is listening on a unix domain socket
1149 #                    'unknown' otherwise
1151 # @service: #optional The service name of the server's port.  This may depends
1152 #           on the host system's service database so symbolic names should not
1153 #           be relied on.
1155 # @auth: #optional the current authentication type used by the server
1156 #        'none' if no authentication is being used
1157 #        'vnc' if VNC authentication is being used
1158 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1159 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1160 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1161 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1162 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1163 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1164 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1165 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1166 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1168 # @clients: a list of @VncClientInfo of all currently connected clients
1170 # Since: 0.14.0
1172 { 'type': 'VncInfo',
1173   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1174            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1177 # @query-vnc:
1179 # Returns information about the current VNC server
1181 # Returns: @VncInfo
1183 # Since: 0.14.0
1185 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1188 # @SpiceChannel
1190 # Information about a SPICE client channel.
1192 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1193 #        when possible.
1195 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1196 #          'ipv4' if the client is connected via IPv4 and TCP
1197 #          'unix' if the client is connected via a unix domain socket
1198 #          'unknown' otherwise
1200 # @port: The client's port number.
1202 # @connection-id: SPICE connection id number.  All channels with the same id
1203 #                 belong to the same SPICE session.
1205 # @connection-type: SPICE channel type number.  "1" is the main control
1206 #                   channel, filter for this one if you want to track spice
1207 #                   sessions only
1209 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1210 #              multiple channels of the same type exist, such as multiple
1211 #              display channels in a multihead setup
1213 # @tls: true if the channel is encrypted, false otherwise.
1215 # Since: 0.14.0
1217 { 'type': 'SpiceChannel',
1218   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1219            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1220            'tls': 'bool'} }
1223 # @SpiceQueryMouseMode
1225 # An enumeration of Spice mouse states.
1227 # @client: Mouse cursor position is determined by the client.
1229 # @server: Mouse cursor position is determined by the server.
1231 # @unknown: No information is available about mouse mode used by
1232 #           the spice server.
1234 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1236 # Since: 1.1
1238 { 'enum': 'SpiceQueryMouseMode',
1239   'data': [ 'client', 'server', 'unknown' ] }
1242 # @SpiceInfo
1244 # Information about the SPICE session.
1246 # @enabled: true if the SPICE server is enabled, false otherwise
1248 # @migrated: true if the last guest migration completed and spice
1249 #            migration had completed as well. false otherwise.
1251 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1252 #        the name resolution on the host and may be an IP address.
1254 # @port: #optional The SPICE server's port number.
1256 # @compiled-version: #optional SPICE server version.
1258 # @tls-port: #optional The SPICE server's TLS port number.
1260 # @auth: #optional the current authentication type used by the server
1261 #        'none'  if no authentication is being used
1262 #        'spice' uses SASL or direct TLS authentication, depending on command
1263 #                line options
1265 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1266 #              be determined by the client or the server, or unknown if spice
1267 #              server doesn't provide this information.
1269 #              Since: 1.1
1271 # @channels: a list of @SpiceChannel for each active spice channel
1273 # Since: 0.14.0
1275 { 'type': 'SpiceInfo',
1276   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1277            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1278            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1281 # @query-spice
1283 # Returns information about the current SPICE server
1285 # Returns: @SpiceInfo
1287 # Since: 0.14.0
1289 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1292 # @BalloonInfo:
1294 # Information about the guest balloon device.
1296 # @actual: the number of bytes the balloon currently contains
1298 # Since: 0.14.0
1301 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1304 # @query-balloon:
1306 # Return information about the balloon device.
1308 # Returns: @BalloonInfo on success
1309 #          If the balloon driver is enabled but not functional because the KVM
1310 #          kernel module cannot support it, KvmMissingCap
1311 #          If no balloon device is present, DeviceNotActive
1313 # Since: 0.14.0
1315 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1318 # @PciMemoryRange:
1320 # A PCI device memory region
1322 # @base: the starting address (guest physical)
1324 # @limit: the ending address (guest physical)
1326 # Since: 0.14.0
1328 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1331 # @PciMemoryRegion
1333 # Information about a PCI device I/O region.
1335 # @bar: the index of the Base Address Register for this region
1337 # @type: 'io' if the region is a PIO region
1338 #        'memory' if the region is a MMIO region
1340 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1342 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1344 # Since: 0.14.0
1346 { 'type': 'PciMemoryRegion',
1347   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1348            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1351 # @PciBridgeInfo:
1353 # Information about a PCI Bridge device
1355 # @bus.number: primary bus interface number.  This should be the number of the
1356 #              bus the device resides on.
1358 # @bus.secondary: secondary bus interface number.  This is the number of the
1359 #                 main bus for the bridge
1361 # @bus.subordinate: This is the highest number bus that resides below the
1362 #                   bridge.
1364 # @bus.io_range: The PIO range for all devices on this bridge
1366 # @bus.memory_range: The MMIO range for all devices on this bridge
1368 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1369 #                          this bridge
1371 # @devices: a list of @PciDeviceInfo for each device on this bridge
1373 # Since: 0.14.0
1375 { 'type': 'PciBridgeInfo',
1376   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1377                     'io_range': 'PciMemoryRange',
1378                     'memory_range': 'PciMemoryRange',
1379                     'prefetchable_range': 'PciMemoryRange' },
1380            '*devices': ['PciDeviceInfo']} }
1383 # @PciDeviceInfo:
1385 # Information about a PCI device
1387 # @bus: the bus number of the device
1389 # @slot: the slot the device is located in
1391 # @function: the function of the slot used by the device
1393 # @class_info.desc: #optional a string description of the device's class
1395 # @class_info.class: the class code of the device
1397 # @id.device: the PCI device id
1399 # @id.vendor: the PCI vendor id
1401 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1403 # @qdev_id: the device name of the PCI device
1405 # @pci_bridge: if the device is a PCI bridge, the bridge information
1407 # @regions: a list of the PCI I/O regions associated with the device
1409 # Notes: the contents of @class_info.desc are not stable and should only be
1410 #        treated as informational.
1412 # Since: 0.14.0
1414 { 'type': 'PciDeviceInfo',
1415   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1416            'class_info': {'*desc': 'str', 'class': 'int'},
1417            'id': {'device': 'int', 'vendor': 'int'},
1418            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1419            'regions': ['PciMemoryRegion']} }
1422 # @PciInfo:
1424 # Information about a PCI bus
1426 # @bus: the bus index
1428 # @devices: a list of devices on this bus
1430 # Since: 0.14.0
1432 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1435 # @query-pci:
1437 # Return information about the PCI bus topology of the guest.
1439 # Returns: a list of @PciInfo for each PCI bus
1441 # Since: 0.14.0
1443 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1446 # @BlockdevOnError:
1448 # An enumeration of possible behaviors for errors on I/O operations.
1449 # The exact meaning depends on whether the I/O was initiated by a guest
1450 # or by a block job
1452 # @report: for guest operations, report the error to the guest;
1453 #          for jobs, cancel the job
1455 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1456 #          or BLOCK_JOB_ERROR)
1458 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1460 # @stop: for guest operations, stop the virtual machine;
1461 #        for jobs, pause the job
1463 # Since: 1.3
1465 { 'enum': 'BlockdevOnError',
1466   'data': ['report', 'ignore', 'enospc', 'stop'] }
1469 # @MirrorSyncMode:
1471 # An enumeration of possible behaviors for the initial synchronization
1472 # phase of storage mirroring.
1474 # @top: copies data in the topmost image to the destination
1476 # @full: copies data from all images to the destination
1478 # @none: only copy data written from now on
1480 # Since: 1.3
1482 { 'enum': 'MirrorSyncMode',
1483   'data': ['top', 'full', 'none'] }
1486 # @BlockJobType:
1488 # Type of a block job.
1490 # @commit: block commit job type, see "block-commit"
1492 # @stream: block stream job type, see "block-stream"
1494 # @mirror: drive mirror job type, see "drive-mirror"
1496 # @backup: drive backup job type, see "drive-backup"
1498 # Since: 1.7
1500 { 'enum': 'BlockJobType',
1501   'data': ['commit', 'stream', 'mirror', 'backup'] }
1504 # @BlockJobInfo:
1506 # Information about a long-running block device operation.
1508 # @type: the job type ('stream' for image streaming)
1510 # @device: the block device name
1512 # @len: the maximum progress value
1514 # @busy: false if the job is known to be in a quiescent state, with
1515 #        no pending I/O.  Since 1.3.
1517 # @paused: whether the job is paused or, if @busy is true, will
1518 #          pause itself as soon as possible.  Since 1.3.
1520 # @offset: the current progress value
1522 # @speed: the rate limit, bytes per second
1524 # @io-status: the status of the job (since 1.3)
1526 # Since: 1.1
1528 { 'type': 'BlockJobInfo',
1529   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1530            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1531            'io-status': 'BlockDeviceIoStatus'} }
1534 # @query-block-jobs:
1536 # Return information about long-running block device operations.
1538 # Returns: a list of @BlockJobInfo for each active block job
1540 # Since: 1.1
1542 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1545 # @quit:
1547 # This command will cause the QEMU process to exit gracefully.  While every
1548 # attempt is made to send the QMP response before terminating, this is not
1549 # guaranteed.  When using this interface, a premature EOF would not be
1550 # unexpected.
1552 # Since: 0.14.0
1554 { 'command': 'quit' }
1557 # @stop:
1559 # Stop all guest VCPU execution.
1561 # Since:  0.14.0
1563 # Notes:  This function will succeed even if the guest is already in the stopped
1564 #         state.  In "inmigrate" state, it will ensure that the guest
1565 #         remains paused once migration finishes, as if the -S option was
1566 #         passed on the command line.
1568 { 'command': 'stop' }
1571 # @system_reset:
1573 # Performs a hard reset of a guest.
1575 # Since: 0.14.0
1577 { 'command': 'system_reset' }
1580 # @system_powerdown:
1582 # Requests that a guest perform a powerdown operation.
1584 # Since: 0.14.0
1586 # Notes: A guest may or may not respond to this command.  This command
1587 #        returning does not indicate that a guest has accepted the request or
1588 #        that it has shut down.  Many guests will respond to this command by
1589 #        prompting the user in some way.
1591 { 'command': 'system_powerdown' }
1594 # @cpu:
1596 # This command is a nop that is only provided for the purposes of compatibility.
1598 # Since: 0.14.0
1600 # Notes: Do not use this command.
1602 { 'command': 'cpu', 'data': {'index': 'int'} }
1605 # @cpu-add
1607 # Adds CPU with specified ID
1609 # @id: ID of CPU to be created, valid values [0..max_cpus)
1611 # Returns: Nothing on success
1613 # Since 1.5
1615 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1618 # @memsave:
1620 # Save a portion of guest memory to a file.
1622 # @val: the virtual address of the guest to start from
1624 # @size: the size of memory region to save
1626 # @filename: the file to save the memory to as binary data
1628 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1629 #                       virtual address (defaults to CPU 0)
1631 # Returns: Nothing on success
1633 # Since: 0.14.0
1635 # Notes: Errors were not reliably returned until 1.1
1637 { 'command': 'memsave',
1638   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1641 # @pmemsave:
1643 # Save a portion of guest physical memory to a file.
1645 # @val: the physical address of the guest to start from
1647 # @size: the size of memory region to save
1649 # @filename: the file to save the memory to as binary data
1651 # Returns: Nothing on success
1653 # Since: 0.14.0
1655 # Notes: Errors were not reliably returned until 1.1
1657 { 'command': 'pmemsave',
1658   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1661 # @cont:
1663 # Resume guest VCPU execution.
1665 # Since:  0.14.0
1667 # Returns:  If successful, nothing
1668 #           If QEMU was started with an encrypted block device and a key has
1669 #              not yet been set, DeviceEncrypted.
1671 # Notes:  This command will succeed if the guest is currently running.  It
1672 #         will also succeed if the guest is in the "inmigrate" state; in
1673 #         this case, the effect of the command is to make sure the guest
1674 #         starts once migration finishes, removing the effect of the -S
1675 #         command line option if it was passed.
1677 { 'command': 'cont' }
1680 # @system_wakeup:
1682 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1684 # Since:  1.1
1686 # Returns:  nothing.
1688 { 'command': 'system_wakeup' }
1691 # @inject-nmi:
1693 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1695 # Returns:  If successful, nothing
1697 # Since:  0.14.0
1699 # Notes: Only x86 Virtual Machines support this command.
1701 { 'command': 'inject-nmi' }
1704 # @set_link:
1706 # Sets the link status of a virtual network adapter.
1708 # @name: the device name of the virtual network adapter
1710 # @up: true to set the link status to be up
1712 # Returns: Nothing on success
1713 #          If @name is not a valid network device, DeviceNotFound
1715 # Since: 0.14.0
1717 # Notes: Not all network adapters support setting link status.  This command
1718 #        will succeed even if the network adapter does not support link status
1719 #        notification.
1721 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1724 # @block_passwd:
1726 # This command sets the password of a block device that has not been open
1727 # with a password and requires one.
1729 # The two cases where this can happen are a block device is created through
1730 # QEMU's initial command line or a block device is changed through the legacy
1731 # @change interface.
1733 # In the event that the block device is created through the initial command
1734 # line, the VM will start in the stopped state regardless of whether '-S' is
1735 # used.  The intention is for a management tool to query the block devices to
1736 # determine which ones are encrypted, set the passwords with this command, and
1737 # then start the guest with the @cont command.
1739 # Either @device or @node-name must be set but not both.
1741 # @device: #optional the name of the block backend device to set the password on
1743 # @node-name: #optional graph node name to set the password on (Since 2.0)
1745 # @password: the password to use for the device
1747 # Returns: nothing on success
1748 #          If @device is not a valid block device, DeviceNotFound
1749 #          If @device is not encrypted, DeviceNotEncrypted
1751 # Notes:  Not all block formats support encryption and some that do are not
1752 #         able to validate that a password is correct.  Disk corruption may
1753 #         occur if an invalid password is specified.
1755 # Since: 0.14.0
1757 { 'command': 'block_passwd', 'data': {'*device': 'str',
1758                                       '*node-name': 'str', 'password': 'str'} }
1761 # @balloon:
1763 # Request the balloon driver to change its balloon size.
1765 # @value: the target size of the balloon in bytes
1767 # Returns: Nothing on success
1768 #          If the balloon driver is enabled but not functional because the KVM
1769 #            kernel module cannot support it, KvmMissingCap
1770 #          If no balloon device is present, DeviceNotActive
1772 # Notes: This command just issues a request to the guest.  When it returns,
1773 #        the balloon size may not have changed.  A guest can change the balloon
1774 #        size independent of this command.
1776 # Since: 0.14.0
1778 { 'command': 'balloon', 'data': {'value': 'int'} }
1781 # @block_resize
1783 # Resize a block image while a guest is running.
1785 # Either @device or @node-name must be set but not both.
1787 # @device: #optional the name of the device to get the image resized
1789 # @node-name: #optional graph node name to get the image resized (Since 2.0)
1791 # @size:  new image size in bytes
1793 # Returns: nothing on success
1794 #          If @device is not a valid block device, DeviceNotFound
1796 # Since: 0.14.0
1798 { 'command': 'block_resize', 'data': { '*device': 'str',
1799                                        '*node-name': 'str',
1800                                        'size': 'int' }}
1803 # @NewImageMode
1805 # An enumeration that tells QEMU how to set the backing file path in
1806 # a new image file.
1808 # @existing: QEMU should look for an existing image file.
1810 # @absolute-paths: QEMU should create a new image with absolute paths
1811 # for the backing file. If there is no backing file available, the new
1812 # image will not be backed either.
1814 # Since: 1.1
1816 { 'enum': 'NewImageMode',
1817   'data': [ 'existing', 'absolute-paths' ] }
1820 # @BlockdevSnapshot
1822 # Either @device or @node-name must be set but not both.
1824 # @device: #optional the name of the device to generate the snapshot from.
1826 # @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
1828 # @snapshot-file: the target of the new image. A new file will be created.
1830 # @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
1832 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1834 # @mode: #optional whether and how QEMU should create a new image, default is
1835 #        'absolute-paths'.
1837 { 'type': 'BlockdevSnapshot',
1838   'data': { '*device': 'str', '*node-name': 'str',
1839             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1840             '*format': 'str', '*mode': 'NewImageMode' } }
1843 # @BlockdevSnapshotInternal
1845 # @device: the name of the device to generate the snapshot from
1847 # @name: the name of the internal snapshot to be created
1849 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1850 #        exists, the operation will fail. Only some image formats support it,
1851 #        for example, qcow2, rbd, and sheepdog.
1853 # Since: 1.7
1855 { 'type': 'BlockdevSnapshotInternal',
1856   'data': { 'device': 'str', 'name': 'str' } }
1859 # @DriveBackup
1861 # @device: the name of the device which should be copied.
1863 # @target: the target of the new image. If the file exists, or if it
1864 #          is a device, the existing file/device will be used as the new
1865 #          destination.  If it does not exist, a new file will be created.
1867 # @format: #optional the format of the new destination, default is to
1868 #          probe if @mode is 'existing', else the format of the source
1870 # @sync: what parts of the disk image should be copied to the destination
1871 #        (all the disk, only the sectors allocated in the topmost image, or
1872 #        only new I/O).
1874 # @mode: #optional whether and how QEMU should create a new image, default is
1875 #        'absolute-paths'.
1877 # @speed: #optional the maximum speed, in bytes per second
1879 # @on-source-error: #optional the action to take on an error on the source,
1880 #                   default 'report'.  'stop' and 'enospc' can only be used
1881 #                   if the block device supports io-status (see BlockInfo).
1883 # @on-target-error: #optional the action to take on an error on the target,
1884 #                   default 'report' (no limitations, since this applies to
1885 #                   a different block device than @device).
1887 # Note that @on-source-error and @on-target-error only affect background I/O.
1888 # If an error occurs during a guest write request, the device's rerror/werror
1889 # actions will be used.
1891 # Since: 1.6
1893 { 'type': 'DriveBackup',
1894   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1895             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1896             '*speed': 'int',
1897             '*on-source-error': 'BlockdevOnError',
1898             '*on-target-error': 'BlockdevOnError' } }
1901 # @Abort
1903 # This action can be used to test transaction failure.
1905 # Since: 1.6
1907 { 'type': 'Abort',
1908   'data': { } }
1911 # @TransactionAction
1913 # A discriminated record of operations that can be performed with
1914 # @transaction.
1916 { 'union': 'TransactionAction',
1917   'data': {
1918        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1919        'drive-backup': 'DriveBackup',
1920        'abort': 'Abort',
1921        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1922    } }
1925 # @transaction
1927 # Executes a number of transactionable QMP commands atomically. If any
1928 # operation fails, then the entire set of actions will be abandoned and the
1929 # appropriate error returned.
1931 #  List of:
1932 #  @TransactionAction: information needed for the respective operation
1934 # Returns: nothing on success
1935 #          Errors depend on the operations of the transaction
1937 # Note: The transaction aborts on the first failure.  Therefore, there will be
1938 # information on only one failed operation returned in an error condition, and
1939 # subsequent actions will not have been attempted.
1941 # Since 1.1
1943 { 'command': 'transaction',
1944   'data': { 'actions': [ 'TransactionAction' ] } }
1947 # @blockdev-snapshot-sync
1949 # Generates a synchronous snapshot of a block device.
1951 # For the arguments, see the documentation of BlockdevSnapshot.
1953 # Returns: nothing on success
1954 #          If @device is not a valid block device, DeviceNotFound
1956 # Since 0.14.0
1958 { 'command': 'blockdev-snapshot-sync',
1959   'data': 'BlockdevSnapshot' }
1962 # @blockdev-snapshot-internal-sync
1964 # Synchronously take an internal snapshot of a block device, when the format
1965 # of the image used supports it.
1967 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1969 # Returns: nothing on success
1970 #          If @device is not a valid block device, DeviceNotFound
1971 #          If any snapshot matching @name exists, or @name is empty,
1972 #          GenericError
1973 #          If the format of the image used does not support it,
1974 #          BlockFormatFeatureNotSupported
1976 # Since 1.7
1978 { 'command': 'blockdev-snapshot-internal-sync',
1979   'data': 'BlockdevSnapshotInternal' }
1982 # @blockdev-snapshot-delete-internal-sync
1984 # Synchronously delete an internal snapshot of a block device, when the format
1985 # of the image used support it. The snapshot is identified by name or id or
1986 # both. One of the name or id is required. Return SnapshotInfo for the
1987 # successfully deleted snapshot.
1989 # @device: the name of the device to delete the snapshot from
1991 # @id: optional the snapshot's ID to be deleted
1993 # @name: optional the snapshot's name to be deleted
1995 # Returns: SnapshotInfo on success
1996 #          If @device is not a valid block device, DeviceNotFound
1997 #          If snapshot not found, GenericError
1998 #          If the format of the image used does not support it,
1999 #          BlockFormatFeatureNotSupported
2000 #          If @id and @name are both not specified, GenericError
2002 # Since 1.7
2004 { 'command': 'blockdev-snapshot-delete-internal-sync',
2005   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
2006   'returns': 'SnapshotInfo' }
2009 # @human-monitor-command:
2011 # Execute a command on the human monitor and return the output.
2013 # @command-line: the command to execute in the human monitor
2015 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2017 # Returns: the output of the command as a string
2019 # Since: 0.14.0
2021 # Notes: This command only exists as a stop-gap.  Its use is highly
2022 #        discouraged.  The semantics of this command are not guaranteed.
2024 #        Known limitations:
2026 #        o This command is stateless, this means that commands that depend
2027 #          on state information (such as getfd) might not work
2029 #       o Commands that prompt the user for data (eg. 'cont' when the block
2030 #         device is encrypted) don't currently work
2032 { 'command': 'human-monitor-command',
2033   'data': {'command-line': 'str', '*cpu-index': 'int'},
2034   'returns': 'str' }
2037 # @block-commit
2039 # Live commit of data from overlay image nodes into backing nodes - i.e.,
2040 # writes data between 'top' and 'base' into 'base'.
2042 # @device:  the name of the device
2044 # @base:   #optional The file name of the backing image to write data into.
2045 #                    If not specified, this is the deepest backing image
2047 # @top:              The file name of the backing image within the image chain,
2048 #                    which contains the topmost data to be committed down.
2050 #                    If top == base, that is an error.
2051 #                    If top == active, the job will not be completed by itself,
2052 #                    user needs to complete the job with the block-job-complete
2053 #                    command after getting the ready event. (Since 2.0)
2055 #                    If the base image is smaller than top, then the base image
2056 #                    will be resized to be the same size as top.  If top is
2057 #                    smaller than the base image, the base will not be
2058 #                    truncated.  If you want the base image size to match the
2059 #                    size of the smaller top, you can safely truncate it
2060 #                    yourself once the commit operation successfully completes.
2063 # @speed:  #optional the maximum speed, in bytes per second
2065 # Returns: Nothing on success
2066 #          If commit or stream is already active on this device, DeviceInUse
2067 #          If @device does not exist, DeviceNotFound
2068 #          If image commit is not supported by this device, NotSupported
2069 #          If @base or @top is invalid, a generic error is returned
2070 #          If @speed is invalid, InvalidParameter
2072 # Since: 1.3
2075 { 'command': 'block-commit',
2076   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
2077             '*speed': 'int' } }
2080 # @drive-backup
2082 # Start a point-in-time copy of a block device to a new destination.  The
2083 # status of ongoing drive-backup operations can be checked with
2084 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
2085 # The operation can be stopped before it has completed using the
2086 # block-job-cancel command.
2088 # For the arguments, see the documentation of DriveBackup.
2090 # Returns: nothing on success
2091 #          If @device is not a valid block device, DeviceNotFound
2093 # Since 1.6
2095 { 'command': 'drive-backup', 'data': 'DriveBackup' }
2098 # @query-named-block-nodes
2100 # Get the named block driver list
2102 # Returns: the list of BlockDeviceInfo
2104 # Since 2.0
2106 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
2109 # @drive-mirror
2111 # Start mirroring a block device's writes to a new destination.
2113 # @device:  the name of the device whose writes should be mirrored.
2115 # @target: the target of the new image. If the file exists, or if it
2116 #          is a device, the existing file/device will be used as the new
2117 #          destination.  If it does not exist, a new file will be created.
2119 # @format: #optional the format of the new destination, default is to
2120 #          probe if @mode is 'existing', else the format of the source
2122 # @mode: #optional whether and how QEMU should create a new image, default is
2123 #        'absolute-paths'.
2125 # @speed:  #optional the maximum speed, in bytes per second
2127 # @sync: what parts of the disk image should be copied to the destination
2128 #        (all the disk, only the sectors allocated in the topmost image, or
2129 #        only new I/O).
2131 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2132 #               if the image format doesn't have clusters, 4K if the clusters
2133 #               are smaller than that, else the cluster size.  Must be a
2134 #               power of 2 between 512 and 64M (since 1.4).
2136 # @buf-size: #optional maximum amount of data in flight from source to
2137 #            target (since 1.4).
2139 # @on-source-error: #optional the action to take on an error on the source,
2140 #                   default 'report'.  'stop' and 'enospc' can only be used
2141 #                   if the block device supports io-status (see BlockInfo).
2143 # @on-target-error: #optional the action to take on an error on the target,
2144 #                   default 'report' (no limitations, since this applies to
2145 #                   a different block device than @device).
2147 # Returns: nothing on success
2148 #          If @device is not a valid block device, DeviceNotFound
2150 # Since 1.3
2152 { 'command': 'drive-mirror',
2153   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2154             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2155             '*speed': 'int', '*granularity': 'uint32',
2156             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2157             '*on-target-error': 'BlockdevOnError' } }
2160 # @migrate_cancel
2162 # Cancel the current executing migration process.
2164 # Returns: nothing on success
2166 # Notes: This command succeeds even if there is no migration process running.
2168 # Since: 0.14.0
2170 { 'command': 'migrate_cancel' }
2173 # @migrate_set_downtime
2175 # Set maximum tolerated downtime for migration.
2177 # @value: maximum downtime in seconds
2179 # Returns: nothing on success
2181 # Since: 0.14.0
2183 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2186 # @migrate_set_speed
2188 # Set maximum speed for migration.
2190 # @value: maximum speed in bytes.
2192 # Returns: nothing on success
2194 # Notes: A value lesser than zero will be automatically round up to zero.
2196 # Since: 0.14.0
2198 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2201 # @migrate-set-cache-size
2203 # Set XBZRLE cache size
2205 # @value: cache size in bytes
2207 # The size will be rounded down to the nearest power of 2.
2208 # The cache size can be modified before and during ongoing migration
2210 # Returns: nothing on success
2212 # Since: 1.2
2214 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2217 # @query-migrate-cache-size
2219 # query XBZRLE cache size
2221 # Returns: XBZRLE cache size in bytes
2223 # Since: 1.2
2225 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2228 # @ObjectPropertyInfo:
2230 # @name: the name of the property
2232 # @type: the type of the property.  This will typically come in one of four
2233 #        forms:
2235 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2236 #           These types are mapped to the appropriate JSON type.
2238 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
2239 #           legacy qdev typename.  These types are always treated as strings.
2241 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
2242 #           device type name.  Child properties create the composition tree.
2244 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
2245 #           device type name.  Link properties form the device model graph.
2247 # Since: 1.2
2249 { 'type': 'ObjectPropertyInfo',
2250   'data': { 'name': 'str', 'type': 'str' } }
2253 # @qom-list:
2255 # This command will list any properties of a object given a path in the object
2256 # model.
2258 # @path: the path within the object model.  See @qom-get for a description of
2259 #        this parameter.
2261 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2262 #          object.
2264 # Since: 1.2
2266 { 'command': 'qom-list',
2267   'data': { 'path': 'str' },
2268   'returns': [ 'ObjectPropertyInfo' ] }
2271 # @qom-get:
2273 # This command will get a property from a object model path and return the
2274 # value.
2276 # @path: The path within the object model.  There are two forms of supported
2277 #        paths--absolute and partial paths.
2279 #        Absolute paths are derived from the root object and can follow child<>
2280 #        or link<> properties.  Since they can follow link<> properties, they
2281 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2282 #        and are prefixed  with a leading slash.
2284 #        Partial paths look like relative filenames.  They do not begin
2285 #        with a prefix.  The matching rules for partial paths are subtle but
2286 #        designed to make specifying objects easy.  At each level of the
2287 #        composition tree, the partial path is matched as an absolute path.
2288 #        The first match is not returned.  At least two matches are searched
2289 #        for.  A successful result is only returned if only one match is
2290 #        found.  If more than one match is found, a flag is return to
2291 #        indicate that the match was ambiguous.
2293 # @property: The property name to read
2295 # Returns: The property value.  The type depends on the property type.  legacy<>
2296 #          properties are returned as #str.  child<> and link<> properties are
2297 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2298 #          are returned as #int.
2300 # Since: 1.2
2302 { 'command': 'qom-get',
2303   'data': { 'path': 'str', 'property': 'str' },
2304   'returns': 'visitor',
2305   'gen': 'no' }
2308 # @qom-set:
2310 # This command will set a property from a object model path.
2312 # @path: see @qom-get for a description of this parameter
2314 # @property: the property name to set
2316 # @value: a value who's type is appropriate for the property type.  See @qom-get
2317 #         for a description of type mapping.
2319 # Since: 1.2
2321 { 'command': 'qom-set',
2322   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2323   'gen': 'no' }
2326 # @set_password:
2328 # Sets the password of a remote display session.
2330 # @protocol: `vnc' to modify the VNC server password
2331 #            `spice' to modify the Spice server password
2333 # @password: the new password
2335 # @connected: #optional how to handle existing clients when changing the
2336 #                       password.  If nothing is specified, defaults to `keep'
2337 #                       `fail' to fail the command if clients are connected
2338 #                       `disconnect' to disconnect existing clients
2339 #                       `keep' to maintain existing clients
2341 # Returns: Nothing on success
2342 #          If Spice is not enabled, DeviceNotFound
2344 # Since: 0.14.0
2346 { 'command': 'set_password',
2347   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2350 # @expire_password:
2352 # Expire the password of a remote display server.
2354 # @protocol: the name of the remote display protocol `vnc' or `spice'
2356 # @time: when to expire the password.
2357 #        `now' to expire the password immediately
2358 #        `never' to cancel password expiration
2359 #        `+INT' where INT is the number of seconds from now (integer)
2360 #        `INT' where INT is the absolute time in seconds
2362 # Returns: Nothing on success
2363 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2365 # Since: 0.14.0
2367 # Notes: Time is relative to the server and currently there is no way to
2368 #        coordinate server time with client time.  It is not recommended to
2369 #        use the absolute time version of the @time parameter unless you're
2370 #        sure you are on the same machine as the QEMU instance.
2372 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2375 # @eject:
2377 # Ejects a device from a removable drive.
2379 # @device:  The name of the device
2381 # @force:   @optional If true, eject regardless of whether the drive is locked.
2382 #           If not specified, the default value is false.
2384 # Returns:  Nothing on success
2385 #           If @device is not a valid block device, DeviceNotFound
2387 # Notes:    Ejecting a device will no media results in success
2389 # Since: 0.14.0
2391 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2394 # @change-vnc-password:
2396 # Change the VNC server password.
2398 # @target:  the new password to use with VNC authentication
2400 # Since: 1.1
2402 # Notes:  An empty password in this command will set the password to the empty
2403 #         string.  Existing clients are unaffected by executing this command.
2405 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2408 # @change:
2410 # This command is multiple commands multiplexed together.
2412 # @device: This is normally the name of a block device but it may also be 'vnc'.
2413 #          when it's 'vnc', then sub command depends on @target
2415 # @target: If @device is a block device, then this is the new filename.
2416 #          If @device is 'vnc', then if the value 'password' selects the vnc
2417 #          change password command.   Otherwise, this specifies a new server URI
2418 #          address to listen to for VNC connections.
2420 # @arg:    If @device is a block device, then this is an optional format to open
2421 #          the device with.
2422 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2423 #          password to set.  If this argument is an empty string, then no future
2424 #          logins will be allowed.
2426 # Returns: Nothing on success.
2427 #          If @device is not a valid block device, DeviceNotFound
2428 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2429 #          if this error is returned, the device has been opened successfully
2430 #          and an additional call to @block_passwd is required to set the
2431 #          device's password.  The behavior of reads and writes to the block
2432 #          device between when these calls are executed is undefined.
2434 # Notes:  It is strongly recommended that this interface is not used especially
2435 #         for changing block devices.
2437 # Since: 0.14.0
2439 { 'command': 'change',
2440   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2443 # @block_set_io_throttle:
2445 # Change I/O throttle limits for a block drive.
2447 # @device: The name of the device
2449 # @bps: total throughput limit in bytes per second
2451 # @bps_rd: read throughput limit in bytes per second
2453 # @bps_wr: write throughput limit in bytes per second
2455 # @iops: total I/O operations per second
2457 # @ops_rd: read I/O operations per second
2459 # @iops_wr: write I/O operations per second
2461 # @bps_max: #optional total max in bytes (Since 1.7)
2463 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2465 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2467 # @iops_max: #optional total I/O operations max (Since 1.7)
2469 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2471 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2473 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2475 # Returns: Nothing on success
2476 #          If @device is not a valid block device, DeviceNotFound
2478 # Since: 1.1
2480 { 'command': 'block_set_io_throttle',
2481   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2482             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2483             '*bps_max': 'int', '*bps_rd_max': 'int',
2484             '*bps_wr_max': 'int', '*iops_max': 'int',
2485             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2486             '*iops_size': 'int' } }
2489 # @block-stream:
2491 # Copy data from a backing file into a block device.
2493 # The block streaming operation is performed in the background until the entire
2494 # backing file has been copied.  This command returns immediately once streaming
2495 # has started.  The status of ongoing block streaming operations can be checked
2496 # with query-block-jobs.  The operation can be stopped before it has completed
2497 # using the block-job-cancel command.
2499 # If a base file is specified then sectors are not copied from that base file and
2500 # its backing chain.  When streaming completes the image file will have the base
2501 # file as its backing file.  This can be used to stream a subset of the backing
2502 # file chain instead of flattening the entire image.
2504 # On successful completion the image file is updated to drop the backing file
2505 # and the BLOCK_JOB_COMPLETED event is emitted.
2507 # @device: the device name
2509 # @base:   #optional the common backing file name
2511 # @speed:  #optional the maximum speed, in bytes per second
2513 # @on-error: #optional the action to take on an error (default report).
2514 #            'stop' and 'enospc' can only be used if the block device
2515 #            supports io-status (see BlockInfo).  Since 1.3.
2517 # Returns: Nothing on success
2518 #          If @device does not exist, DeviceNotFound
2520 # Since: 1.1
2522 { 'command': 'block-stream',
2523   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2524             '*on-error': 'BlockdevOnError' } }
2527 # @block-job-set-speed:
2529 # Set maximum speed for a background block operation.
2531 # This command can only be issued when there is an active block job.
2533 # Throttling can be disabled by setting the speed to 0.
2535 # @device: the device name
2537 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2538 #          Defaults to 0.
2540 # Returns: Nothing on success
2541 #          If no background operation is active on this device, DeviceNotActive
2543 # Since: 1.1
2545 { 'command': 'block-job-set-speed',
2546   'data': { 'device': 'str', 'speed': 'int' } }
2549 # @block-job-cancel:
2551 # Stop an active background block operation.
2553 # This command returns immediately after marking the active background block
2554 # operation for cancellation.  It is an error to call this command if no
2555 # operation is in progress.
2557 # The operation will cancel as soon as possible and then emit the
2558 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2559 # enumerated using query-block-jobs.
2561 # For streaming, the image file retains its backing file unless the streaming
2562 # operation happens to complete just as it is being cancelled.  A new streaming
2563 # operation can be started at a later time to finish copying all data from the
2564 # backing file.
2566 # @device: the device name
2568 # @force: #optional whether to allow cancellation of a paused job (default
2569 #         false).  Since 1.3.
2571 # Returns: Nothing on success
2572 #          If no background operation is active on this device, DeviceNotActive
2574 # Since: 1.1
2576 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2579 # @block-job-pause:
2581 # Pause an active background block operation.
2583 # This command returns immediately after marking the active background block
2584 # operation for pausing.  It is an error to call this command if no
2585 # operation is in progress.  Pausing an already paused job has no cumulative
2586 # effect; a single block-job-resume command will resume the job.
2588 # The operation will pause as soon as possible.  No event is emitted when
2589 # the operation is actually paused.  Cancelling a paused job automatically
2590 # resumes it.
2592 # @device: the device name
2594 # Returns: Nothing on success
2595 #          If no background operation is active on this device, DeviceNotActive
2597 # Since: 1.3
2599 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2602 # @block-job-resume:
2604 # Resume an active background block operation.
2606 # This command returns immediately after resuming a paused background block
2607 # operation.  It is an error to call this command if no operation is in
2608 # progress.  Resuming an already running job is not an error.
2610 # This command also clears the error status of the job.
2612 # @device: the device name
2614 # Returns: Nothing on success
2615 #          If no background operation is active on this device, DeviceNotActive
2617 # Since: 1.3
2619 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2622 # @block-job-complete:
2624 # Manually trigger completion of an active background block operation.  This
2625 # is supported for drive mirroring, where it also switches the device to
2626 # write to the target path only.  The ability to complete is signaled with
2627 # a BLOCK_JOB_READY event.
2629 # This command completes an active background block operation synchronously.
2630 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2631 # is not defined.  Note that if an I/O error occurs during the processing of
2632 # this command: 1) the command itself will fail; 2) the error will be processed
2633 # according to the rerror/werror arguments that were specified when starting
2634 # the operation.
2636 # A cancelled or paused job cannot be completed.
2638 # @device: the device name
2640 # Returns: Nothing on success
2641 #          If no background operation is active on this device, DeviceNotActive
2643 # Since: 1.3
2645 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2648 # @ObjectTypeInfo:
2650 # This structure describes a search result from @qom-list-types
2652 # @name: the type name found in the search
2654 # Since: 1.1
2656 # Notes: This command is experimental and may change syntax in future releases.
2658 { 'type': 'ObjectTypeInfo',
2659   'data': { 'name': 'str' } }
2662 # @qom-list-types:
2664 # This command will return a list of types given search parameters
2666 # @implements: if specified, only return types that implement this type name
2668 # @abstract: if true, include abstract types in the results
2670 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2672 # Since: 1.1
2674 { 'command': 'qom-list-types',
2675   'data': { '*implements': 'str', '*abstract': 'bool' },
2676   'returns': [ 'ObjectTypeInfo' ] }
2679 # @DevicePropertyInfo:
2681 # Information about device properties.
2683 # @name: the name of the property
2684 # @type: the typename of the property
2686 # Since: 1.2
2688 { 'type': 'DevicePropertyInfo',
2689   'data': { 'name': 'str', 'type': 'str' } }
2692 # @device-list-properties:
2694 # List properties associated with a device.
2696 # @typename: the type name of a device
2698 # Returns: a list of DevicePropertyInfo describing a devices properties
2700 # Since: 1.2
2702 { 'command': 'device-list-properties',
2703   'data': { 'typename': 'str'},
2704   'returns': [ 'DevicePropertyInfo' ] }
2707 # @migrate
2709 # Migrates the current running guest to another Virtual Machine.
2711 # @uri: the Uniform Resource Identifier of the destination VM
2713 # @blk: #optional do block migration (full disk copy)
2715 # @inc: #optional incremental disk copy migration
2717 # @detach: this argument exists only for compatibility reasons and
2718 #          is ignored by QEMU
2720 # Returns: nothing on success
2722 # Since: 0.14.0
2724 { 'command': 'migrate',
2725   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2727 # @xen-save-devices-state:
2729 # Save the state of all devices to file. The RAM and the block devices
2730 # of the VM are not saved by this command.
2732 # @filename: the file to save the state of the devices to as binary
2733 # data. See xen-save-devices-state.txt for a description of the binary
2734 # format.
2736 # Returns: Nothing on success
2738 # Since: 1.1
2740 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2743 # @xen-set-global-dirty-log
2745 # Enable or disable the global dirty log mode.
2747 # @enable: true to enable, false to disable.
2749 # Returns: nothing
2751 # Since: 1.3
2753 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2756 # @device_del:
2758 # Remove a device from a guest
2760 # @id: the name of the device
2762 # Returns: Nothing on success
2763 #          If @id is not a valid device, DeviceNotFound
2765 # Notes: When this command completes, the device may not be removed from the
2766 #        guest.  Hot removal is an operation that requires guest cooperation.
2767 #        This command merely requests that the guest begin the hot removal
2768 #        process.  Completion of the device removal process is signaled with a
2769 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2770 #        for all devices.
2772 # Since: 0.14.0
2774 { 'command': 'device_del', 'data': {'id': 'str'} }
2777 # @dump-guest-memory
2779 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2780 # very long depending on the amount of guest memory. This command is only
2781 # supported on i386 and x86_64.
2783 # @paging: if true, do paging to get guest's memory mapping. This allows
2784 #          using gdb to process the core file.
2786 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2787 #                     of RAM. This can happen for a large guest, or a
2788 #                     malicious guest pretending to be large.
2790 #          Also, paging=true has the following limitations:
2792 #             1. The guest may be in a catastrophic state or can have corrupted
2793 #                memory, which cannot be trusted
2794 #             2. The guest can be in real-mode even if paging is enabled. For
2795 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2796 #                goes in real-mode
2798 # @protocol: the filename or file descriptor of the vmcore. The supported
2799 #            protocols are:
2801 #            1. file: the protocol starts with "file:", and the following
2802 #               string is the file's path.
2803 #            2. fd: the protocol starts with "fd:", and the following string
2804 #               is the fd's name.
2806 # @begin: #optional if specified, the starting physical address.
2808 # @length: #optional if specified, the memory size, in bytes. If you don't
2809 #          want to dump all guest's memory, please specify the start @begin
2810 #          and @length
2812 # Returns: nothing on success
2814 # Since: 1.2
2816 { 'command': 'dump-guest-memory',
2817   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2818             '*length': 'int' } }
2821 # @netdev_add:
2823 # Add a network backend.
2825 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2826 #        'vde', 'socket', 'dump' and 'bridge'
2828 # @id: the name of the new network backend
2830 # @props: #optional a list of properties to be passed to the backend in
2831 #         the format 'name=value', like 'ifname=tap0,script=no'
2833 # Notes: The semantics of @props is not well defined.  Future commands will be
2834 #        introduced that provide stronger typing for backend creation.
2836 # Since: 0.14.0
2838 # Returns: Nothing on success
2839 #          If @type is not a valid network backend, DeviceNotFound
2841 { 'command': 'netdev_add',
2842   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2843   'gen': 'no' }
2846 # @netdev_del:
2848 # Remove a network backend.
2850 # @id: the name of the network backend to remove
2852 # Returns: Nothing on success
2853 #          If @id is not a valid network backend, DeviceNotFound
2855 # Since: 0.14.0
2857 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2860 # @object-add:
2862 # Create a QOM object.
2864 # @qom-type: the class name for the object to be created
2866 # @id: the name of the new object
2868 # @props: #optional a dictionary of properties to be passed to the backend
2870 # Returns: Nothing on success
2871 #          Error if @qom-type is not a valid class name
2873 # Since: 2.0
2875 { 'command': 'object-add',
2876   'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
2877   'gen': 'no' }
2880 # @object-del:
2882 # Remove a QOM object.
2884 # @id: the name of the QOM object to remove
2886 # Returns: Nothing on success
2887 #          Error if @id is not a valid id for a QOM object
2889 # Since: 2.0
2891 { 'command': 'object-del', 'data': {'id': 'str'} }
2894 # @NetdevNoneOptions
2896 # Use it alone to have zero network devices.
2898 # Since 1.2
2900 { 'type': 'NetdevNoneOptions',
2901   'data': { } }
2904 # @NetLegacyNicOptions
2906 # Create a new Network Interface Card.
2908 # @netdev: #optional id of -netdev to connect to
2910 # @macaddr: #optional MAC address
2912 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2914 # @addr: #optional PCI device address
2916 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2918 # Since 1.2
2920 { 'type': 'NetLegacyNicOptions',
2921   'data': {
2922     '*netdev':  'str',
2923     '*macaddr': 'str',
2924     '*model':   'str',
2925     '*addr':    'str',
2926     '*vectors': 'uint32' } }
2929 # @String
2931 # A fat type wrapping 'str', to be embedded in lists.
2933 # Since 1.2
2935 { 'type': 'String',
2936   'data': {
2937     'str': 'str' } }
2940 # @NetdevUserOptions
2942 # Use the user mode network stack which requires no administrator privilege to
2943 # run.
2945 # @hostname: #optional client hostname reported by the builtin DHCP server
2947 # @restrict: #optional isolate the guest from the host
2949 # @ip: #optional legacy parameter, use net= instead
2951 # @net: #optional IP address and optional netmask
2953 # @host: #optional guest-visible address of the host
2955 # @tftp: #optional root directory of the built-in TFTP server
2957 # @bootfile: #optional BOOTP filename, for use with tftp=
2959 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2960 #             assign
2962 # @dns: #optional guest-visible address of the virtual nameserver
2964 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2965 #             to the guest
2967 # @smb: #optional root directory of the built-in SMB server
2969 # @smbserver: #optional IP address of the built-in SMB server
2971 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2972 #           endpoints
2974 # @guestfwd: #optional forward guest TCP connections
2976 # Since 1.2
2978 { 'type': 'NetdevUserOptions',
2979   'data': {
2980     '*hostname':  'str',
2981     '*restrict':  'bool',
2982     '*ip':        'str',
2983     '*net':       'str',
2984     '*host':      'str',
2985     '*tftp':      'str',
2986     '*bootfile':  'str',
2987     '*dhcpstart': 'str',
2988     '*dns':       'str',
2989     '*dnssearch': ['String'],
2990     '*smb':       'str',
2991     '*smbserver': 'str',
2992     '*hostfwd':   ['String'],
2993     '*guestfwd':  ['String'] } }
2996 # @NetdevTapOptions
2998 # Connect the host TAP network interface name to the VLAN.
3000 # @ifname: #optional interface name
3002 # @fd: #optional file descriptor of an already opened tap
3004 # @fds: #optional multiple file descriptors of already opened multiqueue capable
3005 # tap
3007 # @script: #optional script to initialize the interface
3009 # @downscript: #optional script to shut down the interface
3011 # @helper: #optional command to execute to configure bridge
3013 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3015 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3017 # @vhost: #optional enable vhost-net network accelerator
3019 # @vhostfd: #optional file descriptor of an already opened vhost net device
3021 # @vhostfds: #optional file descriptors of multiple already opened vhost net
3022 # devices
3024 # @vhostforce: #optional vhost on for non-MSIX virtio guests
3026 # @queues: #optional number of queues to be created for multiqueue capable tap
3028 # Since 1.2
3030 { 'type': 'NetdevTapOptions',
3031   'data': {
3032     '*ifname':     'str',
3033     '*fd':         'str',
3034     '*fds':        'str',
3035     '*script':     'str',
3036     '*downscript': 'str',
3037     '*helper':     'str',
3038     '*sndbuf':     'size',
3039     '*vnet_hdr':   'bool',
3040     '*vhost':      'bool',
3041     '*vhostfd':    'str',
3042     '*vhostfds':   'str',
3043     '*vhostforce': 'bool',
3044     '*queues':     'uint32'} }
3047 # @NetdevSocketOptions
3049 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3050 # socket connection.
3052 # @fd: #optional file descriptor of an already opened socket
3054 # @listen: #optional port number, and optional hostname, to listen on
3056 # @connect: #optional port number, and optional hostname, to connect to
3058 # @mcast: #optional UDP multicast address and port number
3060 # @localaddr: #optional source address and port for multicast and udp packets
3062 # @udp: #optional UDP unicast address and port number
3064 # Since 1.2
3066 { 'type': 'NetdevSocketOptions',
3067   'data': {
3068     '*fd':        'str',
3069     '*listen':    'str',
3070     '*connect':   'str',
3071     '*mcast':     'str',
3072     '*localaddr': 'str',
3073     '*udp':       'str' } }
3076 # @NetdevVdeOptions
3078 # Connect the VLAN to a vde switch running on the host.
3080 # @sock: #optional socket path
3082 # @port: #optional port number
3084 # @group: #optional group owner of socket
3086 # @mode: #optional permissions for socket
3088 # Since 1.2
3090 { 'type': 'NetdevVdeOptions',
3091   'data': {
3092     '*sock':  'str',
3093     '*port':  'uint16',
3094     '*group': 'str',
3095     '*mode':  'uint16' } }
3098 # @NetdevDumpOptions
3100 # Dump VLAN network traffic to a file.
3102 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3103 # suffixes.
3105 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3107 # Since 1.2
3109 { 'type': 'NetdevDumpOptions',
3110   'data': {
3111     '*len':  'size',
3112     '*file': 'str' } }
3115 # @NetdevBridgeOptions
3117 # Connect a host TAP network interface to a host bridge device.
3119 # @br: #optional bridge name
3121 # @helper: #optional command to execute to configure bridge
3123 # Since 1.2
3125 { 'type': 'NetdevBridgeOptions',
3126   'data': {
3127     '*br':     'str',
3128     '*helper': 'str' } }
3131 # @NetdevHubPortOptions
3133 # Connect two or more net clients through a software hub.
3135 # @hubid: hub identifier number
3137 # Since 1.2
3139 { 'type': 'NetdevHubPortOptions',
3140   'data': {
3141     'hubid':     'int32' } }
3144 # @NetdevNetmapOptions
3146 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3148 # @ifname: Either the name of an existing network interface supported by
3149 #          netmap, or the name of a VALE port (created on the fly).
3150 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3151 #          YYY are non-negative integers. XXX identifies a switch and
3152 #          YYY identifies a port of the switch. VALE ports having the
3153 #          same XXX are therefore connected to the same switch.
3155 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3157 # Since 2.0
3159 { 'type': 'NetdevNetmapOptions',
3160   'data': {
3161     'ifname':     'str',
3162     '*devname':    'str' } }
3165 # @NetClientOptions
3167 # A discriminated record of network device traits.
3169 # Since 1.2
3171 { 'union': 'NetClientOptions',
3172   'data': {
3173     'none':     'NetdevNoneOptions',
3174     'nic':      'NetLegacyNicOptions',
3175     'user':     'NetdevUserOptions',
3176     'tap':      'NetdevTapOptions',
3177     'socket':   'NetdevSocketOptions',
3178     'vde':      'NetdevVdeOptions',
3179     'dump':     'NetdevDumpOptions',
3180     'bridge':   'NetdevBridgeOptions',
3181     'hubport':  'NetdevHubPortOptions',
3182     'netmap':   'NetdevNetmapOptions' } }
3185 # @NetLegacy
3187 # Captures the configuration of a network device; legacy.
3189 # @vlan: #optional vlan number
3191 # @id: #optional identifier for monitor commands
3193 # @name: #optional identifier for monitor commands, ignored if @id is present
3195 # @opts: device type specific properties (legacy)
3197 # Since 1.2
3199 { 'type': 'NetLegacy',
3200   'data': {
3201     '*vlan': 'int32',
3202     '*id':   'str',
3203     '*name': 'str',
3204     'opts':  'NetClientOptions' } }
3207 # @Netdev
3209 # Captures the configuration of a network device.
3211 # @id: identifier for monitor commands.
3213 # @opts: device type specific properties
3215 # Since 1.2
3217 { 'type': 'Netdev',
3218   'data': {
3219     'id':   'str',
3220     'opts': 'NetClientOptions' } }
3223 # @InetSocketAddress
3225 # Captures a socket address or address range in the Internet namespace.
3227 # @host: host part of the address
3229 # @port: port part of the address, or lowest port if @to is present
3231 # @to: highest port to try
3233 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3234 #        #optional
3236 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3237 #        #optional
3239 # Since 1.3
3241 { 'type': 'InetSocketAddress',
3242   'data': {
3243     'host': 'str',
3244     'port': 'str',
3245     '*to': 'uint16',
3246     '*ipv4': 'bool',
3247     '*ipv6': 'bool' } }
3250 # @UnixSocketAddress
3252 # Captures a socket address in the local ("Unix socket") namespace.
3254 # @path: filesystem path to use
3256 # Since 1.3
3258 { 'type': 'UnixSocketAddress',
3259   'data': {
3260     'path': 'str' } }
3263 # @SocketAddress
3265 # Captures the address of a socket, which could also be a named file descriptor
3267 # Since 1.3
3269 { 'union': 'SocketAddress',
3270   'data': {
3271     'inet': 'InetSocketAddress',
3272     'unix': 'UnixSocketAddress',
3273     'fd': 'String' } }
3276 # @getfd:
3278 # Receive a file descriptor via SCM rights and assign it a name
3280 # @fdname: file descriptor name
3282 # Returns: Nothing on success
3284 # Since: 0.14.0
3286 # Notes: If @fdname already exists, the file descriptor assigned to
3287 #        it will be closed and replaced by the received file
3288 #        descriptor.
3289 #        The 'closefd' command can be used to explicitly close the
3290 #        file descriptor when it is no longer needed.
3292 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3295 # @closefd:
3297 # Close a file descriptor previously passed via SCM rights
3299 # @fdname: file descriptor name
3301 # Returns: Nothing on success
3303 # Since: 0.14.0
3305 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3308 # @MachineInfo:
3310 # Information describing a machine.
3312 # @name: the name of the machine
3314 # @alias: #optional an alias for the machine name
3316 # @default: #optional whether the machine is default
3318 # @cpu-max: maximum number of CPUs supported by the machine type
3319 #           (since 1.5.0)
3321 # Since: 1.2.0
3323 { 'type': 'MachineInfo',
3324   'data': { 'name': 'str', '*alias': 'str',
3325             '*is-default': 'bool', 'cpu-max': 'int' } }
3328 # @query-machines:
3330 # Return a list of supported machines
3332 # Returns: a list of MachineInfo
3334 # Since: 1.2.0
3336 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3339 # @CpuDefinitionInfo:
3341 # Virtual CPU definition.
3343 # @name: the name of the CPU definition
3345 # Since: 1.2.0
3347 { 'type': 'CpuDefinitionInfo',
3348   'data': { 'name': 'str' } }
3351 # @query-cpu-definitions:
3353 # Return a list of supported virtual CPU definitions
3355 # Returns: a list of CpuDefInfo
3357 # Since: 1.2.0
3359 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3361 # @AddfdInfo:
3363 # Information about a file descriptor that was added to an fd set.
3365 # @fdset-id: The ID of the fd set that @fd was added to.
3367 # @fd: The file descriptor that was received via SCM rights and
3368 #      added to the fd set.
3370 # Since: 1.2.0
3372 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3375 # @add-fd:
3377 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3379 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3381 # @opaque: #optional A free-form string that can be used to describe the fd.
3383 # Returns: @AddfdInfo on success
3384 #          If file descriptor was not received, FdNotSupplied
3385 #          If @fdset-id is a negative value, InvalidParameterValue
3387 # Notes: The list of fd sets is shared by all monitor connections.
3389 #        If @fdset-id is not specified, a new fd set will be created.
3391 # Since: 1.2.0
3393 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3394   'returns': 'AddfdInfo' }
3397 # @remove-fd:
3399 # Remove a file descriptor from an fd set.
3401 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3403 # @fd: #optional The file descriptor that is to be removed.
3405 # Returns: Nothing on success
3406 #          If @fdset-id or @fd is not found, FdNotFound
3408 # Since: 1.2.0
3410 # Notes: The list of fd sets is shared by all monitor connections.
3412 #        If @fd is not specified, all file descriptors in @fdset-id
3413 #        will be removed.
3415 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3418 # @FdsetFdInfo:
3420 # Information about a file descriptor that belongs to an fd set.
3422 # @fd: The file descriptor value.
3424 # @opaque: #optional A free-form string that can be used to describe the fd.
3426 # Since: 1.2.0
3428 { 'type': 'FdsetFdInfo',
3429   'data': {'fd': 'int', '*opaque': 'str'} }
3432 # @FdsetInfo:
3434 # Information about an fd set.
3436 # @fdset-id: The ID of the fd set.
3438 # @fds: A list of file descriptors that belong to this fd set.
3440 # Since: 1.2.0
3442 { 'type': 'FdsetInfo',
3443   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3446 # @query-fdsets:
3448 # Return information describing all fd sets.
3450 # Returns: A list of @FdsetInfo
3452 # Since: 1.2.0
3454 # Note: The list of fd sets is shared by all monitor connections.
3457 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3460 # @TargetInfo:
3462 # Information describing the QEMU target.
3464 # @arch: the target architecture (eg "x86_64", "i386", etc)
3466 # Since: 1.2.0
3468 { 'type': 'TargetInfo',
3469   'data': { 'arch': 'str' } }
3472 # @query-target:
3474 # Return information about the target for this QEMU
3476 # Returns: TargetInfo
3478 # Since: 1.2.0
3480 { 'command': 'query-target', 'returns': 'TargetInfo' }
3483 # @QKeyCode:
3485 # An enumeration of key name.
3487 # This is used by the send-key command.
3489 # Since: 1.3.0
3491 { 'enum': 'QKeyCode',
3492   'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3493             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3494             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3495             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3496             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3497             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3498             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3499             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3500             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3501             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3502             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3503             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3504             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3505             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3506              'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3509 # @KeyValue
3511 # Represents a keyboard key.
3513 # Since: 1.3.0
3515 { 'union': 'KeyValue',
3516   'data': {
3517     'number': 'int',
3518     'qcode': 'QKeyCode' } }
3521 # @send-key:
3523 # Send keys to guest.
3525 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3526 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3527 #        directly to the guest, while @KeyValue.qcode must be a valid
3528 #        @QKeyCode value
3530 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3531 #             to 100
3533 # Returns: Nothing on success
3534 #          If key is unknown or redundant, InvalidParameter
3536 # Since: 1.3.0
3539 { 'command': 'send-key',
3540   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3543 # @screendump:
3545 # Write a PPM of the VGA screen to a file.
3547 # @filename: the path of a new PPM file to store the image
3549 # Returns: Nothing on success
3551 # Since: 0.14.0
3553 { 'command': 'screendump', 'data': {'filename': 'str'} }
3556 # @nbd-server-start:
3558 # Start an NBD server listening on the given host and port.  Block
3559 # devices can then be exported using @nbd-server-add.  The NBD
3560 # server will present them as named exports; for example, another
3561 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3563 # @addr: Address on which to listen.
3565 # Returns: error if the server is already running.
3567 # Since: 1.3.0
3569 { 'command': 'nbd-server-start',
3570   'data': { 'addr': 'SocketAddress' } }
3573 # @nbd-server-add:
3575 # Export a device to QEMU's embedded NBD server.
3577 # @device: Block device to be exported
3579 # @writable: Whether clients should be able to write to the device via the
3580 #     NBD connection (default false). #optional
3582 # Returns: error if the device is already marked for export.
3584 # Since: 1.3.0
3586 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3589 # @nbd-server-stop:
3591 # Stop QEMU's embedded NBD server, and unregister all devices previously
3592 # added via @nbd-server-add.
3594 # Since: 1.3.0
3596 { 'command': 'nbd-server-stop' }
3599 # @ChardevFile:
3601 # Configuration info for file chardevs.
3603 # @in:  #optional The name of the input file
3604 # @out: The name of the output file
3606 # Since: 1.4
3608 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3609                                    'out' : 'str' } }
3612 # @ChardevHostdev:
3614 # Configuration info for device and pipe chardevs.
3616 # @device: The name of the special file for the device,
3617 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3618 # @type: What kind of device this is.
3620 # Since: 1.4
3622 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3625 # @ChardevSocket:
3627 # Configuration info for (stream) socket chardevs.
3629 # @addr: socket address to listen on (server=true)
3630 #        or connect to (server=false)
3631 # @server: #optional create server socket (default: true)
3632 # @wait: #optional wait for incoming connection on server
3633 #        sockets (default: false).
3634 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3635 # @telnet: #optional enable telnet protocol on server
3636 #          sockets (default: false)
3638 # Since: 1.4
3640 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3641                                      '*server'  : 'bool',
3642                                      '*wait'    : 'bool',
3643                                      '*nodelay' : 'bool',
3644                                      '*telnet'  : 'bool' } }
3647 # @ChardevUdp:
3649 # Configuration info for datagram socket chardevs.
3651 # @remote: remote address
3652 # @local: #optional local address
3654 # Since: 1.5
3656 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3657                                   '*local' : 'SocketAddress' } }
3660 # @ChardevMux:
3662 # Configuration info for mux chardevs.
3664 # @chardev: name of the base chardev.
3666 # Since: 1.5
3668 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3671 # @ChardevStdio:
3673 # Configuration info for stdio chardevs.
3675 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3676 #          be delivered to qemu.  Default: true in -nographic mode,
3677 #          false otherwise.
3679 # Since: 1.5
3681 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3684 # @ChardevSpiceChannel:
3686 # Configuration info for spice vm channel chardevs.
3688 # @type: kind of channel (for example vdagent).
3690 # Since: 1.5
3692 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3695 # @ChardevSpicePort:
3697 # Configuration info for spice port chardevs.
3699 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3701 # Since: 1.5
3703 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3706 # @ChardevVC:
3708 # Configuration info for virtual console chardevs.
3710 # @width:  console width,  in pixels
3711 # @height: console height, in pixels
3712 # @cols:   console width,  in chars
3713 # @rows:   console height, in chars
3715 # Since: 1.5
3717 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3718                                  '*height' : 'int',
3719                                  '*cols'   : 'int',
3720                                  '*rows'   : 'int' } }
3723 # @ChardevRingbuf:
3725 # Configuration info for ring buffer chardevs.
3727 # @size: #optional ring buffer size, must be power of two, default is 65536
3729 # Since: 1.5
3731 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3734 # @ChardevBackend:
3736 # Configuration info for the new chardev backend.
3738 # Since: 1.4
3740 { 'type': 'ChardevDummy', 'data': { } }
3742 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3743                                        'serial' : 'ChardevHostdev',
3744                                        'parallel': 'ChardevHostdev',
3745                                        'pipe'   : 'ChardevHostdev',
3746                                        'socket' : 'ChardevSocket',
3747                                        'udp'    : 'ChardevUdp',
3748                                        'pty'    : 'ChardevDummy',
3749                                        'null'   : 'ChardevDummy',
3750                                        'mux'    : 'ChardevMux',
3751                                        'msmouse': 'ChardevDummy',
3752                                        'braille': 'ChardevDummy',
3753                                        'stdio'  : 'ChardevStdio',
3754                                        'console': 'ChardevDummy',
3755                                        'spicevmc' : 'ChardevSpiceChannel',
3756                                        'spiceport' : 'ChardevSpicePort',
3757                                        'vc'     : 'ChardevVC',
3758                                        'ringbuf': 'ChardevRingbuf',
3759                                        # next one is just for compatibility
3760                                        'memory' : 'ChardevRingbuf' } }
3763 # @ChardevReturn:
3765 # Return info about the chardev backend just created.
3767 # @pty: #optional name of the slave pseudoterminal device, present if
3768 #       and only if a chardev of type 'pty' was created
3770 # Since: 1.4
3772 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3775 # @chardev-add:
3777 # Add a character device backend
3779 # @id: the chardev's ID, must be unique
3780 # @backend: backend type and parameters
3782 # Returns: ChardevReturn.
3784 # Since: 1.4
3786 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3787                                      'backend' : 'ChardevBackend' },
3788   'returns': 'ChardevReturn' }
3791 # @chardev-remove:
3793 # Remove a character device backend
3795 # @id: the chardev's ID, must exist and not be in use
3797 # Returns: Nothing on success
3799 # Since: 1.4
3801 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3804 # @TpmModel:
3806 # An enumeration of TPM models
3808 # @tpm-tis: TPM TIS model
3810 # Since: 1.5
3812 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3815 # @query-tpm-models:
3817 # Return a list of supported TPM models
3819 # Returns: a list of TpmModel
3821 # Since: 1.5
3823 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3826 # @TpmType:
3828 # An enumeration of TPM types
3830 # @passthrough: TPM passthrough type
3832 # Since: 1.5
3834 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3837 # @query-tpm-types:
3839 # Return a list of supported TPM types
3841 # Returns: a list of TpmType
3843 # Since: 1.5
3845 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3848 # @TPMPassthroughOptions:
3850 # Information about the TPM passthrough type
3852 # @path: #optional string describing the path used for accessing the TPM device
3854 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3855 #               for cancellation of TPM commands while they are executing
3857 # Since: 1.5
3859 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3860                                              '*cancel-path' : 'str'} }
3863 # @TpmTypeOptions:
3865 # A union referencing different TPM backend types' configuration options
3867 # @passthrough: The configuration options for the TPM passthrough type
3869 # Since: 1.5
3871 { 'union': 'TpmTypeOptions',
3872    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3875 # @TpmInfo:
3877 # Information about the TPM
3879 # @id: The Id of the TPM
3881 # @model: The TPM frontend model
3883 # @options: The TPM (backend) type configuration options
3885 # Since: 1.5
3887 { 'type': 'TPMInfo',
3888   'data': {'id': 'str',
3889            'model': 'TpmModel',
3890            'options': 'TpmTypeOptions' } }
3893 # @query-tpm:
3895 # Return information about the TPM device
3897 # Returns: @TPMInfo on success
3899 # Since: 1.5
3901 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3904 # @AcpiTableOptions
3906 # Specify an ACPI table on the command line to load.
3908 # At most one of @file and @data can be specified. The list of files specified
3909 # by any one of them is loaded and concatenated in order. If both are omitted,
3910 # @data is implied.
3912 # Other fields / optargs can be used to override fields of the generic ACPI
3913 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3914 # Description Table Header. If a header field is not overridden, then the
3915 # corresponding value from the concatenated blob is used (in case of @file), or
3916 # it is filled in with a hard-coded value (in case of @data).
3918 # String fields are copied into the matching ACPI member from lowest address
3919 # upwards, and silently truncated / NUL-padded to length.
3921 # @sig: #optional table signature / identifier (4 bytes)
3923 # @rev: #optional table revision number (dependent on signature, 1 byte)
3925 # @oem_id: #optional OEM identifier (6 bytes)
3927 # @oem_table_id: #optional OEM table identifier (8 bytes)
3929 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3931 # @asl_compiler_id: #optional identifier of the utility that created the table
3932 #                   (4 bytes)
3934 # @asl_compiler_rev: #optional revision number of the utility that created the
3935 #                    table (4 bytes)
3937 # @file: #optional colon (:) separated list of pathnames to load and
3938 #        concatenate as table data. The resultant binary blob is expected to
3939 #        have an ACPI table header. At least one file is required. This field
3940 #        excludes @data.
3942 # @data: #optional colon (:) separated list of pathnames to load and
3943 #        concatenate as table data. The resultant binary blob must not have an
3944 #        ACPI table header. At least one file is required. This field excludes
3945 #        @file.
3947 # Since 1.5
3949 { 'type': 'AcpiTableOptions',
3950   'data': {
3951     '*sig':               'str',
3952     '*rev':               'uint8',
3953     '*oem_id':            'str',
3954     '*oem_table_id':      'str',
3955     '*oem_rev':           'uint32',
3956     '*asl_compiler_id':   'str',
3957     '*asl_compiler_rev':  'uint32',
3958     '*file':              'str',
3959     '*data':              'str' }}
3962 # @CommandLineParameterType:
3964 # Possible types for an option parameter.
3966 # @string: accepts a character string
3968 # @boolean: accepts "on" or "off"
3970 # @number: accepts a number
3972 # @size: accepts a number followed by an optional suffix (K)ilo,
3973 #        (M)ega, (G)iga, (T)era
3975 # Since 1.5
3977 { 'enum': 'CommandLineParameterType',
3978   'data': ['string', 'boolean', 'number', 'size'] }
3981 # @CommandLineParameterInfo:
3983 # Details about a single parameter of a command line option.
3985 # @name: parameter name
3987 # @type: parameter @CommandLineParameterType
3989 # @help: #optional human readable text string, not suitable for parsing.
3991 # Since 1.5
3993 { 'type': 'CommandLineParameterInfo',
3994   'data': { 'name': 'str',
3995             'type': 'CommandLineParameterType',
3996             '*help': 'str' } }
3999 # @CommandLineOptionInfo:
4001 # Details about a command line option, including its list of parameter details
4003 # @option: option name
4005 # @parameters: an array of @CommandLineParameterInfo
4007 # Since 1.5
4009 { 'type': 'CommandLineOptionInfo',
4010   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
4013 # @query-command-line-options:
4015 # Query command line option schema.
4017 # @option: #optional option name
4019 # Returns: list of @CommandLineOptionInfo for all options (or for the given
4020 #          @option).  Returns an error if the given @option doesn't exist.
4022 # Since 1.5
4024 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
4025  'returns': ['CommandLineOptionInfo'] }
4028 # @X86CPURegister32
4030 # A X86 32-bit register
4032 # Since: 1.5
4034 { 'enum': 'X86CPURegister32',
4035   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
4038 # @X86CPUFeatureWordInfo
4040 # Information about a X86 CPU feature word
4042 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
4044 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
4045 #                   feature word
4047 # @cpuid-register: Output register containing the feature bits
4049 # @features: value of output register, containing the feature bits
4051 # Since: 1.5
4053 { 'type': 'X86CPUFeatureWordInfo',
4054   'data': { 'cpuid-input-eax': 'int',
4055             '*cpuid-input-ecx': 'int',
4056             'cpuid-register': 'X86CPURegister32',
4057             'features': 'int' } }
4060 # @RxState:
4062 # Packets receiving state
4064 # @normal: filter assigned packets according to the mac-table
4066 # @none: don't receive any assigned packet
4068 # @all: receive all assigned packets
4070 # Since: 1.6
4072 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4075 # @RxFilterInfo:
4077 # Rx-filter information for a NIC.
4079 # @name: net client name
4081 # @promiscuous: whether promiscuous mode is enabled
4083 # @multicast: multicast receive state
4085 # @unicast: unicast receive state
4087 # @broadcast-allowed: whether to receive broadcast
4089 # @multicast-overflow: multicast table is overflowed or not
4091 # @unicast-overflow: unicast table is overflowed or not
4093 # @main-mac: the main macaddr string
4095 # @vlan-table: a list of active vlan id
4097 # @unicast-table: a list of unicast macaddr string
4099 # @multicast-table: a list of multicast macaddr string
4101 # Since 1.6
4104 { 'type': 'RxFilterInfo',
4105   'data': {
4106     'name':               'str',
4107     'promiscuous':        'bool',
4108     'multicast':          'RxState',
4109     'unicast':            'RxState',
4110     'broadcast-allowed':  'bool',
4111     'multicast-overflow': 'bool',
4112     'unicast-overflow':   'bool',
4113     'main-mac':           'str',
4114     'vlan-table':         ['int'],
4115     'unicast-table':      ['str'],
4116     'multicast-table':    ['str'] }}
4119 # @query-rx-filter:
4121 # Return rx-filter information for all NICs (or for the given NIC).
4123 # @name: #optional net client name
4125 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4126 #          Returns an error if the given @name doesn't exist, or given
4127 #          NIC doesn't support rx-filter querying, or given net client
4128 #          isn't a NIC.
4130 # Since: 1.6
4132 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4133   'returns': ['RxFilterInfo'] }
4137 # @BlockdevDiscardOptions
4139 # Determines how to handle discard requests.
4141 # @ignore:      Ignore the request
4142 # @unmap:       Forward as an unmap request
4144 # Since: 1.7
4146 { 'enum': 'BlockdevDiscardOptions',
4147   'data': [ 'ignore', 'unmap' ] }
4150 # @BlockdevAioOptions
4152 # Selects the AIO backend to handle I/O requests
4154 # @threads:     Use qemu's thread pool
4155 # @native:      Use native AIO backend (only Linux and Windows)
4157 # Since: 1.7
4159 { 'enum': 'BlockdevAioOptions',
4160   'data': [ 'threads', 'native' ] }
4163 # @BlockdevCacheOptions
4165 # Includes cache-related options for block devices
4167 # @writeback:   #optional enables writeback mode for any caches (default: true)
4168 # @direct:      #optional enables use of O_DIRECT (bypass the host page cache;
4169 #               default: false)
4170 # @no-flush:    #optional ignore any flush requests for the device (default:
4171 #               false)
4173 # Since: 1.7
4175 { 'type': 'BlockdevCacheOptions',
4176   'data': { '*writeback': 'bool',
4177             '*direct': 'bool',
4178             '*no-flush': 'bool' } }
4181 # @BlockdevOptionsBase
4183 # Options that are available for all block devices, independent of the block
4184 # driver.
4186 # @driver:      block driver name
4187 # @id:          #optional id by which the new block device can be referred to.
4188 #               This is a required option on the top level of blockdev-add, and
4189 #               currently not allowed on any other level.
4190 # @node-name:   #optional the name of a block driver state node (Since 2.0)
4191 # @discard:     #optional discard-related options (default: ignore)
4192 # @cache:       #optional cache-related options
4193 # @aio:         #optional AIO backend (default: threads)
4194 # @rerror:      #optional how to handle read errors on the device
4195 #               (default: report)
4196 # @werror:      #optional how to handle write errors on the device
4197 #               (default: enospc)
4198 # @read-only:   #optional whether the block device should be read-only
4199 #               (default: false)
4201 # Since: 1.7
4203 { 'type': 'BlockdevOptionsBase',
4204   'data': { 'driver': 'str',
4205             '*id': 'str',
4206             '*node-name': 'str',
4207             '*discard': 'BlockdevDiscardOptions',
4208             '*cache': 'BlockdevCacheOptions',
4209             '*aio': 'BlockdevAioOptions',
4210             '*rerror': 'BlockdevOnError',
4211             '*werror': 'BlockdevOnError',
4212             '*read-only': 'bool' } }
4215 # @BlockdevOptionsFile
4217 # Driver specific block device options for the file backend and similar
4218 # protocols.
4220 # @filename:    path to the image file
4222 # Since: 1.7
4224 { 'type': 'BlockdevOptionsFile',
4225   'data': { 'filename': 'str' } }
4228 # @BlockdevOptionsVVFAT
4230 # Driver specific block device options for the vvfat protocol.
4232 # @dir:         directory to be exported as FAT image
4233 # @fat-type:    #optional FAT type: 12, 16 or 32
4234 # @floppy:      #optional whether to export a floppy image (true) or
4235 #               partitioned hard disk (false; default)
4236 # @rw:          #optional whether to allow write operations (default: false)
4238 # Since: 1.7
4240 { 'type': 'BlockdevOptionsVVFAT',
4241   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4242             '*rw': 'bool' } }
4245 # @BlockdevOptionsGenericFormat
4247 # Driver specific block device options for image format that have no option
4248 # besides their data source.
4250 # @file:        reference to or definition of the data source block device
4252 # Since: 1.7
4254 { 'type': 'BlockdevOptionsGenericFormat',
4255   'data': { 'file': 'BlockdevRef' } }
4258 # @BlockdevOptionsGenericCOWFormat
4260 # Driver specific block device options for image format that have no option
4261 # besides their data source and an optional backing file.
4263 # @backing:     #optional reference to or definition of the backing file block
4264 #               device (if missing, taken from the image file content). It is
4265 #               allowed to pass an empty string here in order to disable the
4266 #               default backing file.
4268 # Since: 1.7
4270 { 'type': 'BlockdevOptionsGenericCOWFormat',
4271   'base': 'BlockdevOptionsGenericFormat',
4272   'data': { '*backing': 'BlockdevRef' } }
4275 # @BlockdevOptionsQcow2
4277 # Driver specific block device options for qcow2.
4279 # @lazy-refcounts:        #optional whether to enable the lazy refcounts
4280 #                         feature (default is taken from the image file)
4282 # @pass-discard-request:  #optional whether discard requests to the qcow2
4283 #                         device should be forwarded to the data source
4285 # @pass-discard-snapshot: #optional whether discard requests for the data source
4286 #                         should be issued when a snapshot operation (e.g.
4287 #                         deleting a snapshot) frees clusters in the qcow2 file
4289 # @pass-discard-other:    #optional whether discard requests for the data source
4290 #                         should be issued on other occasions where a cluster
4291 #                         gets freed
4293 # Since: 1.7
4295 { 'type': 'BlockdevOptionsQcow2',
4296   'base': 'BlockdevOptionsGenericCOWFormat',
4297   'data': { '*lazy-refcounts': 'bool',
4298             '*pass-discard-request': 'bool',
4299             '*pass-discard-snapshot': 'bool',
4300             '*pass-discard-other': 'bool' } }
4303 # @BlkdebugEvent
4305 # Trigger events supported by blkdebug.
4307 { 'enum': 'BlkdebugEvent',
4308   'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
4309             'l1_grow.activate_table', 'l2_load', 'l2_update',
4310             'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
4311             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
4312             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
4313             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
4314             'refblock_load', 'refblock_update', 'refblock_update_part',
4315             'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
4316             'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
4317             'refblock_alloc.switch_table', 'cluster_alloc',
4318             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
4319             'flush_to_disk' ] }
4322 # @BlkdebugInjectErrorOptions
4324 # Describes a single error injection for blkdebug.
4326 # @event:       trigger event
4328 # @state:       #optional the state identifier blkdebug needs to be in to
4329 #               actually trigger the event; defaults to "any"
4331 # @errno:       #optional error identifier (errno) to be returned; defaults to
4332 #               EIO
4334 # @sector:      #optional specifies the sector index which has to be affected
4335 #               in order to actually trigger the event; defaults to "any
4336 #               sector"
4338 # @once:        #optional disables further events after this one has been
4339 #               triggered; defaults to false
4341 # @immediately: #optional fail immediately; defaults to false
4343 # Since: 2.0
4345 { 'type': 'BlkdebugInjectErrorOptions',
4346   'data': { 'event': 'BlkdebugEvent',
4347             '*state': 'int',
4348             '*errno': 'int',
4349             '*sector': 'int',
4350             '*once': 'bool',
4351             '*immediately': 'bool' } }
4354 # @BlkdebugSetStateOptions
4356 # Describes a single state-change event for blkdebug.
4358 # @event:       trigger event
4360 # @state:       #optional the current state identifier blkdebug needs to be in;
4361 #               defaults to "any"
4363 # @new_state:   the state identifier blkdebug is supposed to assume if
4364 #               this event is triggered
4366 # Since: 2.0
4368 { 'type': 'BlkdebugSetStateOptions',
4369   'data': { 'event': 'BlkdebugEvent',
4370             '*state': 'int',
4371             'new_state': 'int' } }
4374 # @BlockdevOptionsBlkdebug
4376 # Driver specific block device options for blkdebug.
4378 # @image:           underlying raw block device (or image file)
4380 # @config:          #optional filename of the configuration file
4382 # @align:           #optional required alignment for requests in bytes
4384 # @inject-error:    #optional array of error injection descriptions
4386 # @set-state:       #optional array of state-change descriptions
4388 # Since: 2.0
4390 { 'type': 'BlockdevOptionsBlkdebug',
4391   'data': { 'image': 'BlockdevRef',
4392             '*config': 'str',
4393             '*align': 'int',
4394             '*inject-error': ['BlkdebugInjectErrorOptions'],
4395             '*set-state': ['BlkdebugSetStateOptions'] } }
4398 # @BlockdevOptionsBlkverify
4400 # Driver specific block device options for blkverify.
4402 # @test:    block device to be tested
4404 # @raw:     raw image used for verification
4406 # Since: 2.0
4408 { 'type': 'BlockdevOptionsBlkverify',
4409   'data': { 'test': 'BlockdevRef',
4410             'raw': 'BlockdevRef' } }
4413 # @BlockdevOptions
4415 # Options for creating a block device.
4417 # Since: 1.7
4419 { 'union': 'BlockdevOptions',
4420   'base': 'BlockdevOptionsBase',
4421   'discriminator': 'driver',
4422   'data': {
4423       'file':       'BlockdevOptionsFile',
4424       'http':       'BlockdevOptionsFile',
4425       'https':      'BlockdevOptionsFile',
4426       'ftp':        'BlockdevOptionsFile',
4427       'ftps':       'BlockdevOptionsFile',
4428       'tftp':       'BlockdevOptionsFile',
4429 # TODO gluster: Wait for structured options
4430 # TODO iscsi: Wait for structured options
4431 # TODO nbd: Should take InetSocketAddress for 'host'?
4432 # TODO nfs: Wait for structured options
4433 # TODO rbd: Wait for structured options
4434 # TODO sheepdog: Wait for structured options
4435 # TODO ssh: Should take InetSocketAddress for 'host'?
4436       'vvfat':      'BlockdevOptionsVVFAT',
4437       'blkdebug':   'BlockdevOptionsBlkdebug',
4438       'blkverify':  'BlockdevOptionsBlkverify',
4439       'bochs':      'BlockdevOptionsGenericFormat',
4440       'cloop':      'BlockdevOptionsGenericFormat',
4441       'cow':        'BlockdevOptionsGenericCOWFormat',
4442       'dmg':        'BlockdevOptionsGenericFormat',
4443       'parallels':  'BlockdevOptionsGenericFormat',
4444       'qcow':       'BlockdevOptionsGenericCOWFormat',
4445       'qcow2':      'BlockdevOptionsQcow2',
4446       'qed':        'BlockdevOptionsGenericCOWFormat',
4447       'raw':        'BlockdevOptionsGenericFormat',
4448       'vdi':        'BlockdevOptionsGenericFormat',
4449       'vhdx':       'BlockdevOptionsGenericFormat',
4450       'vmdk':       'BlockdevOptionsGenericCOWFormat',
4451       'vpc':        'BlockdevOptionsGenericFormat'
4452   } }
4455 # @BlockdevRef
4457 # Reference to a block device.
4459 # @definition:      defines a new block device inline
4460 # @reference:       references the ID of an existing block device. An
4461 #                   empty string means that no block device should be
4462 #                   referenced.
4464 # Since: 1.7
4466 { 'union': 'BlockdevRef',
4467   'discriminator': {},
4468   'data': { 'definition': 'BlockdevOptions',
4469             'reference': 'str' } }
4472 # @blockdev-add:
4474 # Creates a new block device.
4476 # @options: block device options for the new device
4478 # Since: 1.7
4480 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }