loader: rename in_ram/has_mr
[qemu.git] / qapi-schema.json
blob6c381b7306774367e711a4ffb56711731c06a9f5
1 # -*- Mode: Python -*-
3 # QAPI Schema
5 ##
6 # @ErrorClass
8 # QEMU error classes
10 # @GenericError: this is used for errors that don't require a specific error
11 #                class. This should be the default case for most errors
13 # @CommandNotFound: the requested command has not been found
15 # @DeviceEncrypted: the requested operation can't be fulfilled because the
16 #                   selected device is encrypted
18 # @DeviceNotActive: a device has failed to be become active
20 # @DeviceNotFound: the requested device has not been found
22 # @KVMMissingCap: the requested operation can't be fulfilled because a
23 #                 required KVM capability is missing
25 # Since: 1.2
27 { 'enum': 'ErrorClass',
28   'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
29             'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
33 # LostTickPolicy:
35 # Policy for handling lost ticks in timer devices.
37 # @discard: throw away the missed tick(s) and continue with future injection
38 #           normally.  Guest time may be delayed, unless the OS has explicit
39 #           handling of lost ticks
41 # @delay: continue to deliver ticks at the normal rate.  Guest time will be
42 #         delayed due to the late tick
44 # @merge: merge the missed tick(s) into one tick and inject.  Guest time
45 #         may be delayed, depending on how the OS reacts to the merging
46 #         of ticks
48 # @slew: deliver ticks at a higher rate to catch up with the missed tick. The
49 #        guest time should not be delayed once catchup is complete.
51 # Since: 2.0
53 { 'enum': 'LostTickPolicy',
54   'data': ['discard', 'delay', 'merge', 'slew' ] }
57 # BiosAtaTranslation:
59 # Policy that BIOS should use to interpret cylinder/head/sector
60 # addresses.  Note that Bochs BIOS and SeaBIOS will not actually
61 # translate logical CHS to physical; instead, they will use logical
62 # block addressing.
64 # @auto: If cylinder/heads/sizes are passed, choose between none and LBA
65 #        depending on the size of the disk.  If they are not passed,
66 #        choose none if QEMU can guess that the disk had 16 or fewer
67 #        heads, large if QEMU can guess that the disk had 131072 or
68 #        fewer tracks across all heads (i.e. cylinders*heads<131072),
69 #        otherwise LBA.
71 # @none: The physical disk geometry is equal to the logical geometry.
73 # @lba: Assume 63 sectors per track and one of 16, 32, 64, 128 or 255
74 #       heads (if fewer than 255 are enough to cover the whole disk
75 #       with 1024 cylinders/head).  The number of cylinders/head is
76 #       then computed based on the number of sectors and heads.
78 # @large: The number of cylinders per head is scaled down to 1024
79 #         by correspondingly scaling up the number of heads.
81 # @rechs: Same as @large, but first convert a 16-head geometry to
82 #         15-head, by proportionally scaling up the number of
83 #         cylinders/head.
85 # Since: 2.0
87 { 'enum': 'BiosAtaTranslation',
88   'data': ['auto', 'none', 'lba', 'large', 'rechs']}
90 # @add_client
92 # Allow client connections for VNC, Spice and socket based
93 # character devices to be passed in to QEMU via SCM_RIGHTS.
95 # @protocol: protocol name. Valid names are "vnc", "spice" or the
96 #            name of a character device (eg. from -chardev id=XXXX)
98 # @fdname: file descriptor name previously passed via 'getfd' command
100 # @skipauth: #optional whether to skip authentication. Only applies
101 #            to "vnc" and "spice" protocols
103 # @tls: #optional whether to perform TLS. Only applies to the "spice"
104 #       protocol
106 # Returns: nothing on success.
108 # Since: 0.14.0
110 { 'command': 'add_client',
111   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
112             '*tls': 'bool' } }
115 # @NameInfo:
117 # Guest name information.
119 # @name: #optional The name of the guest
121 # Since 0.14.0
123 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
126 # @query-name:
128 # Return the name information of a guest.
130 # Returns: @NameInfo of the guest
132 # Since 0.14.0
134 { 'command': 'query-name', 'returns': 'NameInfo' }
137 # @VersionInfo:
139 # A description of QEMU's version.
141 # @qemu.major:  The major version of QEMU
143 # @qemu.minor:  The minor version of QEMU
145 # @qemu.micro:  The micro version of QEMU.  By current convention, a micro
146 #               version of 50 signifies a development branch.  A micro version
147 #               greater than or equal to 90 signifies a release candidate for
148 #               the next minor version.  A micro version of less than 50
149 #               signifies a stable release.
151 # @package:     QEMU will always set this field to an empty string.  Downstream
152 #               versions of QEMU should set this to a non-empty string.  The
153 #               exact format depends on the downstream however it highly
154 #               recommended that a unique name is used.
156 # Since: 0.14.0
158 { 'type': 'VersionInfo',
159   'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
160            'package': 'str'} }
163 # @query-version:
165 # Returns the current version of QEMU.
167 # Returns:  A @VersionInfo object describing the current version of QEMU.
169 # Since: 0.14.0
171 { 'command': 'query-version', 'returns': 'VersionInfo' }
174 # @KvmInfo:
176 # Information about support for KVM acceleration
178 # @enabled: true if KVM acceleration is active
180 # @present: true if KVM acceleration is built into this executable
182 # Since: 0.14.0
184 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
187 # @query-kvm:
189 # Returns information about KVM acceleration
191 # Returns: @KvmInfo
193 # Since: 0.14.0
195 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
198 # @RunState
200 # An enumeration of VM run states.
202 # @debug: QEMU is running on a debugger
204 # @finish-migrate: guest is paused to finish the migration process
206 # @inmigrate: guest is paused waiting for an incoming migration.  Note
207 # that this state does not tell whether the machine will start at the
208 # end of the migration.  This depends on the command-line -S option and
209 # any invocation of 'stop' or 'cont' that has happened since QEMU was
210 # started.
212 # @internal-error: An internal error that prevents further guest execution
213 # has occurred
215 # @io-error: the last IOP has failed and the device is configured to pause
216 # on I/O errors
218 # @paused: guest has been paused via the 'stop' command
220 # @postmigrate: guest is paused following a successful 'migrate'
222 # @prelaunch: QEMU was started with -S and guest has not started
224 # @restore-vm: guest is paused to restore VM state
226 # @running: guest is actively running
228 # @save-vm: guest is paused to save the VM state
230 # @shutdown: guest is shut down (and -no-shutdown is in use)
232 # @suspended: guest is suspended (ACPI S3)
234 # @watchdog: the watchdog action is configured to pause and has been triggered
236 # @guest-panicked: guest has been panicked as a result of guest OS panic
238 { 'enum': 'RunState',
239   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
240             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
241             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
242             'guest-panicked' ] }
245 # @SnapshotInfo
247 # @id: unique snapshot id
249 # @name: user chosen name
251 # @vm-state-size: size of the VM state
253 # @date-sec: UTC date of the snapshot in seconds
255 # @date-nsec: fractional part in nano seconds to be used with date-sec
257 # @vm-clock-sec: VM clock relative to boot in seconds
259 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
261 # Since: 1.3
265 { 'type': 'SnapshotInfo',
266   'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
267             'date-sec': 'int', 'date-nsec': 'int',
268             'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
271 # @ImageInfoSpecificQCow2:
273 # @compat: compatibility level
275 # @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
277 # Since: 1.7
279 { 'type': 'ImageInfoSpecificQCow2',
280   'data': {
281       'compat': 'str',
282       '*lazy-refcounts': 'bool'
283   } }
286 # @ImageInfoSpecificVmdk:
288 # @create-type: The create type of VMDK image
290 # @cid: Content id of image
292 # @parent-cid: Parent VMDK image's cid
294 # @extents: List of extent files
296 # Since: 1.7
298 { 'type': 'ImageInfoSpecificVmdk',
299   'data': {
300       'create-type': 'str',
301       'cid': 'int',
302       'parent-cid': 'int',
303       'extents': ['ImageInfo']
304   } }
307 # @ImageInfoSpecific:
309 # A discriminated record of image format specific information structures.
311 # Since: 1.7
314 { 'union': 'ImageInfoSpecific',
315   'data': {
316       'qcow2': 'ImageInfoSpecificQCow2',
317       'vmdk': 'ImageInfoSpecificVmdk'
318   } }
321 # @ImageInfo:
323 # Information about a QEMU image file
325 # @filename: name of the image file
327 # @format: format of the image file
329 # @virtual-size: maximum capacity in bytes of the image
331 # @actual-size: #optional actual size on disk in bytes of the image
333 # @dirty-flag: #optional true if image is not cleanly closed
335 # @cluster-size: #optional size of a cluster in bytes
337 # @encrypted: #optional true if the image is encrypted
339 # @compressed: #optional true if the image is compressed (Since 1.7)
341 # @backing-filename: #optional name of the backing file
343 # @full-backing-filename: #optional full path of the backing file
345 # @backing-filename-format: #optional the format of the backing file
347 # @snapshots: #optional list of VM snapshots
349 # @backing-image: #optional info of the backing image (since 1.6)
351 # @format-specific: #optional structure supplying additional format-specific
352 # information (since 1.7)
354 # Since: 1.3
358 { 'type': 'ImageInfo',
359   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
360            '*actual-size': 'int', 'virtual-size': 'int',
361            '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
362            '*backing-filename': 'str', '*full-backing-filename': 'str',
363            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
364            '*backing-image': 'ImageInfo',
365            '*format-specific': 'ImageInfoSpecific' } }
368 # @ImageCheck:
370 # Information about a QEMU image file check
372 # @filename: name of the image file checked
374 # @format: format of the image file checked
376 # @check-errors: number of unexpected errors occurred during check
378 # @image-end-offset: #optional offset (in bytes) where the image ends, this
379 #                    field is present if the driver for the image format
380 #                    supports it
382 # @corruptions: #optional number of corruptions found during the check if any
384 # @leaks: #optional number of leaks found during the check if any
386 # @corruptions-fixed: #optional number of corruptions fixed during the check
387 #                     if any
389 # @leaks-fixed: #optional number of leaks fixed during the check if any
391 # @total-clusters: #optional total number of clusters, this field is present
392 #                  if the driver for the image format supports it
394 # @allocated-clusters: #optional total number of allocated clusters, this
395 #                      field is present if the driver for the image format
396 #                      supports it
398 # @fragmented-clusters: #optional total number of fragmented clusters, this
399 #                       field is present if the driver for the image format
400 #                       supports it
402 # @compressed-clusters: #optional total number of compressed clusters, this
403 #                       field is present if the driver for the image format
404 #                       supports it
406 # Since: 1.4
410 { 'type': 'ImageCheck',
411   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
412            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
413            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
414            '*total-clusters': 'int', '*allocated-clusters': 'int',
415            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
418 # @StatusInfo:
420 # Information about VCPU run state
422 # @running: true if all VCPUs are runnable, false if not runnable
424 # @singlestep: true if VCPUs are in single-step mode
426 # @status: the virtual machine @RunState
428 # Since:  0.14.0
430 # Notes: @singlestep is enabled through the GDB stub
432 { 'type': 'StatusInfo',
433   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
436 # @query-status:
438 # Query the run status of all VCPUs
440 # Returns: @StatusInfo reflecting all VCPUs
442 # Since:  0.14.0
444 { 'command': 'query-status', 'returns': 'StatusInfo' }
447 # @UuidInfo:
449 # Guest UUID information.
451 # @UUID: the UUID of the guest
453 # Since: 0.14.0
455 # Notes: If no UUID was specified for the guest, a null UUID is returned.
457 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
460 # @query-uuid:
462 # Query the guest UUID information.
464 # Returns: The @UuidInfo for the guest
466 # Since 0.14.0
468 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
471 # @ChardevInfo:
473 # Information about a character device.
475 # @label: the label of the character device
477 # @filename: the filename of the character device
479 # Notes: @filename is encoded using the QEMU command line character device
480 #        encoding.  See the QEMU man page for details.
482 # Since: 0.14.0
484 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
487 # @query-chardev:
489 # Returns information about current character devices.
491 # Returns: a list of @ChardevInfo
493 # Since: 0.14.0
495 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
498 # @ChardevBackendInfo:
500 # Information about a character device backend
502 # @name: The backend name
504 # Since: 2.0
506 { 'type': 'ChardevBackendInfo', 'data': {'name': 'str'} }
509 # @query-chardev-backends:
511 # Returns information about character device backends.
513 # Returns: a list of @ChardevBackendInfo
515 # Since: 2.0
517 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
520 # @DataFormat:
522 # An enumeration of data format.
524 # @utf8: Data is a UTF-8 string (RFC 3629)
526 # @base64: Data is Base64 encoded binary (RFC 3548)
528 # Since: 1.4
530 { 'enum': 'DataFormat',
531   'data': [ 'utf8', 'base64' ] }
534 # @ringbuf-write:
536 # Write to a ring buffer character device.
538 # @device: the ring buffer character device name
540 # @data: data to write
542 # @format: #optional data encoding (default 'utf8').
543 #          - base64: data must be base64 encoded text.  Its binary
544 #            decoding gets written.
545 #            Bug: invalid base64 is currently not rejected.
546 #            Whitespace *is* invalid.
547 #          - utf8: data's UTF-8 encoding is written
548 #          - data itself is always Unicode regardless of format, like
549 #            any other string.
551 # Returns: Nothing on success
553 # Since: 1.4
555 { 'command': 'ringbuf-write',
556   'data': {'device': 'str', 'data': 'str',
557            '*format': 'DataFormat'} }
560 # @ringbuf-read:
562 # Read from a ring buffer character device.
564 # @device: the ring buffer character device name
566 # @size: how many bytes to read at most
568 # @format: #optional data encoding (default 'utf8').
569 #          - base64: the data read is returned in base64 encoding.
570 #          - utf8: the data read is interpreted as UTF-8.
571 #            Bug: can screw up when the buffer contains invalid UTF-8
572 #            sequences, NUL characters, after the ring buffer lost
573 #            data, and when reading stops because the size limit is
574 #            reached.
575 #          - The return value is always Unicode regardless of format,
576 #            like any other string.
578 # Returns: data read from the device
580 # Since: 1.4
582 { 'command': 'ringbuf-read',
583   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
584   'returns': 'str' }
587 # @CommandInfo:
589 # Information about a QMP command
591 # @name: The command name
593 # Since: 0.14.0
595 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
598 # @query-commands:
600 # Return a list of supported QMP commands by this server
602 # Returns: A list of @CommandInfo for all supported commands
604 # Since: 0.14.0
606 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
609 # @EventInfo:
611 # Information about a QMP event
613 # @name: The event name
615 # Since: 1.2.0
617 { 'type': 'EventInfo', 'data': {'name': 'str'} }
620 # @query-events:
622 # Return a list of supported QMP events by this server
624 # Returns: A list of @EventInfo for all supported events
626 # Since: 1.2.0
628 { 'command': 'query-events', 'returns': ['EventInfo'] }
631 # @MigrationStats
633 # Detailed migration status.
635 # @transferred: amount of bytes already transferred to the target VM
637 # @remaining: amount of bytes remaining to be transferred to the target VM
639 # @total: total amount of bytes involved in the migration process
641 # @duplicate: number of duplicate (zero) pages (since 1.2)
643 # @skipped: number of skipped zero pages (since 1.5)
645 # @normal : number of normal pages (since 1.2)
647 # @normal-bytes: number of normal bytes sent (since 1.2)
649 # @dirty-pages-rate: number of pages dirtied by second by the
650 #        guest (since 1.3)
652 # @mbps: throughput in megabits/sec. (since 1.6)
654 # Since: 0.14.0
656 { 'type': 'MigrationStats',
657   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
658            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
659            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
660            'mbps' : 'number' } }
663 # @XBZRLECacheStats
665 # Detailed XBZRLE migration cache statistics
667 # @cache-size: XBZRLE cache size
669 # @bytes: amount of bytes already transferred to the target VM
671 # @pages: amount of pages transferred to the target VM
673 # @cache-miss: number of cache miss
675 # @overflow: number of overflows
677 # Since: 1.2
679 { 'type': 'XBZRLECacheStats',
680   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
681            'cache-miss': 'int', 'overflow': 'int' } }
684 # @MigrationInfo
686 # Information about current migration process.
688 # @status: #optional string describing the current migration status.
689 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
690 #          'cancelled'. If this field is not returned, no migration process
691 #          has been initiated
693 # @ram: #optional @MigrationStats containing detailed migration
694 #       status, only returned if status is 'active' or
695 #       'completed'. 'comppleted' (since 1.2)
697 # @disk: #optional @MigrationStats containing detailed disk migration
698 #        status, only returned if status is 'active' and it is a block
699 #        migration
701 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
702 #                migration statistics, only returned if XBZRLE feature is on and
703 #                status is 'active' or 'completed' (since 1.2)
705 # @total-time: #optional total amount of milliseconds since migration started.
706 #        If migration has ended, it returns the total migration
707 #        time. (since 1.2)
709 # @downtime: #optional only present when migration finishes correctly
710 #        total downtime in milliseconds for the guest.
711 #        (since 1.3)
713 # @expected-downtime: #optional only present while migration is active
714 #        expected downtime in milliseconds for the guest in last walk
715 #        of the dirty bitmap. (since 1.3)
717 # @setup-time: #optional amount of setup time in milliseconds _before_ the
718 #        iterations begin but _after_ the QMP command is issued. This is designed
719 #        to provide an accounting of any activities (such as RDMA pinning) which
720 #        may be expensive, but do not actually occur during the iterative
721 #        migration rounds themselves. (since 1.6)
723 # Since: 0.14.0
725 { 'type': 'MigrationInfo',
726   'data': {'*status': 'str', '*ram': 'MigrationStats',
727            '*disk': 'MigrationStats',
728            '*xbzrle-cache': 'XBZRLECacheStats',
729            '*total-time': 'int',
730            '*expected-downtime': 'int',
731            '*downtime': 'int',
732            '*setup-time': 'int'} }
735 # @query-migrate
737 # Returns information about current migration process.
739 # Returns: @MigrationInfo
741 # Since: 0.14.0
743 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
746 # @MigrationCapability
748 # Migration capabilities enumeration
750 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
751 #          This feature allows us to minimize migration traffic for certain work
752 #          loads, by sending compressed difference of the pages
754 # @rdma-pin-all: Controls whether or not the entire VM memory footprint is
755 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
756 #          Disabled by default. (since 2.0)
758 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
759 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
760 #          source and target VM to support this feature. To enable it is sufficient
761 #          to enable the capability on the source VM. The feature is disabled by
762 #          default. (since 1.6)
764 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
765 #          to speed up convergence of RAM migration. (since 1.6)
767 # Since: 1.2
769 { 'enum': 'MigrationCapability',
770   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks'] }
773 # @MigrationCapabilityStatus
775 # Migration capability information
777 # @capability: capability enum
779 # @state: capability state bool
781 # Since: 1.2
783 { 'type': 'MigrationCapabilityStatus',
784   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
787 # @migrate-set-capabilities
789 # Enable/Disable the following migration capabilities (like xbzrle)
791 # @capabilities: json array of capability modifications to make
793 # Since: 1.2
795 { 'command': 'migrate-set-capabilities',
796   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
799 # @query-migrate-capabilities
801 # Returns information about the current migration capabilities status
803 # Returns: @MigrationCapabilitiesStatus
805 # Since: 1.2
807 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
810 # @MouseInfo:
812 # Information about a mouse device.
814 # @name: the name of the mouse device
816 # @index: the index of the mouse device
818 # @current: true if this device is currently receiving mouse events
820 # @absolute: true if this device supports absolute coordinates as input
822 # Since: 0.14.0
824 { 'type': 'MouseInfo',
825   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
826            'absolute': 'bool'} }
829 # @query-mice:
831 # Returns information about each active mouse device
833 # Returns: a list of @MouseInfo for each device
835 # Since: 0.14.0
837 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
840 # @CpuInfo:
842 # Information about a virtual CPU
844 # @CPU: the index of the virtual CPU
846 # @current: this only exists for backwards compatible and should be ignored
848 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
849 #          to a processor specific low power mode.
851 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
852 #                pointer.
853 #                If the target is Sparc, this is the PC component of the
854 #                instruction pointer.
856 # @nip: #optional If the target is PPC, the instruction pointer
858 # @npc: #optional If the target is Sparc, the NPC component of the instruction
859 #                 pointer
861 # @PC: #optional If the target is MIPS, the instruction pointer
863 # @thread_id: ID of the underlying host thread
865 # Since: 0.14.0
867 # Notes: @halted is a transient state that changes frequently.  By the time the
868 #        data is sent to the client, the guest may no longer be halted.
870 { 'type': 'CpuInfo',
871   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
872            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
875 # @query-cpus:
877 # Returns a list of information about each virtual CPU.
879 # Returns: a list of @CpuInfo for each virtual CPU
881 # Since: 0.14.0
883 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
886 # @BlockDeviceInfo:
888 # Information about the backing device for a block device.
890 # @file: the filename of the backing device
892 # @node-name: #optional the name of the block driver node (Since 2.0)
894 # @ro: true if the backing device was open read-only
896 # @drv: the name of the block format used to open the backing device. As of
897 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
898 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
899 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
900 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
902 # @backing_file: #optional the name of the backing file (for copy-on-write)
904 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
906 # @encrypted: true if the backing device is encrypted
908 # @encryption_key_missing: true if the backing device is encrypted but an
909 #                          valid encryption key is missing
911 # @bps: total throughput limit in bytes per second is specified
913 # @bps_rd: read throughput limit in bytes per second is specified
915 # @bps_wr: write throughput limit in bytes per second is specified
917 # @iops: total I/O operations per second is specified
919 # @iops_rd: read I/O operations per second is specified
921 # @iops_wr: write I/O operations per second is specified
923 # @image: the info of image used (since: 1.6)
925 # @bps_max: #optional total max in bytes (Since 1.7)
927 # @bps_rd_max: #optional read max in bytes (Since 1.7)
929 # @bps_wr_max: #optional write max in bytes (Since 1.7)
931 # @iops_max: #optional total I/O operations max (Since 1.7)
933 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
935 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
937 # @iops_size: #optional an I/O size in bytes (Since 1.7)
939 # Since: 0.14.0
942 { 'type': 'BlockDeviceInfo',
943   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
944             '*backing_file': 'str', 'backing_file_depth': 'int',
945             'encrypted': 'bool', 'encryption_key_missing': 'bool',
946             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
947             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
948             'image': 'ImageInfo',
949             '*bps_max': 'int', '*bps_rd_max': 'int',
950             '*bps_wr_max': 'int', '*iops_max': 'int',
951             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
952             '*iops_size': 'int' } }
955 # @BlockDeviceIoStatus:
957 # An enumeration of block device I/O status.
959 # @ok: The last I/O operation has succeeded
961 # @failed: The last I/O operation has failed
963 # @nospace: The last I/O operation has failed due to a no-space condition
965 # Since: 1.0
967 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
970 # @BlockDeviceMapEntry:
972 # Entry in the metadata map of the device (returned by "qemu-img map")
974 # @start: Offset in the image of the first byte described by this entry
975 #         (in bytes)
977 # @length: Length of the range described by this entry (in bytes)
979 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
980 #         before reaching one for which the range is allocated.  The value is
981 #         in the range 0 to the depth of the image chain - 1.
983 # @zero: the sectors in this range read as zeros
985 # @data: reading the image will actually read data from a file (in particular,
986 #        if @offset is present this means that the sectors are not simply
987 #        preallocated, but contain actual data in raw format)
989 # @offset: if present, the image file stores the data for this range in
990 #          raw format at the given offset.
992 # Since 1.7
994 { 'type': 'BlockDeviceMapEntry',
995   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
996             'data': 'bool', '*offset': 'int' } }
999 # @BlockDirtyInfo:
1001 # Block dirty bitmap information.
1003 # @count: number of dirty bytes according to the dirty bitmap
1005 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
1007 # Since: 1.3
1009 { 'type': 'BlockDirtyInfo',
1010   'data': {'count': 'int', 'granularity': 'int'} }
1013 # @BlockInfo:
1015 # Block device information.  This structure describes a virtual device and
1016 # the backing device associated with it.
1018 # @device: The device name associated with the virtual device.
1020 # @type: This field is returned only for compatibility reasons, it should
1021 #        not be used (always returns 'unknown')
1023 # @removable: True if the device supports removable media.
1025 # @locked: True if the guest has locked this device from having its media
1026 #          removed
1028 # @tray_open: #optional True if the device has a tray and it is open
1029 #             (only present if removable is true)
1031 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
1032 #                 driver has one or more dirty bitmaps) (Since 2.0)
1034 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
1035 #             supports it and the VM is configured to stop on errors
1037 # @inserted: #optional @BlockDeviceInfo describing the device if media is
1038 #            present
1040 # Since:  0.14.0
1042 { 'type': 'BlockInfo',
1043   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
1044            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
1045            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
1046            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
1049 # @query-block:
1051 # Get a list of BlockInfo for all virtual block devices.
1053 # Returns: a list of @BlockInfo describing each virtual block device
1055 # Since: 0.14.0
1057 { 'command': 'query-block', 'returns': ['BlockInfo'] }
1060 # @BlockDeviceStats:
1062 # Statistics of a virtual block device or a block backing device.
1064 # @rd_bytes:      The number of bytes read by the device.
1066 # @wr_bytes:      The number of bytes written by the device.
1068 # @rd_operations: The number of read operations performed by the device.
1070 # @wr_operations: The number of write operations performed by the device.
1072 # @flush_operations: The number of cache flush operations performed by the
1073 #                    device (since 0.15.0)
1075 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
1076 #                       (since 0.15.0).
1078 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1080 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1082 # @wr_highest_offset: The offset after the greatest byte written to the
1083 #                     device.  The intended use of this information is for
1084 #                     growable sparse files (like qcow2) that are used on top
1085 #                     of a physical device.
1087 # Since: 0.14.0
1089 { 'type': 'BlockDeviceStats',
1090   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1091            'wr_operations': 'int', 'flush_operations': 'int',
1092            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1093            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1096 # @BlockStats:
1098 # Statistics of a virtual block device or a block backing device.
1100 # @device: #optional If the stats are for a virtual block device, the name
1101 #          corresponding to the virtual block device.
1103 # @stats:  A @BlockDeviceStats for the device.
1105 # @parent: #optional This describes the file block device if it has one.
1107 # @backing: #optional This describes the backing block device if it has one.
1108 #           (Since 2.0)
1110 # Since: 0.14.0
1112 { 'type': 'BlockStats',
1113   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1114            '*parent': 'BlockStats',
1115            '*backing': 'BlockStats'} }
1118 # @query-blockstats:
1120 # Query the @BlockStats for all virtual block devices.
1122 # Returns: A list of @BlockStats for each virtual block devices.
1124 # Since: 0.14.0
1126 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1129 # @VncClientInfo:
1131 # Information about a connected VNC client.
1133 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1134 #        when possible.
1136 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1137 #          'ipv4' if the client is connected via IPv4 and TCP
1138 #          'unix' if the client is connected via a unix domain socket
1139 #          'unknown' otherwise
1141 # @service: The service name of the client's port.  This may depends on the
1142 #           host system's service database so symbolic names should not be
1143 #           relied on.
1145 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1146 #              Name of the client.
1148 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1149 #                 used for authentication.
1151 # Since: 0.14.0
1153 { 'type': 'VncClientInfo',
1154   'data': {'host': 'str', 'family': 'str', 'service': 'str',
1155            '*x509_dname': 'str', '*sasl_username': 'str'} }
1158 # @VncInfo:
1160 # Information about the VNC session.
1162 # @enabled: true if the VNC server is enabled, false otherwise
1164 # @host: #optional The hostname the VNC server is bound to.  This depends on
1165 #        the name resolution on the host and may be an IP address.
1167 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1168 #                    'ipv4' if the host is listening for IPv4 connections
1169 #                    'unix' if the host is listening on a unix domain socket
1170 #                    'unknown' otherwise
1172 # @service: #optional The service name of the server's port.  This may depends
1173 #           on the host system's service database so symbolic names should not
1174 #           be relied on.
1176 # @auth: #optional the current authentication type used by the server
1177 #        'none' if no authentication is being used
1178 #        'vnc' if VNC authentication is being used
1179 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1180 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1181 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1182 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1183 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1184 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1185 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1186 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1187 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1189 # @clients: a list of @VncClientInfo of all currently connected clients
1191 # Since: 0.14.0
1193 { 'type': 'VncInfo',
1194   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1195            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1198 # @query-vnc:
1200 # Returns information about the current VNC server
1202 # Returns: @VncInfo
1204 # Since: 0.14.0
1206 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1209 # @SpiceChannel
1211 # Information about a SPICE client channel.
1213 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1214 #        when possible.
1216 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1217 #          'ipv4' if the client is connected via IPv4 and TCP
1218 #          'unix' if the client is connected via a unix domain socket
1219 #          'unknown' otherwise
1221 # @port: The client's port number.
1223 # @connection-id: SPICE connection id number.  All channels with the same id
1224 #                 belong to the same SPICE session.
1226 # @connection-type: SPICE channel type number.  "1" is the main control
1227 #                   channel, filter for this one if you want to track spice
1228 #                   sessions only
1230 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1231 #              multiple channels of the same type exist, such as multiple
1232 #              display channels in a multihead setup
1234 # @tls: true if the channel is encrypted, false otherwise.
1236 # Since: 0.14.0
1238 { 'type': 'SpiceChannel',
1239   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1240            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1241            'tls': 'bool'} }
1244 # @SpiceQueryMouseMode
1246 # An enumeration of Spice mouse states.
1248 # @client: Mouse cursor position is determined by the client.
1250 # @server: Mouse cursor position is determined by the server.
1252 # @unknown: No information is available about mouse mode used by
1253 #           the spice server.
1255 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1257 # Since: 1.1
1259 { 'enum': 'SpiceQueryMouseMode',
1260   'data': [ 'client', 'server', 'unknown' ] }
1263 # @SpiceInfo
1265 # Information about the SPICE session.
1267 # @enabled: true if the SPICE server is enabled, false otherwise
1269 # @migrated: true if the last guest migration completed and spice
1270 #            migration had completed as well. false otherwise.
1272 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1273 #        the name resolution on the host and may be an IP address.
1275 # @port: #optional The SPICE server's port number.
1277 # @compiled-version: #optional SPICE server version.
1279 # @tls-port: #optional The SPICE server's TLS port number.
1281 # @auth: #optional the current authentication type used by the server
1282 #        'none'  if no authentication is being used
1283 #        'spice' uses SASL or direct TLS authentication, depending on command
1284 #                line options
1286 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1287 #              be determined by the client or the server, or unknown if spice
1288 #              server doesn't provide this information.
1290 #              Since: 1.1
1292 # @channels: a list of @SpiceChannel for each active spice channel
1294 # Since: 0.14.0
1296 { 'type': 'SpiceInfo',
1297   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1298            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1299            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1302 # @query-spice
1304 # Returns information about the current SPICE server
1306 # Returns: @SpiceInfo
1308 # Since: 0.14.0
1310 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1313 # @BalloonInfo:
1315 # Information about the guest balloon device.
1317 # @actual: the number of bytes the balloon currently contains
1319 # Since: 0.14.0
1322 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1325 # @query-balloon:
1327 # Return information about the balloon device.
1329 # Returns: @BalloonInfo on success
1330 #          If the balloon driver is enabled but not functional because the KVM
1331 #          kernel module cannot support it, KvmMissingCap
1332 #          If no balloon device is present, DeviceNotActive
1334 # Since: 0.14.0
1336 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1339 # @PciMemoryRange:
1341 # A PCI device memory region
1343 # @base: the starting address (guest physical)
1345 # @limit: the ending address (guest physical)
1347 # Since: 0.14.0
1349 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1352 # @PciMemoryRegion
1354 # Information about a PCI device I/O region.
1356 # @bar: the index of the Base Address Register for this region
1358 # @type: 'io' if the region is a PIO region
1359 #        'memory' if the region is a MMIO region
1361 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1363 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1365 # Since: 0.14.0
1367 { 'type': 'PciMemoryRegion',
1368   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1369            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1372 # @PciBridgeInfo:
1374 # Information about a PCI Bridge device
1376 # @bus.number: primary bus interface number.  This should be the number of the
1377 #              bus the device resides on.
1379 # @bus.secondary: secondary bus interface number.  This is the number of the
1380 #                 main bus for the bridge
1382 # @bus.subordinate: This is the highest number bus that resides below the
1383 #                   bridge.
1385 # @bus.io_range: The PIO range for all devices on this bridge
1387 # @bus.memory_range: The MMIO range for all devices on this bridge
1389 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1390 #                          this bridge
1392 # @devices: a list of @PciDeviceInfo for each device on this bridge
1394 # Since: 0.14.0
1396 { 'type': 'PciBridgeInfo',
1397   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1398                     'io_range': 'PciMemoryRange',
1399                     'memory_range': 'PciMemoryRange',
1400                     'prefetchable_range': 'PciMemoryRange' },
1401            '*devices': ['PciDeviceInfo']} }
1404 # @PciDeviceInfo:
1406 # Information about a PCI device
1408 # @bus: the bus number of the device
1410 # @slot: the slot the device is located in
1412 # @function: the function of the slot used by the device
1414 # @class_info.desc: #optional a string description of the device's class
1416 # @class_info.class: the class code of the device
1418 # @id.device: the PCI device id
1420 # @id.vendor: the PCI vendor id
1422 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1424 # @qdev_id: the device name of the PCI device
1426 # @pci_bridge: if the device is a PCI bridge, the bridge information
1428 # @regions: a list of the PCI I/O regions associated with the device
1430 # Notes: the contents of @class_info.desc are not stable and should only be
1431 #        treated as informational.
1433 # Since: 0.14.0
1435 { 'type': 'PciDeviceInfo',
1436   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1437            'class_info': {'*desc': 'str', 'class': 'int'},
1438            'id': {'device': 'int', 'vendor': 'int'},
1439            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1440            'regions': ['PciMemoryRegion']} }
1443 # @PciInfo:
1445 # Information about a PCI bus
1447 # @bus: the bus index
1449 # @devices: a list of devices on this bus
1451 # Since: 0.14.0
1453 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1456 # @query-pci:
1458 # Return information about the PCI bus topology of the guest.
1460 # Returns: a list of @PciInfo for each PCI bus
1462 # Since: 0.14.0
1464 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1467 # @BlockdevOnError:
1469 # An enumeration of possible behaviors for errors on I/O operations.
1470 # The exact meaning depends on whether the I/O was initiated by a guest
1471 # or by a block job
1473 # @report: for guest operations, report the error to the guest;
1474 #          for jobs, cancel the job
1476 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1477 #          or BLOCK_JOB_ERROR)
1479 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1481 # @stop: for guest operations, stop the virtual machine;
1482 #        for jobs, pause the job
1484 # Since: 1.3
1486 { 'enum': 'BlockdevOnError',
1487   'data': ['report', 'ignore', 'enospc', 'stop'] }
1490 # @MirrorSyncMode:
1492 # An enumeration of possible behaviors for the initial synchronization
1493 # phase of storage mirroring.
1495 # @top: copies data in the topmost image to the destination
1497 # @full: copies data from all images to the destination
1499 # @none: only copy data written from now on
1501 # Since: 1.3
1503 { 'enum': 'MirrorSyncMode',
1504   'data': ['top', 'full', 'none'] }
1507 # @BlockJobType:
1509 # Type of a block job.
1511 # @commit: block commit job type, see "block-commit"
1513 # @stream: block stream job type, see "block-stream"
1515 # @mirror: drive mirror job type, see "drive-mirror"
1517 # @backup: drive backup job type, see "drive-backup"
1519 # Since: 1.7
1521 { 'enum': 'BlockJobType',
1522   'data': ['commit', 'stream', 'mirror', 'backup'] }
1525 # @BlockJobInfo:
1527 # Information about a long-running block device operation.
1529 # @type: the job type ('stream' for image streaming)
1531 # @device: the block device name
1533 # @len: the maximum progress value
1535 # @busy: false if the job is known to be in a quiescent state, with
1536 #        no pending I/O.  Since 1.3.
1538 # @paused: whether the job is paused or, if @busy is true, will
1539 #          pause itself as soon as possible.  Since 1.3.
1541 # @offset: the current progress value
1543 # @speed: the rate limit, bytes per second
1545 # @io-status: the status of the job (since 1.3)
1547 # Since: 1.1
1549 { 'type': 'BlockJobInfo',
1550   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1551            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1552            'io-status': 'BlockDeviceIoStatus'} }
1555 # @query-block-jobs:
1557 # Return information about long-running block device operations.
1559 # Returns: a list of @BlockJobInfo for each active block job
1561 # Since: 1.1
1563 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1566 # @quit:
1568 # This command will cause the QEMU process to exit gracefully.  While every
1569 # attempt is made to send the QMP response before terminating, this is not
1570 # guaranteed.  When using this interface, a premature EOF would not be
1571 # unexpected.
1573 # Since: 0.14.0
1575 { 'command': 'quit' }
1578 # @stop:
1580 # Stop all guest VCPU execution.
1582 # Since:  0.14.0
1584 # Notes:  This function will succeed even if the guest is already in the stopped
1585 #         state.  In "inmigrate" state, it will ensure that the guest
1586 #         remains paused once migration finishes, as if the -S option was
1587 #         passed on the command line.
1589 { 'command': 'stop' }
1592 # @system_reset:
1594 # Performs a hard reset of a guest.
1596 # Since: 0.14.0
1598 { 'command': 'system_reset' }
1601 # @system_powerdown:
1603 # Requests that a guest perform a powerdown operation.
1605 # Since: 0.14.0
1607 # Notes: A guest may or may not respond to this command.  This command
1608 #        returning does not indicate that a guest has accepted the request or
1609 #        that it has shut down.  Many guests will respond to this command by
1610 #        prompting the user in some way.
1612 { 'command': 'system_powerdown' }
1615 # @cpu:
1617 # This command is a nop that is only provided for the purposes of compatibility.
1619 # Since: 0.14.0
1621 # Notes: Do not use this command.
1623 { 'command': 'cpu', 'data': {'index': 'int'} }
1626 # @cpu-add
1628 # Adds CPU with specified ID
1630 # @id: ID of CPU to be created, valid values [0..max_cpus)
1632 # Returns: Nothing on success
1634 # Since 1.5
1636 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1639 # @memsave:
1641 # Save a portion of guest memory to a file.
1643 # @val: the virtual address of the guest to start from
1645 # @size: the size of memory region to save
1647 # @filename: the file to save the memory to as binary data
1649 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1650 #                       virtual address (defaults to CPU 0)
1652 # Returns: Nothing on success
1654 # Since: 0.14.0
1656 # Notes: Errors were not reliably returned until 1.1
1658 { 'command': 'memsave',
1659   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1662 # @pmemsave:
1664 # Save a portion of guest physical memory to a file.
1666 # @val: the physical address of the guest to start from
1668 # @size: the size of memory region to save
1670 # @filename: the file to save the memory to as binary data
1672 # Returns: Nothing on success
1674 # Since: 0.14.0
1676 # Notes: Errors were not reliably returned until 1.1
1678 { 'command': 'pmemsave',
1679   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1682 # @cont:
1684 # Resume guest VCPU execution.
1686 # Since:  0.14.0
1688 # Returns:  If successful, nothing
1689 #           If QEMU was started with an encrypted block device and a key has
1690 #              not yet been set, DeviceEncrypted.
1692 # Notes:  This command will succeed if the guest is currently running.  It
1693 #         will also succeed if the guest is in the "inmigrate" state; in
1694 #         this case, the effect of the command is to make sure the guest
1695 #         starts once migration finishes, removing the effect of the -S
1696 #         command line option if it was passed.
1698 { 'command': 'cont' }
1701 # @system_wakeup:
1703 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1705 # Since:  1.1
1707 # Returns:  nothing.
1709 { 'command': 'system_wakeup' }
1712 # @inject-nmi:
1714 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1716 # Returns:  If successful, nothing
1718 # Since:  0.14.0
1720 # Notes: Only x86 Virtual Machines support this command.
1722 { 'command': 'inject-nmi' }
1725 # @set_link:
1727 # Sets the link status of a virtual network adapter.
1729 # @name: the device name of the virtual network adapter
1731 # @up: true to set the link status to be up
1733 # Returns: Nothing on success
1734 #          If @name is not a valid network device, DeviceNotFound
1736 # Since: 0.14.0
1738 # Notes: Not all network adapters support setting link status.  This command
1739 #        will succeed even if the network adapter does not support link status
1740 #        notification.
1742 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1745 # @block_passwd:
1747 # This command sets the password of a block device that has not been open
1748 # with a password and requires one.
1750 # The two cases where this can happen are a block device is created through
1751 # QEMU's initial command line or a block device is changed through the legacy
1752 # @change interface.
1754 # In the event that the block device is created through the initial command
1755 # line, the VM will start in the stopped state regardless of whether '-S' is
1756 # used.  The intention is for a management tool to query the block devices to
1757 # determine which ones are encrypted, set the passwords with this command, and
1758 # then start the guest with the @cont command.
1760 # Either @device or @node-name must be set but not both.
1762 # @device: #optional the name of the block backend device to set the password on
1764 # @node-name: #optional graph node name to set the password on (Since 2.0)
1766 # @password: the password to use for the device
1768 # Returns: nothing on success
1769 #          If @device is not a valid block device, DeviceNotFound
1770 #          If @device is not encrypted, DeviceNotEncrypted
1772 # Notes:  Not all block formats support encryption and some that do are not
1773 #         able to validate that a password is correct.  Disk corruption may
1774 #         occur if an invalid password is specified.
1776 # Since: 0.14.0
1778 { 'command': 'block_passwd', 'data': {'*device': 'str',
1779                                       '*node-name': 'str', 'password': 'str'} }
1782 # @balloon:
1784 # Request the balloon driver to change its balloon size.
1786 # @value: the target size of the balloon in bytes
1788 # Returns: Nothing on success
1789 #          If the balloon driver is enabled but not functional because the KVM
1790 #            kernel module cannot support it, KvmMissingCap
1791 #          If no balloon device is present, DeviceNotActive
1793 # Notes: This command just issues a request to the guest.  When it returns,
1794 #        the balloon size may not have changed.  A guest can change the balloon
1795 #        size independent of this command.
1797 # Since: 0.14.0
1799 { 'command': 'balloon', 'data': {'value': 'int'} }
1802 # @block_resize
1804 # Resize a block image while a guest is running.
1806 # Either @device or @node-name must be set but not both.
1808 # @device: #optional the name of the device to get the image resized
1810 # @node-name: #optional graph node name to get the image resized (Since 2.0)
1812 # @size:  new image size in bytes
1814 # Returns: nothing on success
1815 #          If @device is not a valid block device, DeviceNotFound
1817 # Since: 0.14.0
1819 { 'command': 'block_resize', 'data': { '*device': 'str',
1820                                        '*node-name': 'str',
1821                                        'size': 'int' }}
1824 # @NewImageMode
1826 # An enumeration that tells QEMU how to set the backing file path in
1827 # a new image file.
1829 # @existing: QEMU should look for an existing image file.
1831 # @absolute-paths: QEMU should create a new image with absolute paths
1832 # for the backing file. If there is no backing file available, the new
1833 # image will not be backed either.
1835 # Since: 1.1
1837 { 'enum': 'NewImageMode',
1838   'data': [ 'existing', 'absolute-paths' ] }
1841 # @BlockdevSnapshot
1843 # Either @device or @node-name must be set but not both.
1845 # @device: #optional the name of the device to generate the snapshot from.
1847 # @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
1849 # @snapshot-file: the target of the new image. A new file will be created.
1851 # @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
1853 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1855 # @mode: #optional whether and how QEMU should create a new image, default is
1856 #        'absolute-paths'.
1858 { 'type': 'BlockdevSnapshot',
1859   'data': { '*device': 'str', '*node-name': 'str',
1860             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1861             '*format': 'str', '*mode': 'NewImageMode' } }
1864 # @BlockdevSnapshotInternal
1866 # @device: the name of the device to generate the snapshot from
1868 # @name: the name of the internal snapshot to be created
1870 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1871 #        exists, the operation will fail. Only some image formats support it,
1872 #        for example, qcow2, rbd, and sheepdog.
1874 # Since: 1.7
1876 { 'type': 'BlockdevSnapshotInternal',
1877   'data': { 'device': 'str', 'name': 'str' } }
1880 # @DriveBackup
1882 # @device: the name of the device which should be copied.
1884 # @target: the target of the new image. If the file exists, or if it
1885 #          is a device, the existing file/device will be used as the new
1886 #          destination.  If it does not exist, a new file will be created.
1888 # @format: #optional the format of the new destination, default is to
1889 #          probe if @mode is 'existing', else the format of the source
1891 # @sync: what parts of the disk image should be copied to the destination
1892 #        (all the disk, only the sectors allocated in the topmost image, or
1893 #        only new I/O).
1895 # @mode: #optional whether and how QEMU should create a new image, default is
1896 #        'absolute-paths'.
1898 # @speed: #optional the maximum speed, in bytes per second
1900 # @on-source-error: #optional the action to take on an error on the source,
1901 #                   default 'report'.  'stop' and 'enospc' can only be used
1902 #                   if the block device supports io-status (see BlockInfo).
1904 # @on-target-error: #optional the action to take on an error on the target,
1905 #                   default 'report' (no limitations, since this applies to
1906 #                   a different block device than @device).
1908 # Note that @on-source-error and @on-target-error only affect background I/O.
1909 # If an error occurs during a guest write request, the device's rerror/werror
1910 # actions will be used.
1912 # Since: 1.6
1914 { 'type': 'DriveBackup',
1915   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1916             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1917             '*speed': 'int',
1918             '*on-source-error': 'BlockdevOnError',
1919             '*on-target-error': 'BlockdevOnError' } }
1922 # @Abort
1924 # This action can be used to test transaction failure.
1926 # Since: 1.6
1928 { 'type': 'Abort',
1929   'data': { } }
1932 # @TransactionAction
1934 # A discriminated record of operations that can be performed with
1935 # @transaction.
1937 { 'union': 'TransactionAction',
1938   'data': {
1939        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1940        'drive-backup': 'DriveBackup',
1941        'abort': 'Abort',
1942        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1943    } }
1946 # @transaction
1948 # Executes a number of transactionable QMP commands atomically. If any
1949 # operation fails, then the entire set of actions will be abandoned and the
1950 # appropriate error returned.
1952 #  List of:
1953 #  @TransactionAction: information needed for the respective operation
1955 # Returns: nothing on success
1956 #          Errors depend on the operations of the transaction
1958 # Note: The transaction aborts on the first failure.  Therefore, there will be
1959 # information on only one failed operation returned in an error condition, and
1960 # subsequent actions will not have been attempted.
1962 # Since 1.1
1964 { 'command': 'transaction',
1965   'data': { 'actions': [ 'TransactionAction' ] } }
1968 # @blockdev-snapshot-sync
1970 # Generates a synchronous snapshot of a block device.
1972 # For the arguments, see the documentation of BlockdevSnapshot.
1974 # Returns: nothing on success
1975 #          If @device is not a valid block device, DeviceNotFound
1977 # Since 0.14.0
1979 { 'command': 'blockdev-snapshot-sync',
1980   'data': 'BlockdevSnapshot' }
1983 # @blockdev-snapshot-internal-sync
1985 # Synchronously take an internal snapshot of a block device, when the format
1986 # of the image used supports it.
1988 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1990 # Returns: nothing on success
1991 #          If @device is not a valid block device, DeviceNotFound
1992 #          If any snapshot matching @name exists, or @name is empty,
1993 #          GenericError
1994 #          If the format of the image used does not support it,
1995 #          BlockFormatFeatureNotSupported
1997 # Since 1.7
1999 { 'command': 'blockdev-snapshot-internal-sync',
2000   'data': 'BlockdevSnapshotInternal' }
2003 # @blockdev-snapshot-delete-internal-sync
2005 # Synchronously delete an internal snapshot of a block device, when the format
2006 # of the image used support it. The snapshot is identified by name or id or
2007 # both. One of the name or id is required. Return SnapshotInfo for the
2008 # successfully deleted snapshot.
2010 # @device: the name of the device to delete the snapshot from
2012 # @id: optional the snapshot's ID to be deleted
2014 # @name: optional the snapshot's name to be deleted
2016 # Returns: SnapshotInfo on success
2017 #          If @device is not a valid block device, DeviceNotFound
2018 #          If snapshot not found, GenericError
2019 #          If the format of the image used does not support it,
2020 #          BlockFormatFeatureNotSupported
2021 #          If @id and @name are both not specified, GenericError
2023 # Since 1.7
2025 { 'command': 'blockdev-snapshot-delete-internal-sync',
2026   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
2027   'returns': 'SnapshotInfo' }
2030 # @human-monitor-command:
2032 # Execute a command on the human monitor and return the output.
2034 # @command-line: the command to execute in the human monitor
2036 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2038 # Returns: the output of the command as a string
2040 # Since: 0.14.0
2042 # Notes: This command only exists as a stop-gap.  Its use is highly
2043 #        discouraged.  The semantics of this command are not guaranteed.
2045 #        Known limitations:
2047 #        o This command is stateless, this means that commands that depend
2048 #          on state information (such as getfd) might not work
2050 #       o Commands that prompt the user for data (eg. 'cont' when the block
2051 #         device is encrypted) don't currently work
2053 { 'command': 'human-monitor-command',
2054   'data': {'command-line': 'str', '*cpu-index': 'int'},
2055   'returns': 'str' }
2058 # @block-commit
2060 # Live commit of data from overlay image nodes into backing nodes - i.e.,
2061 # writes data between 'top' and 'base' into 'base'.
2063 # @device:  the name of the device
2065 # @base:   #optional The file name of the backing image to write data into.
2066 #                    If not specified, this is the deepest backing image
2068 # @top:              The file name of the backing image within the image chain,
2069 #                    which contains the topmost data to be committed down.
2071 #                    If top == base, that is an error.
2072 #                    If top == active, the job will not be completed by itself,
2073 #                    user needs to complete the job with the block-job-complete
2074 #                    command after getting the ready event. (Since 2.0)
2076 #                    If the base image is smaller than top, then the base image
2077 #                    will be resized to be the same size as top.  If top is
2078 #                    smaller than the base image, the base will not be
2079 #                    truncated.  If you want the base image size to match the
2080 #                    size of the smaller top, you can safely truncate it
2081 #                    yourself once the commit operation successfully completes.
2084 # @speed:  #optional the maximum speed, in bytes per second
2086 # Returns: Nothing on success
2087 #          If commit or stream is already active on this device, DeviceInUse
2088 #          If @device does not exist, DeviceNotFound
2089 #          If image commit is not supported by this device, NotSupported
2090 #          If @base or @top is invalid, a generic error is returned
2091 #          If @speed is invalid, InvalidParameter
2093 # Since: 1.3
2096 { 'command': 'block-commit',
2097   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
2098             '*speed': 'int' } }
2101 # @drive-backup
2103 # Start a point-in-time copy of a block device to a new destination.  The
2104 # status of ongoing drive-backup operations can be checked with
2105 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
2106 # The operation can be stopped before it has completed using the
2107 # block-job-cancel command.
2109 # For the arguments, see the documentation of DriveBackup.
2111 # Returns: nothing on success
2112 #          If @device is not a valid block device, DeviceNotFound
2114 # Since 1.6
2116 { 'command': 'drive-backup', 'data': 'DriveBackup' }
2119 # @query-named-block-nodes
2121 # Get the named block driver list
2123 # Returns: the list of BlockDeviceInfo
2125 # Since 2.0
2127 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
2130 # @drive-mirror
2132 # Start mirroring a block device's writes to a new destination.
2134 # @device:  the name of the device whose writes should be mirrored.
2136 # @target: the target of the new image. If the file exists, or if it
2137 #          is a device, the existing file/device will be used as the new
2138 #          destination.  If it does not exist, a new file will be created.
2140 # @format: #optional the format of the new destination, default is to
2141 #          probe if @mode is 'existing', else the format of the source
2143 # @mode: #optional whether and how QEMU should create a new image, default is
2144 #        'absolute-paths'.
2146 # @speed:  #optional the maximum speed, in bytes per second
2148 # @sync: what parts of the disk image should be copied to the destination
2149 #        (all the disk, only the sectors allocated in the topmost image, or
2150 #        only new I/O).
2152 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2153 #               if the image format doesn't have clusters, 4K if the clusters
2154 #               are smaller than that, else the cluster size.  Must be a
2155 #               power of 2 between 512 and 64M (since 1.4).
2157 # @buf-size: #optional maximum amount of data in flight from source to
2158 #            target (since 1.4).
2160 # @on-source-error: #optional the action to take on an error on the source,
2161 #                   default 'report'.  'stop' and 'enospc' can only be used
2162 #                   if the block device supports io-status (see BlockInfo).
2164 # @on-target-error: #optional the action to take on an error on the target,
2165 #                   default 'report' (no limitations, since this applies to
2166 #                   a different block device than @device).
2168 # Returns: nothing on success
2169 #          If @device is not a valid block device, DeviceNotFound
2171 # Since 1.3
2173 { 'command': 'drive-mirror',
2174   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2175             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2176             '*speed': 'int', '*granularity': 'uint32',
2177             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2178             '*on-target-error': 'BlockdevOnError' } }
2181 # @migrate_cancel
2183 # Cancel the current executing migration process.
2185 # Returns: nothing on success
2187 # Notes: This command succeeds even if there is no migration process running.
2189 # Since: 0.14.0
2191 { 'command': 'migrate_cancel' }
2194 # @migrate_set_downtime
2196 # Set maximum tolerated downtime for migration.
2198 # @value: maximum downtime in seconds
2200 # Returns: nothing on success
2202 # Since: 0.14.0
2204 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2207 # @migrate_set_speed
2209 # Set maximum speed for migration.
2211 # @value: maximum speed in bytes.
2213 # Returns: nothing on success
2215 # Notes: A value lesser than zero will be automatically round up to zero.
2217 # Since: 0.14.0
2219 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2222 # @migrate-set-cache-size
2224 # Set XBZRLE cache size
2226 # @value: cache size in bytes
2228 # The size will be rounded down to the nearest power of 2.
2229 # The cache size can be modified before and during ongoing migration
2231 # Returns: nothing on success
2233 # Since: 1.2
2235 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2238 # @query-migrate-cache-size
2240 # query XBZRLE cache size
2242 # Returns: XBZRLE cache size in bytes
2244 # Since: 1.2
2246 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2249 # @ObjectPropertyInfo:
2251 # @name: the name of the property
2253 # @type: the type of the property.  This will typically come in one of four
2254 #        forms:
2256 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2257 #           These types are mapped to the appropriate JSON type.
2259 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
2260 #           legacy qdev typename.  These types are always treated as strings.
2262 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
2263 #           device type name.  Child properties create the composition tree.
2265 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
2266 #           device type name.  Link properties form the device model graph.
2268 # Since: 1.2
2270 { 'type': 'ObjectPropertyInfo',
2271   'data': { 'name': 'str', 'type': 'str' } }
2274 # @qom-list:
2276 # This command will list any properties of a object given a path in the object
2277 # model.
2279 # @path: the path within the object model.  See @qom-get for a description of
2280 #        this parameter.
2282 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2283 #          object.
2285 # Since: 1.2
2287 { 'command': 'qom-list',
2288   'data': { 'path': 'str' },
2289   'returns': [ 'ObjectPropertyInfo' ] }
2292 # @qom-get:
2294 # This command will get a property from a object model path and return the
2295 # value.
2297 # @path: The path within the object model.  There are two forms of supported
2298 #        paths--absolute and partial paths.
2300 #        Absolute paths are derived from the root object and can follow child<>
2301 #        or link<> properties.  Since they can follow link<> properties, they
2302 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2303 #        and are prefixed  with a leading slash.
2305 #        Partial paths look like relative filenames.  They do not begin
2306 #        with a prefix.  The matching rules for partial paths are subtle but
2307 #        designed to make specifying objects easy.  At each level of the
2308 #        composition tree, the partial path is matched as an absolute path.
2309 #        The first match is not returned.  At least two matches are searched
2310 #        for.  A successful result is only returned if only one match is
2311 #        found.  If more than one match is found, a flag is return to
2312 #        indicate that the match was ambiguous.
2314 # @property: The property name to read
2316 # Returns: The property value.  The type depends on the property type.  legacy<>
2317 #          properties are returned as #str.  child<> and link<> properties are
2318 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2319 #          are returned as #int.
2321 # Since: 1.2
2323 { 'command': 'qom-get',
2324   'data': { 'path': 'str', 'property': 'str' },
2325   'returns': 'visitor',
2326   'gen': 'no' }
2329 # @qom-set:
2331 # This command will set a property from a object model path.
2333 # @path: see @qom-get for a description of this parameter
2335 # @property: the property name to set
2337 # @value: a value who's type is appropriate for the property type.  See @qom-get
2338 #         for a description of type mapping.
2340 # Since: 1.2
2342 { 'command': 'qom-set',
2343   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2344   'gen': 'no' }
2347 # @set_password:
2349 # Sets the password of a remote display session.
2351 # @protocol: `vnc' to modify the VNC server password
2352 #            `spice' to modify the Spice server password
2354 # @password: the new password
2356 # @connected: #optional how to handle existing clients when changing the
2357 #                       password.  If nothing is specified, defaults to `keep'
2358 #                       `fail' to fail the command if clients are connected
2359 #                       `disconnect' to disconnect existing clients
2360 #                       `keep' to maintain existing clients
2362 # Returns: Nothing on success
2363 #          If Spice is not enabled, DeviceNotFound
2365 # Since: 0.14.0
2367 { 'command': 'set_password',
2368   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2371 # @expire_password:
2373 # Expire the password of a remote display server.
2375 # @protocol: the name of the remote display protocol `vnc' or `spice'
2377 # @time: when to expire the password.
2378 #        `now' to expire the password immediately
2379 #        `never' to cancel password expiration
2380 #        `+INT' where INT is the number of seconds from now (integer)
2381 #        `INT' where INT is the absolute time in seconds
2383 # Returns: Nothing on success
2384 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2386 # Since: 0.14.0
2388 # Notes: Time is relative to the server and currently there is no way to
2389 #        coordinate server time with client time.  It is not recommended to
2390 #        use the absolute time version of the @time parameter unless you're
2391 #        sure you are on the same machine as the QEMU instance.
2393 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2396 # @eject:
2398 # Ejects a device from a removable drive.
2400 # @device:  The name of the device
2402 # @force:   @optional If true, eject regardless of whether the drive is locked.
2403 #           If not specified, the default value is false.
2405 # Returns:  Nothing on success
2406 #           If @device is not a valid block device, DeviceNotFound
2408 # Notes:    Ejecting a device will no media results in success
2410 # Since: 0.14.0
2412 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2415 # @change-vnc-password:
2417 # Change the VNC server password.
2419 # @target:  the new password to use with VNC authentication
2421 # Since: 1.1
2423 # Notes:  An empty password in this command will set the password to the empty
2424 #         string.  Existing clients are unaffected by executing this command.
2426 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2429 # @change:
2431 # This command is multiple commands multiplexed together.
2433 # @device: This is normally the name of a block device but it may also be 'vnc'.
2434 #          when it's 'vnc', then sub command depends on @target
2436 # @target: If @device is a block device, then this is the new filename.
2437 #          If @device is 'vnc', then if the value 'password' selects the vnc
2438 #          change password command.   Otherwise, this specifies a new server URI
2439 #          address to listen to for VNC connections.
2441 # @arg:    If @device is a block device, then this is an optional format to open
2442 #          the device with.
2443 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2444 #          password to set.  If this argument is an empty string, then no future
2445 #          logins will be allowed.
2447 # Returns: Nothing on success.
2448 #          If @device is not a valid block device, DeviceNotFound
2449 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2450 #          if this error is returned, the device has been opened successfully
2451 #          and an additional call to @block_passwd is required to set the
2452 #          device's password.  The behavior of reads and writes to the block
2453 #          device between when these calls are executed is undefined.
2455 # Notes:  It is strongly recommended that this interface is not used especially
2456 #         for changing block devices.
2458 # Since: 0.14.0
2460 { 'command': 'change',
2461   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2464 # @block_set_io_throttle:
2466 # Change I/O throttle limits for a block drive.
2468 # @device: The name of the device
2470 # @bps: total throughput limit in bytes per second
2472 # @bps_rd: read throughput limit in bytes per second
2474 # @bps_wr: write throughput limit in bytes per second
2476 # @iops: total I/O operations per second
2478 # @ops_rd: read I/O operations per second
2480 # @iops_wr: write I/O operations per second
2482 # @bps_max: #optional total max in bytes (Since 1.7)
2484 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2486 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2488 # @iops_max: #optional total I/O operations max (Since 1.7)
2490 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2492 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2494 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2496 # Returns: Nothing on success
2497 #          If @device is not a valid block device, DeviceNotFound
2499 # Since: 1.1
2501 { 'command': 'block_set_io_throttle',
2502   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2503             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2504             '*bps_max': 'int', '*bps_rd_max': 'int',
2505             '*bps_wr_max': 'int', '*iops_max': 'int',
2506             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2507             '*iops_size': 'int' } }
2510 # @block-stream:
2512 # Copy data from a backing file into a block device.
2514 # The block streaming operation is performed in the background until the entire
2515 # backing file has been copied.  This command returns immediately once streaming
2516 # has started.  The status of ongoing block streaming operations can be checked
2517 # with query-block-jobs.  The operation can be stopped before it has completed
2518 # using the block-job-cancel command.
2520 # If a base file is specified then sectors are not copied from that base file and
2521 # its backing chain.  When streaming completes the image file will have the base
2522 # file as its backing file.  This can be used to stream a subset of the backing
2523 # file chain instead of flattening the entire image.
2525 # On successful completion the image file is updated to drop the backing file
2526 # and the BLOCK_JOB_COMPLETED event is emitted.
2528 # @device: the device name
2530 # @base:   #optional the common backing file name
2532 # @speed:  #optional the maximum speed, in bytes per second
2534 # @on-error: #optional the action to take on an error (default report).
2535 #            'stop' and 'enospc' can only be used if the block device
2536 #            supports io-status (see BlockInfo).  Since 1.3.
2538 # Returns: Nothing on success
2539 #          If @device does not exist, DeviceNotFound
2541 # Since: 1.1
2543 { 'command': 'block-stream',
2544   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2545             '*on-error': 'BlockdevOnError' } }
2548 # @block-job-set-speed:
2550 # Set maximum speed for a background block operation.
2552 # This command can only be issued when there is an active block job.
2554 # Throttling can be disabled by setting the speed to 0.
2556 # @device: the device name
2558 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2559 #          Defaults to 0.
2561 # Returns: Nothing on success
2562 #          If no background operation is active on this device, DeviceNotActive
2564 # Since: 1.1
2566 { 'command': 'block-job-set-speed',
2567   'data': { 'device': 'str', 'speed': 'int' } }
2570 # @block-job-cancel:
2572 # Stop an active background block operation.
2574 # This command returns immediately after marking the active background block
2575 # operation for cancellation.  It is an error to call this command if no
2576 # operation is in progress.
2578 # The operation will cancel as soon as possible and then emit the
2579 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2580 # enumerated using query-block-jobs.
2582 # For streaming, the image file retains its backing file unless the streaming
2583 # operation happens to complete just as it is being cancelled.  A new streaming
2584 # operation can be started at a later time to finish copying all data from the
2585 # backing file.
2587 # @device: the device name
2589 # @force: #optional whether to allow cancellation of a paused job (default
2590 #         false).  Since 1.3.
2592 # Returns: Nothing on success
2593 #          If no background operation is active on this device, DeviceNotActive
2595 # Since: 1.1
2597 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2600 # @block-job-pause:
2602 # Pause an active background block operation.
2604 # This command returns immediately after marking the active background block
2605 # operation for pausing.  It is an error to call this command if no
2606 # operation is in progress.  Pausing an already paused job has no cumulative
2607 # effect; a single block-job-resume command will resume the job.
2609 # The operation will pause as soon as possible.  No event is emitted when
2610 # the operation is actually paused.  Cancelling a paused job automatically
2611 # resumes it.
2613 # @device: the device name
2615 # Returns: Nothing on success
2616 #          If no background operation is active on this device, DeviceNotActive
2618 # Since: 1.3
2620 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2623 # @block-job-resume:
2625 # Resume an active background block operation.
2627 # This command returns immediately after resuming a paused background block
2628 # operation.  It is an error to call this command if no operation is in
2629 # progress.  Resuming an already running job is not an error.
2631 # This command also clears the error status of the job.
2633 # @device: the device name
2635 # Returns: Nothing on success
2636 #          If no background operation is active on this device, DeviceNotActive
2638 # Since: 1.3
2640 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2643 # @block-job-complete:
2645 # Manually trigger completion of an active background block operation.  This
2646 # is supported for drive mirroring, where it also switches the device to
2647 # write to the target path only.  The ability to complete is signaled with
2648 # a BLOCK_JOB_READY event.
2650 # This command completes an active background block operation synchronously.
2651 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2652 # is not defined.  Note that if an I/O error occurs during the processing of
2653 # this command: 1) the command itself will fail; 2) the error will be processed
2654 # according to the rerror/werror arguments that were specified when starting
2655 # the operation.
2657 # A cancelled or paused job cannot be completed.
2659 # @device: the device name
2661 # Returns: Nothing on success
2662 #          If no background operation is active on this device, DeviceNotActive
2664 # Since: 1.3
2666 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2669 # @ObjectTypeInfo:
2671 # This structure describes a search result from @qom-list-types
2673 # @name: the type name found in the search
2675 # Since: 1.1
2677 # Notes: This command is experimental and may change syntax in future releases.
2679 { 'type': 'ObjectTypeInfo',
2680   'data': { 'name': 'str' } }
2683 # @qom-list-types:
2685 # This command will return a list of types given search parameters
2687 # @implements: if specified, only return types that implement this type name
2689 # @abstract: if true, include abstract types in the results
2691 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2693 # Since: 1.1
2695 { 'command': 'qom-list-types',
2696   'data': { '*implements': 'str', '*abstract': 'bool' },
2697   'returns': [ 'ObjectTypeInfo' ] }
2700 # @DevicePropertyInfo:
2702 # Information about device properties.
2704 # @name: the name of the property
2705 # @type: the typename of the property
2707 # Since: 1.2
2709 { 'type': 'DevicePropertyInfo',
2710   'data': { 'name': 'str', 'type': 'str' } }
2713 # @device-list-properties:
2715 # List properties associated with a device.
2717 # @typename: the type name of a device
2719 # Returns: a list of DevicePropertyInfo describing a devices properties
2721 # Since: 1.2
2723 { 'command': 'device-list-properties',
2724   'data': { 'typename': 'str'},
2725   'returns': [ 'DevicePropertyInfo' ] }
2728 # @migrate
2730 # Migrates the current running guest to another Virtual Machine.
2732 # @uri: the Uniform Resource Identifier of the destination VM
2734 # @blk: #optional do block migration (full disk copy)
2736 # @inc: #optional incremental disk copy migration
2738 # @detach: this argument exists only for compatibility reasons and
2739 #          is ignored by QEMU
2741 # Returns: nothing on success
2743 # Since: 0.14.0
2745 { 'command': 'migrate',
2746   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2748 # @xen-save-devices-state:
2750 # Save the state of all devices to file. The RAM and the block devices
2751 # of the VM are not saved by this command.
2753 # @filename: the file to save the state of the devices to as binary
2754 # data. See xen-save-devices-state.txt for a description of the binary
2755 # format.
2757 # Returns: Nothing on success
2759 # Since: 1.1
2761 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2764 # @xen-set-global-dirty-log
2766 # Enable or disable the global dirty log mode.
2768 # @enable: true to enable, false to disable.
2770 # Returns: nothing
2772 # Since: 1.3
2774 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2777 # @device_del:
2779 # Remove a device from a guest
2781 # @id: the name of the device
2783 # Returns: Nothing on success
2784 #          If @id is not a valid device, DeviceNotFound
2786 # Notes: When this command completes, the device may not be removed from the
2787 #        guest.  Hot removal is an operation that requires guest cooperation.
2788 #        This command merely requests that the guest begin the hot removal
2789 #        process.  Completion of the device removal process is signaled with a
2790 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2791 #        for all devices.
2793 # Since: 0.14.0
2795 { 'command': 'device_del', 'data': {'id': 'str'} }
2798 # @DumpGuestMemoryFormat:
2800 # An enumeration of guest-memory-dump's format.
2802 # @elf: elf format
2804 # @kdump-zlib: kdump-compressed format with zlib-compressed
2806 # @kdump-lzo: kdump-compressed format with lzo-compressed
2808 # @kdump-snappy: kdump-compressed format with snappy-compressed
2810 # Since: 2.0
2812 { 'enum': 'DumpGuestMemoryFormat',
2813   'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
2816 # @dump-guest-memory
2818 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2819 # very long depending on the amount of guest memory. This command is only
2820 # supported on i386 and x86_64.
2822 # @paging: if true, do paging to get guest's memory mapping. This allows
2823 #          using gdb to process the core file.
2825 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2826 #                     of RAM. This can happen for a large guest, or a
2827 #                     malicious guest pretending to be large.
2829 #          Also, paging=true has the following limitations:
2831 #             1. The guest may be in a catastrophic state or can have corrupted
2832 #                memory, which cannot be trusted
2833 #             2. The guest can be in real-mode even if paging is enabled. For
2834 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2835 #                goes in real-mode
2837 # @protocol: the filename or file descriptor of the vmcore. The supported
2838 #            protocols are:
2840 #            1. file: the protocol starts with "file:", and the following
2841 #               string is the file's path.
2842 #            2. fd: the protocol starts with "fd:", and the following string
2843 #               is the fd's name.
2845 # @begin: #optional if specified, the starting physical address.
2847 # @length: #optional if specified, the memory size, in bytes. If you don't
2848 #          want to dump all guest's memory, please specify the start @begin
2849 #          and @length
2851 # @format: #optional if specified, the format of guest memory dump. But non-elf
2852 #          format is conflict with paging and filter, ie. @paging, @begin and
2853 #          @length is not allowed to be specified with non-elf @format at the
2854 #          same time (since 2.0)
2856 # Returns: nothing on success
2858 # Since: 1.2
2860 { 'command': 'dump-guest-memory',
2861   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2862             '*length': 'int', '*format': 'DumpGuestMemoryFormat' } }
2865 # @DumpGuestMemoryCapability:
2867 # A list of the available formats for dump-guest-memory
2869 # Since: 2.0
2871 { 'type': 'DumpGuestMemoryCapability',
2872   'data': {
2873       'formats': ['DumpGuestMemoryFormat'] } }
2876 # @query-dump-guest-memory-capability:
2878 # Returns the available formats for dump-guest-memory
2880 # Returns:  A @DumpGuestMemoryCapability object listing available formats for
2881 #           dump-guest-memory
2883 # Since: 2.0
2885 { 'command': 'query-dump-guest-memory-capability',
2886   'returns': 'DumpGuestMemoryCapability' }
2889 # @netdev_add:
2891 # Add a network backend.
2893 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2894 #        'vde', 'socket', 'dump' and 'bridge'
2896 # @id: the name of the new network backend
2898 # @props: #optional a list of properties to be passed to the backend in
2899 #         the format 'name=value', like 'ifname=tap0,script=no'
2901 # Notes: The semantics of @props is not well defined.  Future commands will be
2902 #        introduced that provide stronger typing for backend creation.
2904 # Since: 0.14.0
2906 # Returns: Nothing on success
2907 #          If @type is not a valid network backend, DeviceNotFound
2909 { 'command': 'netdev_add',
2910   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2911   'gen': 'no' }
2914 # @netdev_del:
2916 # Remove a network backend.
2918 # @id: the name of the network backend to remove
2920 # Returns: Nothing on success
2921 #          If @id is not a valid network backend, DeviceNotFound
2923 # Since: 0.14.0
2925 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2928 # @object-add:
2930 # Create a QOM object.
2932 # @qom-type: the class name for the object to be created
2934 # @id: the name of the new object
2936 # @props: #optional a dictionary of properties to be passed to the backend
2938 # Returns: Nothing on success
2939 #          Error if @qom-type is not a valid class name
2941 # Since: 2.0
2943 { 'command': 'object-add',
2944   'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
2945   'gen': 'no' }
2948 # @object-del:
2950 # Remove a QOM object.
2952 # @id: the name of the QOM object to remove
2954 # Returns: Nothing on success
2955 #          Error if @id is not a valid id for a QOM object
2957 # Since: 2.0
2959 { 'command': 'object-del', 'data': {'id': 'str'} }
2962 # @NetdevNoneOptions
2964 # Use it alone to have zero network devices.
2966 # Since 1.2
2968 { 'type': 'NetdevNoneOptions',
2969   'data': { } }
2972 # @NetLegacyNicOptions
2974 # Create a new Network Interface Card.
2976 # @netdev: #optional id of -netdev to connect to
2978 # @macaddr: #optional MAC address
2980 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2982 # @addr: #optional PCI device address
2984 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2986 # Since 1.2
2988 { 'type': 'NetLegacyNicOptions',
2989   'data': {
2990     '*netdev':  'str',
2991     '*macaddr': 'str',
2992     '*model':   'str',
2993     '*addr':    'str',
2994     '*vectors': 'uint32' } }
2997 # @String
2999 # A fat type wrapping 'str', to be embedded in lists.
3001 # Since 1.2
3003 { 'type': 'String',
3004   'data': {
3005     'str': 'str' } }
3008 # @NetdevUserOptions
3010 # Use the user mode network stack which requires no administrator privilege to
3011 # run.
3013 # @hostname: #optional client hostname reported by the builtin DHCP server
3015 # @restrict: #optional isolate the guest from the host
3017 # @ip: #optional legacy parameter, use net= instead
3019 # @net: #optional IP address and optional netmask
3021 # @host: #optional guest-visible address of the host
3023 # @tftp: #optional root directory of the built-in TFTP server
3025 # @bootfile: #optional BOOTP filename, for use with tftp=
3027 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
3028 #             assign
3030 # @dns: #optional guest-visible address of the virtual nameserver
3032 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
3033 #             to the guest
3035 # @smb: #optional root directory of the built-in SMB server
3037 # @smbserver: #optional IP address of the built-in SMB server
3039 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
3040 #           endpoints
3042 # @guestfwd: #optional forward guest TCP connections
3044 # Since 1.2
3046 { 'type': 'NetdevUserOptions',
3047   'data': {
3048     '*hostname':  'str',
3049     '*restrict':  'bool',
3050     '*ip':        'str',
3051     '*net':       'str',
3052     '*host':      'str',
3053     '*tftp':      'str',
3054     '*bootfile':  'str',
3055     '*dhcpstart': 'str',
3056     '*dns':       'str',
3057     '*dnssearch': ['String'],
3058     '*smb':       'str',
3059     '*smbserver': 'str',
3060     '*hostfwd':   ['String'],
3061     '*guestfwd':  ['String'] } }
3064 # @NetdevTapOptions
3066 # Connect the host TAP network interface name to the VLAN.
3068 # @ifname: #optional interface name
3070 # @fd: #optional file descriptor of an already opened tap
3072 # @fds: #optional multiple file descriptors of already opened multiqueue capable
3073 # tap
3075 # @script: #optional script to initialize the interface
3077 # @downscript: #optional script to shut down the interface
3079 # @helper: #optional command to execute to configure bridge
3081 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3083 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3085 # @vhost: #optional enable vhost-net network accelerator
3087 # @vhostfd: #optional file descriptor of an already opened vhost net device
3089 # @vhostfds: #optional file descriptors of multiple already opened vhost net
3090 # devices
3092 # @vhostforce: #optional vhost on for non-MSIX virtio guests
3094 # @queues: #optional number of queues to be created for multiqueue capable tap
3096 # Since 1.2
3098 { 'type': 'NetdevTapOptions',
3099   'data': {
3100     '*ifname':     'str',
3101     '*fd':         'str',
3102     '*fds':        'str',
3103     '*script':     'str',
3104     '*downscript': 'str',
3105     '*helper':     'str',
3106     '*sndbuf':     'size',
3107     '*vnet_hdr':   'bool',
3108     '*vhost':      'bool',
3109     '*vhostfd':    'str',
3110     '*vhostfds':   'str',
3111     '*vhostforce': 'bool',
3112     '*queues':     'uint32'} }
3115 # @NetdevSocketOptions
3117 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3118 # socket connection.
3120 # @fd: #optional file descriptor of an already opened socket
3122 # @listen: #optional port number, and optional hostname, to listen on
3124 # @connect: #optional port number, and optional hostname, to connect to
3126 # @mcast: #optional UDP multicast address and port number
3128 # @localaddr: #optional source address and port for multicast and udp packets
3130 # @udp: #optional UDP unicast address and port number
3132 # Since 1.2
3134 { 'type': 'NetdevSocketOptions',
3135   'data': {
3136     '*fd':        'str',
3137     '*listen':    'str',
3138     '*connect':   'str',
3139     '*mcast':     'str',
3140     '*localaddr': 'str',
3141     '*udp':       'str' } }
3144 # @NetdevVdeOptions
3146 # Connect the VLAN to a vde switch running on the host.
3148 # @sock: #optional socket path
3150 # @port: #optional port number
3152 # @group: #optional group owner of socket
3154 # @mode: #optional permissions for socket
3156 # Since 1.2
3158 { 'type': 'NetdevVdeOptions',
3159   'data': {
3160     '*sock':  'str',
3161     '*port':  'uint16',
3162     '*group': 'str',
3163     '*mode':  'uint16' } }
3166 # @NetdevDumpOptions
3168 # Dump VLAN network traffic to a file.
3170 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3171 # suffixes.
3173 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3175 # Since 1.2
3177 { 'type': 'NetdevDumpOptions',
3178   'data': {
3179     '*len':  'size',
3180     '*file': 'str' } }
3183 # @NetdevBridgeOptions
3185 # Connect a host TAP network interface to a host bridge device.
3187 # @br: #optional bridge name
3189 # @helper: #optional command to execute to configure bridge
3191 # Since 1.2
3193 { 'type': 'NetdevBridgeOptions',
3194   'data': {
3195     '*br':     'str',
3196     '*helper': 'str' } }
3199 # @NetdevHubPortOptions
3201 # Connect two or more net clients through a software hub.
3203 # @hubid: hub identifier number
3205 # Since 1.2
3207 { 'type': 'NetdevHubPortOptions',
3208   'data': {
3209     'hubid':     'int32' } }
3212 # @NetdevNetmapOptions
3214 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3216 # @ifname: Either the name of an existing network interface supported by
3217 #          netmap, or the name of a VALE port (created on the fly).
3218 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3219 #          YYY are non-negative integers. XXX identifies a switch and
3220 #          YYY identifies a port of the switch. VALE ports having the
3221 #          same XXX are therefore connected to the same switch.
3223 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3225 # Since 2.0
3227 { 'type': 'NetdevNetmapOptions',
3228   'data': {
3229     'ifname':     'str',
3230     '*devname':    'str' } }
3233 # @NetClientOptions
3235 # A discriminated record of network device traits.
3237 # Since 1.2
3239 { 'union': 'NetClientOptions',
3240   'data': {
3241     'none':     'NetdevNoneOptions',
3242     'nic':      'NetLegacyNicOptions',
3243     'user':     'NetdevUserOptions',
3244     'tap':      'NetdevTapOptions',
3245     'socket':   'NetdevSocketOptions',
3246     'vde':      'NetdevVdeOptions',
3247     'dump':     'NetdevDumpOptions',
3248     'bridge':   'NetdevBridgeOptions',
3249     'hubport':  'NetdevHubPortOptions',
3250     'netmap':   'NetdevNetmapOptions' } }
3253 # @NetLegacy
3255 # Captures the configuration of a network device; legacy.
3257 # @vlan: #optional vlan number
3259 # @id: #optional identifier for monitor commands
3261 # @name: #optional identifier for monitor commands, ignored if @id is present
3263 # @opts: device type specific properties (legacy)
3265 # Since 1.2
3267 { 'type': 'NetLegacy',
3268   'data': {
3269     '*vlan': 'int32',
3270     '*id':   'str',
3271     '*name': 'str',
3272     'opts':  'NetClientOptions' } }
3275 # @Netdev
3277 # Captures the configuration of a network device.
3279 # @id: identifier for monitor commands.
3281 # @opts: device type specific properties
3283 # Since 1.2
3285 { 'type': 'Netdev',
3286   'data': {
3287     'id':   'str',
3288     'opts': 'NetClientOptions' } }
3291 # @InetSocketAddress
3293 # Captures a socket address or address range in the Internet namespace.
3295 # @host: host part of the address
3297 # @port: port part of the address, or lowest port if @to is present
3299 # @to: highest port to try
3301 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3302 #        #optional
3304 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3305 #        #optional
3307 # Since 1.3
3309 { 'type': 'InetSocketAddress',
3310   'data': {
3311     'host': 'str',
3312     'port': 'str',
3313     '*to': 'uint16',
3314     '*ipv4': 'bool',
3315     '*ipv6': 'bool' } }
3318 # @UnixSocketAddress
3320 # Captures a socket address in the local ("Unix socket") namespace.
3322 # @path: filesystem path to use
3324 # Since 1.3
3326 { 'type': 'UnixSocketAddress',
3327   'data': {
3328     'path': 'str' } }
3331 # @SocketAddress
3333 # Captures the address of a socket, which could also be a named file descriptor
3335 # Since 1.3
3337 { 'union': 'SocketAddress',
3338   'data': {
3339     'inet': 'InetSocketAddress',
3340     'unix': 'UnixSocketAddress',
3341     'fd': 'String' } }
3344 # @getfd:
3346 # Receive a file descriptor via SCM rights and assign it a name
3348 # @fdname: file descriptor name
3350 # Returns: Nothing on success
3352 # Since: 0.14.0
3354 # Notes: If @fdname already exists, the file descriptor assigned to
3355 #        it will be closed and replaced by the received file
3356 #        descriptor.
3357 #        The 'closefd' command can be used to explicitly close the
3358 #        file descriptor when it is no longer needed.
3360 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3363 # @closefd:
3365 # Close a file descriptor previously passed via SCM rights
3367 # @fdname: file descriptor name
3369 # Returns: Nothing on success
3371 # Since: 0.14.0
3373 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3376 # @MachineInfo:
3378 # Information describing a machine.
3380 # @name: the name of the machine
3382 # @alias: #optional an alias for the machine name
3384 # @default: #optional whether the machine is default
3386 # @cpu-max: maximum number of CPUs supported by the machine type
3387 #           (since 1.5.0)
3389 # Since: 1.2.0
3391 { 'type': 'MachineInfo',
3392   'data': { 'name': 'str', '*alias': 'str',
3393             '*is-default': 'bool', 'cpu-max': 'int' } }
3396 # @query-machines:
3398 # Return a list of supported machines
3400 # Returns: a list of MachineInfo
3402 # Since: 1.2.0
3404 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3407 # @CpuDefinitionInfo:
3409 # Virtual CPU definition.
3411 # @name: the name of the CPU definition
3413 # Since: 1.2.0
3415 { 'type': 'CpuDefinitionInfo',
3416   'data': { 'name': 'str' } }
3419 # @query-cpu-definitions:
3421 # Return a list of supported virtual CPU definitions
3423 # Returns: a list of CpuDefInfo
3425 # Since: 1.2.0
3427 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3429 # @AddfdInfo:
3431 # Information about a file descriptor that was added to an fd set.
3433 # @fdset-id: The ID of the fd set that @fd was added to.
3435 # @fd: The file descriptor that was received via SCM rights and
3436 #      added to the fd set.
3438 # Since: 1.2.0
3440 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3443 # @add-fd:
3445 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3447 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3449 # @opaque: #optional A free-form string that can be used to describe the fd.
3451 # Returns: @AddfdInfo on success
3452 #          If file descriptor was not received, FdNotSupplied
3453 #          If @fdset-id is a negative value, InvalidParameterValue
3455 # Notes: The list of fd sets is shared by all monitor connections.
3457 #        If @fdset-id is not specified, a new fd set will be created.
3459 # Since: 1.2.0
3461 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3462   'returns': 'AddfdInfo' }
3465 # @remove-fd:
3467 # Remove a file descriptor from an fd set.
3469 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3471 # @fd: #optional The file descriptor that is to be removed.
3473 # Returns: Nothing on success
3474 #          If @fdset-id or @fd is not found, FdNotFound
3476 # Since: 1.2.0
3478 # Notes: The list of fd sets is shared by all monitor connections.
3480 #        If @fd is not specified, all file descriptors in @fdset-id
3481 #        will be removed.
3483 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3486 # @FdsetFdInfo:
3488 # Information about a file descriptor that belongs to an fd set.
3490 # @fd: The file descriptor value.
3492 # @opaque: #optional A free-form string that can be used to describe the fd.
3494 # Since: 1.2.0
3496 { 'type': 'FdsetFdInfo',
3497   'data': {'fd': 'int', '*opaque': 'str'} }
3500 # @FdsetInfo:
3502 # Information about an fd set.
3504 # @fdset-id: The ID of the fd set.
3506 # @fds: A list of file descriptors that belong to this fd set.
3508 # Since: 1.2.0
3510 { 'type': 'FdsetInfo',
3511   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3514 # @query-fdsets:
3516 # Return information describing all fd sets.
3518 # Returns: A list of @FdsetInfo
3520 # Since: 1.2.0
3522 # Note: The list of fd sets is shared by all monitor connections.
3525 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3528 # @TargetInfo:
3530 # Information describing the QEMU target.
3532 # @arch: the target architecture (eg "x86_64", "i386", etc)
3534 # Since: 1.2.0
3536 { 'type': 'TargetInfo',
3537   'data': { 'arch': 'str' } }
3540 # @query-target:
3542 # Return information about the target for this QEMU
3544 # Returns: TargetInfo
3546 # Since: 1.2.0
3548 { 'command': 'query-target', 'returns': 'TargetInfo' }
3551 # @QKeyCode:
3553 # An enumeration of key name.
3555 # This is used by the send-key command.
3557 # Since: 1.3.0
3559 # 'unmapped' and 'pause' since 2.0
3561 { 'enum': 'QKeyCode',
3562   'data': [ 'unmapped',
3563             'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3564             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3565             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3566             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3567             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3568             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3569             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3570             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3571             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3572             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3573             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3574             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3575             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3576             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3577              'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause' ] }
3580 # @KeyValue
3582 # Represents a keyboard key.
3584 # Since: 1.3.0
3586 { 'union': 'KeyValue',
3587   'data': {
3588     'number': 'int',
3589     'qcode': 'QKeyCode' } }
3592 # @send-key:
3594 # Send keys to guest.
3596 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3597 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3598 #        directly to the guest, while @KeyValue.qcode must be a valid
3599 #        @QKeyCode value
3601 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3602 #             to 100
3604 # Returns: Nothing on success
3605 #          If key is unknown or redundant, InvalidParameter
3607 # Since: 1.3.0
3610 { 'command': 'send-key',
3611   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3614 # @screendump:
3616 # Write a PPM of the VGA screen to a file.
3618 # @filename: the path of a new PPM file to store the image
3620 # Returns: Nothing on success
3622 # Since: 0.14.0
3624 { 'command': 'screendump', 'data': {'filename': 'str'} }
3627 # @nbd-server-start:
3629 # Start an NBD server listening on the given host and port.  Block
3630 # devices can then be exported using @nbd-server-add.  The NBD
3631 # server will present them as named exports; for example, another
3632 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3634 # @addr: Address on which to listen.
3636 # Returns: error if the server is already running.
3638 # Since: 1.3.0
3640 { 'command': 'nbd-server-start',
3641   'data': { 'addr': 'SocketAddress' } }
3644 # @nbd-server-add:
3646 # Export a device to QEMU's embedded NBD server.
3648 # @device: Block device to be exported
3650 # @writable: Whether clients should be able to write to the device via the
3651 #     NBD connection (default false). #optional
3653 # Returns: error if the device is already marked for export.
3655 # Since: 1.3.0
3657 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3660 # @nbd-server-stop:
3662 # Stop QEMU's embedded NBD server, and unregister all devices previously
3663 # added via @nbd-server-add.
3665 # Since: 1.3.0
3667 { 'command': 'nbd-server-stop' }
3670 # @ChardevFile:
3672 # Configuration info for file chardevs.
3674 # @in:  #optional The name of the input file
3675 # @out: The name of the output file
3677 # Since: 1.4
3679 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3680                                    'out' : 'str' } }
3683 # @ChardevHostdev:
3685 # Configuration info for device and pipe chardevs.
3687 # @device: The name of the special file for the device,
3688 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3689 # @type: What kind of device this is.
3691 # Since: 1.4
3693 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3696 # @ChardevSocket:
3698 # Configuration info for (stream) socket chardevs.
3700 # @addr: socket address to listen on (server=true)
3701 #        or connect to (server=false)
3702 # @server: #optional create server socket (default: true)
3703 # @wait: #optional wait for incoming connection on server
3704 #        sockets (default: false).
3705 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3706 # @telnet: #optional enable telnet protocol on server
3707 #          sockets (default: false)
3709 # Since: 1.4
3711 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3712                                      '*server'  : 'bool',
3713                                      '*wait'    : 'bool',
3714                                      '*nodelay' : 'bool',
3715                                      '*telnet'  : 'bool' } }
3718 # @ChardevUdp:
3720 # Configuration info for datagram socket chardevs.
3722 # @remote: remote address
3723 # @local: #optional local address
3725 # Since: 1.5
3727 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3728                                   '*local' : 'SocketAddress' } }
3731 # @ChardevMux:
3733 # Configuration info for mux chardevs.
3735 # @chardev: name of the base chardev.
3737 # Since: 1.5
3739 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3742 # @ChardevStdio:
3744 # Configuration info for stdio chardevs.
3746 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3747 #          be delivered to qemu.  Default: true in -nographic mode,
3748 #          false otherwise.
3750 # Since: 1.5
3752 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3755 # @ChardevSpiceChannel:
3757 # Configuration info for spice vm channel chardevs.
3759 # @type: kind of channel (for example vdagent).
3761 # Since: 1.5
3763 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3766 # @ChardevSpicePort:
3768 # Configuration info for spice port chardevs.
3770 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3772 # Since: 1.5
3774 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3777 # @ChardevVC:
3779 # Configuration info for virtual console chardevs.
3781 # @width:  console width,  in pixels
3782 # @height: console height, in pixels
3783 # @cols:   console width,  in chars
3784 # @rows:   console height, in chars
3786 # Since: 1.5
3788 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3789                                  '*height' : 'int',
3790                                  '*cols'   : 'int',
3791                                  '*rows'   : 'int' } }
3794 # @ChardevRingbuf:
3796 # Configuration info for ring buffer chardevs.
3798 # @size: #optional ring buffer size, must be power of two, default is 65536
3800 # Since: 1.5
3802 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3805 # @ChardevBackend:
3807 # Configuration info for the new chardev backend.
3809 # Since: 1.4
3811 { 'type': 'ChardevDummy', 'data': { } }
3813 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3814                                        'serial' : 'ChardevHostdev',
3815                                        'parallel': 'ChardevHostdev',
3816                                        'pipe'   : 'ChardevHostdev',
3817                                        'socket' : 'ChardevSocket',
3818                                        'udp'    : 'ChardevUdp',
3819                                        'pty'    : 'ChardevDummy',
3820                                        'null'   : 'ChardevDummy',
3821                                        'mux'    : 'ChardevMux',
3822                                        'msmouse': 'ChardevDummy',
3823                                        'braille': 'ChardevDummy',
3824                                        'stdio'  : 'ChardevStdio',
3825                                        'console': 'ChardevDummy',
3826                                        'spicevmc' : 'ChardevSpiceChannel',
3827                                        'spiceport' : 'ChardevSpicePort',
3828                                        'vc'     : 'ChardevVC',
3829                                        'ringbuf': 'ChardevRingbuf',
3830                                        # next one is just for compatibility
3831                                        'memory' : 'ChardevRingbuf' } }
3834 # @ChardevReturn:
3836 # Return info about the chardev backend just created.
3838 # @pty: #optional name of the slave pseudoterminal device, present if
3839 #       and only if a chardev of type 'pty' was created
3841 # Since: 1.4
3843 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3846 # @chardev-add:
3848 # Add a character device backend
3850 # @id: the chardev's ID, must be unique
3851 # @backend: backend type and parameters
3853 # Returns: ChardevReturn.
3855 # Since: 1.4
3857 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3858                                      'backend' : 'ChardevBackend' },
3859   'returns': 'ChardevReturn' }
3862 # @chardev-remove:
3864 # Remove a character device backend
3866 # @id: the chardev's ID, must exist and not be in use
3868 # Returns: Nothing on success
3870 # Since: 1.4
3872 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3875 # @TpmModel:
3877 # An enumeration of TPM models
3879 # @tpm-tis: TPM TIS model
3881 # Since: 1.5
3883 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3886 # @query-tpm-models:
3888 # Return a list of supported TPM models
3890 # Returns: a list of TpmModel
3892 # Since: 1.5
3894 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3897 # @TpmType:
3899 # An enumeration of TPM types
3901 # @passthrough: TPM passthrough type
3903 # Since: 1.5
3905 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3908 # @query-tpm-types:
3910 # Return a list of supported TPM types
3912 # Returns: a list of TpmType
3914 # Since: 1.5
3916 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3919 # @TPMPassthroughOptions:
3921 # Information about the TPM passthrough type
3923 # @path: #optional string describing the path used for accessing the TPM device
3925 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3926 #               for cancellation of TPM commands while they are executing
3928 # Since: 1.5
3930 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3931                                              '*cancel-path' : 'str'} }
3934 # @TpmTypeOptions:
3936 # A union referencing different TPM backend types' configuration options
3938 # @passthrough: The configuration options for the TPM passthrough type
3940 # Since: 1.5
3942 { 'union': 'TpmTypeOptions',
3943    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3946 # @TpmInfo:
3948 # Information about the TPM
3950 # @id: The Id of the TPM
3952 # @model: The TPM frontend model
3954 # @options: The TPM (backend) type configuration options
3956 # Since: 1.5
3958 { 'type': 'TPMInfo',
3959   'data': {'id': 'str',
3960            'model': 'TpmModel',
3961            'options': 'TpmTypeOptions' } }
3964 # @query-tpm:
3966 # Return information about the TPM device
3968 # Returns: @TPMInfo on success
3970 # Since: 1.5
3972 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3975 # @AcpiTableOptions
3977 # Specify an ACPI table on the command line to load.
3979 # At most one of @file and @data can be specified. The list of files specified
3980 # by any one of them is loaded and concatenated in order. If both are omitted,
3981 # @data is implied.
3983 # Other fields / optargs can be used to override fields of the generic ACPI
3984 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3985 # Description Table Header. If a header field is not overridden, then the
3986 # corresponding value from the concatenated blob is used (in case of @file), or
3987 # it is filled in with a hard-coded value (in case of @data).
3989 # String fields are copied into the matching ACPI member from lowest address
3990 # upwards, and silently truncated / NUL-padded to length.
3992 # @sig: #optional table signature / identifier (4 bytes)
3994 # @rev: #optional table revision number (dependent on signature, 1 byte)
3996 # @oem_id: #optional OEM identifier (6 bytes)
3998 # @oem_table_id: #optional OEM table identifier (8 bytes)
4000 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
4002 # @asl_compiler_id: #optional identifier of the utility that created the table
4003 #                   (4 bytes)
4005 # @asl_compiler_rev: #optional revision number of the utility that created the
4006 #                    table (4 bytes)
4008 # @file: #optional colon (:) separated list of pathnames to load and
4009 #        concatenate as table data. The resultant binary blob is expected to
4010 #        have an ACPI table header. At least one file is required. This field
4011 #        excludes @data.
4013 # @data: #optional colon (:) separated list of pathnames to load and
4014 #        concatenate as table data. The resultant binary blob must not have an
4015 #        ACPI table header. At least one file is required. This field excludes
4016 #        @file.
4018 # Since 1.5
4020 { 'type': 'AcpiTableOptions',
4021   'data': {
4022     '*sig':               'str',
4023     '*rev':               'uint8',
4024     '*oem_id':            'str',
4025     '*oem_table_id':      'str',
4026     '*oem_rev':           'uint32',
4027     '*asl_compiler_id':   'str',
4028     '*asl_compiler_rev':  'uint32',
4029     '*file':              'str',
4030     '*data':              'str' }}
4033 # @CommandLineParameterType:
4035 # Possible types for an option parameter.
4037 # @string: accepts a character string
4039 # @boolean: accepts "on" or "off"
4041 # @number: accepts a number
4043 # @size: accepts a number followed by an optional suffix (K)ilo,
4044 #        (M)ega, (G)iga, (T)era
4046 # Since 1.5
4048 { 'enum': 'CommandLineParameterType',
4049   'data': ['string', 'boolean', 'number', 'size'] }
4052 # @CommandLineParameterInfo:
4054 # Details about a single parameter of a command line option.
4056 # @name: parameter name
4058 # @type: parameter @CommandLineParameterType
4060 # @help: #optional human readable text string, not suitable for parsing.
4062 # Since 1.5
4064 { 'type': 'CommandLineParameterInfo',
4065   'data': { 'name': 'str',
4066             'type': 'CommandLineParameterType',
4067             '*help': 'str' } }
4070 # @CommandLineOptionInfo:
4072 # Details about a command line option, including its list of parameter details
4074 # @option: option name
4076 # @parameters: an array of @CommandLineParameterInfo
4078 # Since 1.5
4080 { 'type': 'CommandLineOptionInfo',
4081   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
4084 # @query-command-line-options:
4086 # Query command line option schema.
4088 # @option: #optional option name
4090 # Returns: list of @CommandLineOptionInfo for all options (or for the given
4091 #          @option).  Returns an error if the given @option doesn't exist.
4093 # Since 1.5
4095 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
4096  'returns': ['CommandLineOptionInfo'] }
4099 # @X86CPURegister32
4101 # A X86 32-bit register
4103 # Since: 1.5
4105 { 'enum': 'X86CPURegister32',
4106   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
4109 # @X86CPUFeatureWordInfo
4111 # Information about a X86 CPU feature word
4113 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
4115 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
4116 #                   feature word
4118 # @cpuid-register: Output register containing the feature bits
4120 # @features: value of output register, containing the feature bits
4122 # Since: 1.5
4124 { 'type': 'X86CPUFeatureWordInfo',
4125   'data': { 'cpuid-input-eax': 'int',
4126             '*cpuid-input-ecx': 'int',
4127             'cpuid-register': 'X86CPURegister32',
4128             'features': 'int' } }
4131 # @RxState:
4133 # Packets receiving state
4135 # @normal: filter assigned packets according to the mac-table
4137 # @none: don't receive any assigned packet
4139 # @all: receive all assigned packets
4141 # Since: 1.6
4143 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4146 # @RxFilterInfo:
4148 # Rx-filter information for a NIC.
4150 # @name: net client name
4152 # @promiscuous: whether promiscuous mode is enabled
4154 # @multicast: multicast receive state
4156 # @unicast: unicast receive state
4158 # @broadcast-allowed: whether to receive broadcast
4160 # @multicast-overflow: multicast table is overflowed or not
4162 # @unicast-overflow: unicast table is overflowed or not
4164 # @main-mac: the main macaddr string
4166 # @vlan-table: a list of active vlan id
4168 # @unicast-table: a list of unicast macaddr string
4170 # @multicast-table: a list of multicast macaddr string
4172 # Since 1.6
4175 { 'type': 'RxFilterInfo',
4176   'data': {
4177     'name':               'str',
4178     'promiscuous':        'bool',
4179     'multicast':          'RxState',
4180     'unicast':            'RxState',
4181     'broadcast-allowed':  'bool',
4182     'multicast-overflow': 'bool',
4183     'unicast-overflow':   'bool',
4184     'main-mac':           'str',
4185     'vlan-table':         ['int'],
4186     'unicast-table':      ['str'],
4187     'multicast-table':    ['str'] }}
4190 # @query-rx-filter:
4192 # Return rx-filter information for all NICs (or for the given NIC).
4194 # @name: #optional net client name
4196 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4197 #          Returns an error if the given @name doesn't exist, or given
4198 #          NIC doesn't support rx-filter querying, or given net client
4199 #          isn't a NIC.
4201 # Since: 1.6
4203 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4204   'returns': ['RxFilterInfo'] }
4208 # @BlockdevDiscardOptions
4210 # Determines how to handle discard requests.
4212 # @ignore:      Ignore the request
4213 # @unmap:       Forward as an unmap request
4215 # Since: 1.7
4217 { 'enum': 'BlockdevDiscardOptions',
4218   'data': [ 'ignore', 'unmap' ] }
4221 # @BlockdevAioOptions
4223 # Selects the AIO backend to handle I/O requests
4225 # @threads:     Use qemu's thread pool
4226 # @native:      Use native AIO backend (only Linux and Windows)
4228 # Since: 1.7
4230 { 'enum': 'BlockdevAioOptions',
4231   'data': [ 'threads', 'native' ] }
4234 # @BlockdevCacheOptions
4236 # Includes cache-related options for block devices
4238 # @writeback:   #optional enables writeback mode for any caches (default: true)
4239 # @direct:      #optional enables use of O_DIRECT (bypass the host page cache;
4240 #               default: false)
4241 # @no-flush:    #optional ignore any flush requests for the device (default:
4242 #               false)
4244 # Since: 1.7
4246 { 'type': 'BlockdevCacheOptions',
4247   'data': { '*writeback': 'bool',
4248             '*direct': 'bool',
4249             '*no-flush': 'bool' } }
4252 # @BlockdevOptionsBase
4254 # Options that are available for all block devices, independent of the block
4255 # driver.
4257 # @driver:      block driver name
4258 # @id:          #optional id by which the new block device can be referred to.
4259 #               This is a required option on the top level of blockdev-add, and
4260 #               currently not allowed on any other level.
4261 # @node-name:   #optional the name of a block driver state node (Since 2.0)
4262 # @discard:     #optional discard-related options (default: ignore)
4263 # @cache:       #optional cache-related options
4264 # @aio:         #optional AIO backend (default: threads)
4265 # @rerror:      #optional how to handle read errors on the device
4266 #               (default: report)
4267 # @werror:      #optional how to handle write errors on the device
4268 #               (default: enospc)
4269 # @read-only:   #optional whether the block device should be read-only
4270 #               (default: false)
4272 # Since: 1.7
4274 { 'type': 'BlockdevOptionsBase',
4275   'data': { 'driver': 'str',
4276             '*id': 'str',
4277             '*node-name': 'str',
4278             '*discard': 'BlockdevDiscardOptions',
4279             '*cache': 'BlockdevCacheOptions',
4280             '*aio': 'BlockdevAioOptions',
4281             '*rerror': 'BlockdevOnError',
4282             '*werror': 'BlockdevOnError',
4283             '*read-only': 'bool' } }
4286 # @BlockdevOptionsFile
4288 # Driver specific block device options for the file backend and similar
4289 # protocols.
4291 # @filename:    path to the image file
4293 # Since: 1.7
4295 { 'type': 'BlockdevOptionsFile',
4296   'data': { 'filename': 'str' } }
4299 # @BlockdevOptionsVVFAT
4301 # Driver specific block device options for the vvfat protocol.
4303 # @dir:         directory to be exported as FAT image
4304 # @fat-type:    #optional FAT type: 12, 16 or 32
4305 # @floppy:      #optional whether to export a floppy image (true) or
4306 #               partitioned hard disk (false; default)
4307 # @rw:          #optional whether to allow write operations (default: false)
4309 # Since: 1.7
4311 { 'type': 'BlockdevOptionsVVFAT',
4312   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4313             '*rw': 'bool' } }
4316 # @BlockdevOptionsGenericFormat
4318 # Driver specific block device options for image format that have no option
4319 # besides their data source.
4321 # @file:        reference to or definition of the data source block device
4323 # Since: 1.7
4325 { 'type': 'BlockdevOptionsGenericFormat',
4326   'data': { 'file': 'BlockdevRef' } }
4329 # @BlockdevOptionsGenericCOWFormat
4331 # Driver specific block device options for image format that have no option
4332 # besides their data source and an optional backing file.
4334 # @backing:     #optional reference to or definition of the backing file block
4335 #               device (if missing, taken from the image file content). It is
4336 #               allowed to pass an empty string here in order to disable the
4337 #               default backing file.
4339 # Since: 1.7
4341 { 'type': 'BlockdevOptionsGenericCOWFormat',
4342   'base': 'BlockdevOptionsGenericFormat',
4343   'data': { '*backing': 'BlockdevRef' } }
4346 # @BlockdevOptionsQcow2
4348 # Driver specific block device options for qcow2.
4350 # @lazy-refcounts:        #optional whether to enable the lazy refcounts
4351 #                         feature (default is taken from the image file)
4353 # @pass-discard-request:  #optional whether discard requests to the qcow2
4354 #                         device should be forwarded to the data source
4356 # @pass-discard-snapshot: #optional whether discard requests for the data source
4357 #                         should be issued when a snapshot operation (e.g.
4358 #                         deleting a snapshot) frees clusters in the qcow2 file
4360 # @pass-discard-other:    #optional whether discard requests for the data source
4361 #                         should be issued on other occasions where a cluster
4362 #                         gets freed
4364 # Since: 1.7
4366 { 'type': 'BlockdevOptionsQcow2',
4367   'base': 'BlockdevOptionsGenericCOWFormat',
4368   'data': { '*lazy-refcounts': 'bool',
4369             '*pass-discard-request': 'bool',
4370             '*pass-discard-snapshot': 'bool',
4371             '*pass-discard-other': 'bool' } }
4374 # @BlkdebugEvent
4376 # Trigger events supported by blkdebug.
4378 { 'enum': 'BlkdebugEvent',
4379   'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
4380             'l1_grow.activate_table', 'l2_load', 'l2_update',
4381             'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
4382             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
4383             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
4384             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
4385             'refblock_load', 'refblock_update', 'refblock_update_part',
4386             'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
4387             'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
4388             'refblock_alloc.switch_table', 'cluster_alloc',
4389             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
4390             'flush_to_disk' ] }
4393 # @BlkdebugInjectErrorOptions
4395 # Describes a single error injection for blkdebug.
4397 # @event:       trigger event
4399 # @state:       #optional the state identifier blkdebug needs to be in to
4400 #               actually trigger the event; defaults to "any"
4402 # @errno:       #optional error identifier (errno) to be returned; defaults to
4403 #               EIO
4405 # @sector:      #optional specifies the sector index which has to be affected
4406 #               in order to actually trigger the event; defaults to "any
4407 #               sector"
4409 # @once:        #optional disables further events after this one has been
4410 #               triggered; defaults to false
4412 # @immediately: #optional fail immediately; defaults to false
4414 # Since: 2.0
4416 { 'type': 'BlkdebugInjectErrorOptions',
4417   'data': { 'event': 'BlkdebugEvent',
4418             '*state': 'int',
4419             '*errno': 'int',
4420             '*sector': 'int',
4421             '*once': 'bool',
4422             '*immediately': 'bool' } }
4425 # @BlkdebugSetStateOptions
4427 # Describes a single state-change event for blkdebug.
4429 # @event:       trigger event
4431 # @state:       #optional the current state identifier blkdebug needs to be in;
4432 #               defaults to "any"
4434 # @new_state:   the state identifier blkdebug is supposed to assume if
4435 #               this event is triggered
4437 # Since: 2.0
4439 { 'type': 'BlkdebugSetStateOptions',
4440   'data': { 'event': 'BlkdebugEvent',
4441             '*state': 'int',
4442             'new_state': 'int' } }
4445 # @BlockdevOptionsBlkdebug
4447 # Driver specific block device options for blkdebug.
4449 # @image:           underlying raw block device (or image file)
4451 # @config:          #optional filename of the configuration file
4453 # @align:           #optional required alignment for requests in bytes
4455 # @inject-error:    #optional array of error injection descriptions
4457 # @set-state:       #optional array of state-change descriptions
4459 # Since: 2.0
4461 { 'type': 'BlockdevOptionsBlkdebug',
4462   'data': { 'image': 'BlockdevRef',
4463             '*config': 'str',
4464             '*align': 'int',
4465             '*inject-error': ['BlkdebugInjectErrorOptions'],
4466             '*set-state': ['BlkdebugSetStateOptions'] } }
4469 # @BlockdevOptionsBlkverify
4471 # Driver specific block device options for blkverify.
4473 # @test:    block device to be tested
4475 # @raw:     raw image used for verification
4477 # Since: 2.0
4479 { 'type': 'BlockdevOptionsBlkverify',
4480   'data': { 'test': 'BlockdevRef',
4481             'raw': 'BlockdevRef' } }
4484 # @BlockdevOptionsQuorum
4486 # Driver specific block device options for Quorum
4488 # @blkverify:      #optional true if the driver must print content mismatch
4489 #                  set to false by default
4491 # @children:       the children block devices to use
4493 # @vote-threshold: the vote limit under which a read will fail
4495 # Since: 2.0
4497 { 'type': 'BlockdevOptionsQuorum',
4498   'data': { '*blkverify': 'bool',
4499             'children': [ 'BlockdevRef' ],
4500             'vote-threshold': 'int' } }
4503 # @BlockdevOptions
4505 # Options for creating a block device.
4507 # Since: 1.7
4509 { 'union': 'BlockdevOptions',
4510   'base': 'BlockdevOptionsBase',
4511   'discriminator': 'driver',
4512   'data': {
4513       'file':       'BlockdevOptionsFile',
4514       'http':       'BlockdevOptionsFile',
4515       'https':      'BlockdevOptionsFile',
4516       'ftp':        'BlockdevOptionsFile',
4517       'ftps':       'BlockdevOptionsFile',
4518       'tftp':       'BlockdevOptionsFile',
4519 # TODO gluster: Wait for structured options
4520 # TODO iscsi: Wait for structured options
4521 # TODO nbd: Should take InetSocketAddress for 'host'?
4522 # TODO nfs: Wait for structured options
4523 # TODO rbd: Wait for structured options
4524 # TODO sheepdog: Wait for structured options
4525 # TODO ssh: Should take InetSocketAddress for 'host'?
4526       'vvfat':      'BlockdevOptionsVVFAT',
4527       'blkdebug':   'BlockdevOptionsBlkdebug',
4528       'blkverify':  'BlockdevOptionsBlkverify',
4529       'bochs':      'BlockdevOptionsGenericFormat',
4530       'cloop':      'BlockdevOptionsGenericFormat',
4531       'cow':        'BlockdevOptionsGenericCOWFormat',
4532       'dmg':        'BlockdevOptionsGenericFormat',
4533       'parallels':  'BlockdevOptionsGenericFormat',
4534       'qcow':       'BlockdevOptionsGenericCOWFormat',
4535       'qcow2':      'BlockdevOptionsQcow2',
4536       'qed':        'BlockdevOptionsGenericCOWFormat',
4537       'raw':        'BlockdevOptionsGenericFormat',
4538       'vdi':        'BlockdevOptionsGenericFormat',
4539       'vhdx':       'BlockdevOptionsGenericFormat',
4540       'vmdk':       'BlockdevOptionsGenericCOWFormat',
4541       'vpc':        'BlockdevOptionsGenericFormat',
4542       'quorum':     'BlockdevOptionsQuorum'
4543   } }
4546 # @BlockdevRef
4548 # Reference to a block device.
4550 # @definition:      defines a new block device inline
4551 # @reference:       references the ID of an existing block device. An
4552 #                   empty string means that no block device should be
4553 #                   referenced.
4555 # Since: 1.7
4557 { 'union': 'BlockdevRef',
4558   'discriminator': {},
4559   'data': { 'definition': 'BlockdevOptions',
4560             'reference': 'str' } }
4563 # @blockdev-add:
4565 # Creates a new block device.
4567 # @options: block device options for the new device
4569 # Since: 1.7
4571 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
4574 # @InputButton
4576 # Button of a pointer input device (mouse, tablet).
4578 # Since: 2.0
4580 { 'enum'  : 'InputButton',
4581   'data'  : [ 'Left', 'Middle', 'Right', 'WheelUp', 'WheelDown' ] }
4584 # @InputButton
4586 # Position axis of a pointer input device (mouse, tablet).
4588 # Since: 2.0
4590 { 'enum'  : 'InputAxis',
4591   'data'  : [ 'X', 'Y' ] }
4594 # @InputKeyEvent
4596 # Keyboard input event.
4598 # @key:    Which key this event is for.
4599 # @down:   True for key-down and false for key-up events.
4601 # Since: 2.0
4603 { 'type'  : 'InputKeyEvent',
4604   'data'  : { 'key'     : 'KeyValue',
4605               'down'    : 'bool' } }
4608 # @InputBtnEvent
4610 # Pointer button input event.
4612 # @button: Which button this event is for.
4613 # @down:   True for key-down and false for key-up events.
4615 # Since: 2.0
4617 { 'type'  : 'InputBtnEvent',
4618   'data'  : { 'button'  : 'InputButton',
4619               'down'    : 'bool' } }
4622 # @InputMoveEvent
4624 # Pointer motion input event.
4626 # @axis:   Which axis is referenced by @value.
4627 # @value:  Pointer position.  For absolute coordinates the
4628 #          valid range is 0 -> 0x7ffff
4630 # Since: 2.0
4632 { 'type'  : 'InputMoveEvent',
4633   'data'  : { 'axis'    : 'InputAxis',
4634               'value'   : 'int' } }
4637 # @InputEvent
4639 # Input event union.
4641 # Since: 2.0
4643 { 'union' : 'InputEvent',
4644   'data'  : { 'key'     : 'InputKeyEvent',
4645               'btn'     : 'InputBtnEvent',
4646               'rel'     : 'InputMoveEvent',
4647               'abs'     : 'InputMoveEvent' } }