monitor: Add object_del id argument completion.
[qemu/cris-port.git] / qapi-schema.json
blob9bca13a476a35c1f808511aa500e7e2adbed342c
1 # -*- Mode: Python -*-
3 # QAPI Schema
5 ##
6 # @ErrorClass
8 # QEMU error classes
10 # @GenericError: this is used for errors that don't require a specific error
11 #                class. This should be the default case for most errors
13 # @CommandNotFound: the requested command has not been found
15 # @DeviceEncrypted: the requested operation can't be fulfilled because the
16 #                   selected device is encrypted
18 # @DeviceNotActive: a device has failed to be become active
20 # @DeviceNotFound: the requested device has not been found
22 # @KVMMissingCap: the requested operation can't be fulfilled because a
23 #                 required KVM capability is missing
25 # Since: 1.2
27 { 'enum': 'ErrorClass',
28   'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
29             'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
32 # @add_client
34 # Allow client connections for VNC, Spice and socket based
35 # character devices to be passed in to QEMU via SCM_RIGHTS.
37 # @protocol: protocol name. Valid names are "vnc", "spice" or the
38 #            name of a character device (eg. from -chardev id=XXXX)
40 # @fdname: file descriptor name previously passed via 'getfd' command
42 # @skipauth: #optional whether to skip authentication. Only applies
43 #            to "vnc" and "spice" protocols
45 # @tls: #optional whether to perform TLS. Only applies to the "spice"
46 #       protocol
48 # Returns: nothing on success.
50 # Since: 0.14.0
52 { 'command': 'add_client',
53   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
54             '*tls': 'bool' } }
57 # @NameInfo:
59 # Guest name information.
61 # @name: #optional The name of the guest
63 # Since 0.14.0
65 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
68 # @query-name:
70 # Return the name information of a guest.
72 # Returns: @NameInfo of the guest
74 # Since 0.14.0
76 { 'command': 'query-name', 'returns': 'NameInfo' }
79 # @VersionInfo:
81 # A description of QEMU's version.
83 # @qemu.major:  The major version of QEMU
85 # @qemu.minor:  The minor version of QEMU
87 # @qemu.micro:  The micro version of QEMU.  By current convention, a micro
88 #               version of 50 signifies a development branch.  A micro version
89 #               greater than or equal to 90 signifies a release candidate for
90 #               the next minor version.  A micro version of less than 50
91 #               signifies a stable release.
93 # @package:     QEMU will always set this field to an empty string.  Downstream
94 #               versions of QEMU should set this to a non-empty string.  The
95 #               exact format depends on the downstream however it highly
96 #               recommended that a unique name is used.
98 # Since: 0.14.0
100 { 'type': 'VersionInfo',
101   'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
102            'package': 'str'} }
105 # @query-version:
107 # Returns the current version of QEMU.
109 # Returns:  A @VersionInfo object describing the current version of QEMU.
111 # Since: 0.14.0
113 { 'command': 'query-version', 'returns': 'VersionInfo' }
116 # @KvmInfo:
118 # Information about support for KVM acceleration
120 # @enabled: true if KVM acceleration is active
122 # @present: true if KVM acceleration is built into this executable
124 # Since: 0.14.0
126 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
129 # @query-kvm:
131 # Returns information about KVM acceleration
133 # Returns: @KvmInfo
135 # Since: 0.14.0
137 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
140 # @RunState
142 # An enumeration of VM run states.
144 # @debug: QEMU is running on a debugger
146 # @finish-migrate: guest is paused to finish the migration process
148 # @inmigrate: guest is paused waiting for an incoming migration.  Note
149 # that this state does not tell whether the machine will start at the
150 # end of the migration.  This depends on the command-line -S option and
151 # any invocation of 'stop' or 'cont' that has happened since QEMU was
152 # started.
154 # @internal-error: An internal error that prevents further guest execution
155 # has occurred
157 # @io-error: the last IOP has failed and the device is configured to pause
158 # on I/O errors
160 # @paused: guest has been paused via the 'stop' command
162 # @postmigrate: guest is paused following a successful 'migrate'
164 # @prelaunch: QEMU was started with -S and guest has not started
166 # @restore-vm: guest is paused to restore VM state
168 # @running: guest is actively running
170 # @save-vm: guest is paused to save the VM state
172 # @shutdown: guest is shut down (and -no-shutdown is in use)
174 # @suspended: guest is suspended (ACPI S3)
176 # @watchdog: the watchdog action is configured to pause and has been triggered
178 # @guest-panicked: guest has been panicked as a result of guest OS panic
180 { 'enum': 'RunState',
181   'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
182             'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
183             'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
184             'guest-panicked' ] }
187 # @SnapshotInfo
189 # @id: unique snapshot id
191 # @name: user chosen name
193 # @vm-state-size: size of the VM state
195 # @date-sec: UTC date of the snapshot in seconds
197 # @date-nsec: fractional part in nano seconds to be used with date-sec
199 # @vm-clock-sec: VM clock relative to boot in seconds
201 # @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
203 # Since: 1.3
207 { 'type': 'SnapshotInfo',
208   'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
209             'date-sec': 'int', 'date-nsec': 'int',
210             'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
213 # @ImageInfoSpecificQCow2:
215 # @compat: compatibility level
217 # @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
219 # Since: 1.7
221 { 'type': 'ImageInfoSpecificQCow2',
222   'data': {
223       'compat': 'str',
224       '*lazy-refcounts': 'bool'
225   } }
228 # @ImageInfoSpecificVmdk:
230 # @create-type: The create type of VMDK image
232 # @cid: Content id of image
234 # @parent-cid: Parent VMDK image's cid
236 # @extents: List of extent files
238 # Since: 1.7
240 { 'type': 'ImageInfoSpecificVmdk',
241   'data': {
242       'create-type': 'str',
243       'cid': 'int',
244       'parent-cid': 'int',
245       'extents': ['ImageInfo']
246   } }
249 # @ImageInfoSpecific:
251 # A discriminated record of image format specific information structures.
253 # Since: 1.7
256 { 'union': 'ImageInfoSpecific',
257   'data': {
258       'qcow2': 'ImageInfoSpecificQCow2',
259       'vmdk': 'ImageInfoSpecificVmdk'
260   } }
263 # @ImageInfo:
265 # Information about a QEMU image file
267 # @filename: name of the image file
269 # @format: format of the image file
271 # @virtual-size: maximum capacity in bytes of the image
273 # @actual-size: #optional actual size on disk in bytes of the image
275 # @dirty-flag: #optional true if image is not cleanly closed
277 # @cluster-size: #optional size of a cluster in bytes
279 # @encrypted: #optional true if the image is encrypted
281 # @compressed: #optional true if the image is compressed (Since 1.7)
283 # @backing-filename: #optional name of the backing file
285 # @full-backing-filename: #optional full path of the backing file
287 # @backing-filename-format: #optional the format of the backing file
289 # @snapshots: #optional list of VM snapshots
291 # @backing-image: #optional info of the backing image (since 1.6)
293 # @format-specific: #optional structure supplying additional format-specific
294 # information (since 1.7)
296 # Since: 1.3
300 { 'type': 'ImageInfo',
301   'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
302            '*actual-size': 'int', 'virtual-size': 'int',
303            '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
304            '*backing-filename': 'str', '*full-backing-filename': 'str',
305            '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
306            '*backing-image': 'ImageInfo',
307            '*format-specific': 'ImageInfoSpecific' } }
310 # @ImageCheck:
312 # Information about a QEMU image file check
314 # @filename: name of the image file checked
316 # @format: format of the image file checked
318 # @check-errors: number of unexpected errors occurred during check
320 # @image-end-offset: #optional offset (in bytes) where the image ends, this
321 #                    field is present if the driver for the image format
322 #                    supports it
324 # @corruptions: #optional number of corruptions found during the check if any
326 # @leaks: #optional number of leaks found during the check if any
328 # @corruptions-fixed: #optional number of corruptions fixed during the check
329 #                     if any
331 # @leaks-fixed: #optional number of leaks fixed during the check if any
333 # @total-clusters: #optional total number of clusters, this field is present
334 #                  if the driver for the image format supports it
336 # @allocated-clusters: #optional total number of allocated clusters, this
337 #                      field is present if the driver for the image format
338 #                      supports it
340 # @fragmented-clusters: #optional total number of fragmented clusters, this
341 #                       field is present if the driver for the image format
342 #                       supports it
344 # @compressed-clusters: #optional total number of compressed clusters, this
345 #                       field is present if the driver for the image format
346 #                       supports it
348 # Since: 1.4
352 { 'type': 'ImageCheck',
353   'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
354            '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
355            '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
356            '*total-clusters': 'int', '*allocated-clusters': 'int',
357            '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
360 # @StatusInfo:
362 # Information about VCPU run state
364 # @running: true if all VCPUs are runnable, false if not runnable
366 # @singlestep: true if VCPUs are in single-step mode
368 # @status: the virtual machine @RunState
370 # Since:  0.14.0
372 # Notes: @singlestep is enabled through the GDB stub
374 { 'type': 'StatusInfo',
375   'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
378 # @query-status:
380 # Query the run status of all VCPUs
382 # Returns: @StatusInfo reflecting all VCPUs
384 # Since:  0.14.0
386 { 'command': 'query-status', 'returns': 'StatusInfo' }
389 # @UuidInfo:
391 # Guest UUID information.
393 # @UUID: the UUID of the guest
395 # Since: 0.14.0
397 # Notes: If no UUID was specified for the guest, a null UUID is returned.
399 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
402 # @query-uuid:
404 # Query the guest UUID information.
406 # Returns: The @UuidInfo for the guest
408 # Since 0.14.0
410 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
413 # @ChardevInfo:
415 # Information about a character device.
417 # @label: the label of the character device
419 # @filename: the filename of the character device
421 # Notes: @filename is encoded using the QEMU command line character device
422 #        encoding.  See the QEMU man page for details.
424 # Since: 0.14.0
426 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
429 # @query-chardev:
431 # Returns information about current character devices.
433 # Returns: a list of @ChardevInfo
435 # Since: 0.14.0
437 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
440 # @ChardevBackendInfo:
442 # Information about a character device backend
444 # @name: The backend name
446 # Since: 2.0
448 { 'type': 'ChardevBackendInfo', 'data': {'name': 'str'} }
451 # @query-chardev-backends:
453 # Returns information about character device backends.
455 # Returns: a list of @ChardevBackendInfo
457 # Since: 2.0
459 { 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
462 # @DataFormat:
464 # An enumeration of data format.
466 # @utf8: Data is a UTF-8 string (RFC 3629)
468 # @base64: Data is Base64 encoded binary (RFC 3548)
470 # Since: 1.4
472 { 'enum': 'DataFormat',
473   'data': [ 'utf8', 'base64' ] }
476 # @ringbuf-write:
478 # Write to a ring buffer character device.
480 # @device: the ring buffer character device name
482 # @data: data to write
484 # @format: #optional data encoding (default 'utf8').
485 #          - base64: data must be base64 encoded text.  Its binary
486 #            decoding gets written.
487 #            Bug: invalid base64 is currently not rejected.
488 #            Whitespace *is* invalid.
489 #          - utf8: data's UTF-8 encoding is written
490 #          - data itself is always Unicode regardless of format, like
491 #            any other string.
493 # Returns: Nothing on success
495 # Since: 1.4
497 { 'command': 'ringbuf-write',
498   'data': {'device': 'str', 'data': 'str',
499            '*format': 'DataFormat'} }
502 # @ringbuf-read:
504 # Read from a ring buffer character device.
506 # @device: the ring buffer character device name
508 # @size: how many bytes to read at most
510 # @format: #optional data encoding (default 'utf8').
511 #          - base64: the data read is returned in base64 encoding.
512 #          - utf8: the data read is interpreted as UTF-8.
513 #            Bug: can screw up when the buffer contains invalid UTF-8
514 #            sequences, NUL characters, after the ring buffer lost
515 #            data, and when reading stops because the size limit is
516 #            reached.
517 #          - The return value is always Unicode regardless of format,
518 #            like any other string.
520 # Returns: data read from the device
522 # Since: 1.4
524 { 'command': 'ringbuf-read',
525   'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
526   'returns': 'str' }
529 # @CommandInfo:
531 # Information about a QMP command
533 # @name: The command name
535 # Since: 0.14.0
537 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
540 # @query-commands:
542 # Return a list of supported QMP commands by this server
544 # Returns: A list of @CommandInfo for all supported commands
546 # Since: 0.14.0
548 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
551 # @EventInfo:
553 # Information about a QMP event
555 # @name: The event name
557 # Since: 1.2.0
559 { 'type': 'EventInfo', 'data': {'name': 'str'} }
562 # @query-events:
564 # Return a list of supported QMP events by this server
566 # Returns: A list of @EventInfo for all supported events
568 # Since: 1.2.0
570 { 'command': 'query-events', 'returns': ['EventInfo'] }
573 # @MigrationStats
575 # Detailed migration status.
577 # @transferred: amount of bytes already transferred to the target VM
579 # @remaining: amount of bytes remaining to be transferred to the target VM
581 # @total: total amount of bytes involved in the migration process
583 # @duplicate: number of duplicate (zero) pages (since 1.2)
585 # @skipped: number of skipped zero pages (since 1.5)
587 # @normal : number of normal pages (since 1.2)
589 # @normal-bytes: number of normal bytes sent (since 1.2)
591 # @dirty-pages-rate: number of pages dirtied by second by the
592 #        guest (since 1.3)
594 # @mbps: throughput in megabits/sec. (since 1.6)
596 # Since: 0.14.0
598 { 'type': 'MigrationStats',
599   'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
600            'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
601            'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
602            'mbps' : 'number' } }
605 # @XBZRLECacheStats
607 # Detailed XBZRLE migration cache statistics
609 # @cache-size: XBZRLE cache size
611 # @bytes: amount of bytes already transferred to the target VM
613 # @pages: amount of pages transferred to the target VM
615 # @cache-miss: number of cache miss
617 # @overflow: number of overflows
619 # Since: 1.2
621 { 'type': 'XBZRLECacheStats',
622   'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
623            'cache-miss': 'int', 'overflow': 'int' } }
626 # @MigrationInfo
628 # Information about current migration process.
630 # @status: #optional string describing the current migration status.
631 #          As of 0.14.0 this can be 'active', 'completed', 'failed' or
632 #          'cancelled'. If this field is not returned, no migration process
633 #          has been initiated
635 # @ram: #optional @MigrationStats containing detailed migration
636 #       status, only returned if status is 'active' or
637 #       'completed'. 'comppleted' (since 1.2)
639 # @disk: #optional @MigrationStats containing detailed disk migration
640 #        status, only returned if status is 'active' and it is a block
641 #        migration
643 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
644 #                migration statistics, only returned if XBZRLE feature is on and
645 #                status is 'active' or 'completed' (since 1.2)
647 # @total-time: #optional total amount of milliseconds since migration started.
648 #        If migration has ended, it returns the total migration
649 #        time. (since 1.2)
651 # @downtime: #optional only present when migration finishes correctly
652 #        total downtime in milliseconds for the guest.
653 #        (since 1.3)
655 # @expected-downtime: #optional only present while migration is active
656 #        expected downtime in milliseconds for the guest in last walk
657 #        of the dirty bitmap. (since 1.3)
659 # @setup-time: #optional amount of setup time in milliseconds _before_ the
660 #        iterations begin but _after_ the QMP command is issued. This is designed
661 #        to provide an accounting of any activities (such as RDMA pinning) which
662 #        may be expensive, but do not actually occur during the iterative
663 #        migration rounds themselves. (since 1.6)
665 # Since: 0.14.0
667 { 'type': 'MigrationInfo',
668   'data': {'*status': 'str', '*ram': 'MigrationStats',
669            '*disk': 'MigrationStats',
670            '*xbzrle-cache': 'XBZRLECacheStats',
671            '*total-time': 'int',
672            '*expected-downtime': 'int',
673            '*downtime': 'int',
674            '*setup-time': 'int'} }
677 # @query-migrate
679 # Returns information about current migration process.
681 # Returns: @MigrationInfo
683 # Since: 0.14.0
685 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
688 # @MigrationCapability
690 # Migration capabilities enumeration
692 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
693 #          This feature allows us to minimize migration traffic for certain work
694 #          loads, by sending compressed difference of the pages
696 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
697 #          mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
698 #          Disabled by default. Experimental: may (or may not) be renamed after
699 #          further testing is complete. (since 1.6)
701 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
702 #          essentially saves 1MB of zeroes per block on the wire. Enabling requires
703 #          source and target VM to support this feature. To enable it is sufficient
704 #          to enable the capability on the source VM. The feature is disabled by
705 #          default. (since 1.6)
707 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
708 #          to speed up convergence of RAM migration. (since 1.6)
710 # Since: 1.2
712 { 'enum': 'MigrationCapability',
713   'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
716 # @MigrationCapabilityStatus
718 # Migration capability information
720 # @capability: capability enum
722 # @state: capability state bool
724 # Since: 1.2
726 { 'type': 'MigrationCapabilityStatus',
727   'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
730 # @migrate-set-capabilities
732 # Enable/Disable the following migration capabilities (like xbzrle)
734 # @capabilities: json array of capability modifications to make
736 # Since: 1.2
738 { 'command': 'migrate-set-capabilities',
739   'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
742 # @query-migrate-capabilities
744 # Returns information about the current migration capabilities status
746 # Returns: @MigrationCapabilitiesStatus
748 # Since: 1.2
750 { 'command': 'query-migrate-capabilities', 'returns':   ['MigrationCapabilityStatus']}
753 # @MouseInfo:
755 # Information about a mouse device.
757 # @name: the name of the mouse device
759 # @index: the index of the mouse device
761 # @current: true if this device is currently receiving mouse events
763 # @absolute: true if this device supports absolute coordinates as input
765 # Since: 0.14.0
767 { 'type': 'MouseInfo',
768   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
769            'absolute': 'bool'} }
772 # @query-mice:
774 # Returns information about each active mouse device
776 # Returns: a list of @MouseInfo for each device
778 # Since: 0.14.0
780 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
783 # @CpuInfo:
785 # Information about a virtual CPU
787 # @CPU: the index of the virtual CPU
789 # @current: this only exists for backwards compatible and should be ignored
791 # @halted: true if the virtual CPU is in the halt state.  Halt usually refers
792 #          to a processor specific low power mode.
794 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
795 #                pointer.
796 #                If the target is Sparc, this is the PC component of the
797 #                instruction pointer.
799 # @nip: #optional If the target is PPC, the instruction pointer
801 # @npc: #optional If the target is Sparc, the NPC component of the instruction
802 #                 pointer
804 # @PC: #optional If the target is MIPS, the instruction pointer
806 # @thread_id: ID of the underlying host thread
808 # Since: 0.14.0
810 # Notes: @halted is a transient state that changes frequently.  By the time the
811 #        data is sent to the client, the guest may no longer be halted.
813 { 'type': 'CpuInfo',
814   'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
815            '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
818 # @query-cpus:
820 # Returns a list of information about each virtual CPU.
822 # Returns: a list of @CpuInfo for each virtual CPU
824 # Since: 0.14.0
826 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
829 # @BlockDeviceInfo:
831 # Information about the backing device for a block device.
833 # @file: the filename of the backing device
835 # @node-name: #optional the name of the block driver node (Since 2.0)
837 # @ro: true if the backing device was open read-only
839 # @drv: the name of the block format used to open the backing device. As of
840 #       0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
841 #       'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
842 #       'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
843 #       'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
845 # @backing_file: #optional the name of the backing file (for copy-on-write)
847 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
849 # @encrypted: true if the backing device is encrypted
851 # @encryption_key_missing: true if the backing device is encrypted but an
852 #                          valid encryption key is missing
854 # @bps: total throughput limit in bytes per second is specified
856 # @bps_rd: read throughput limit in bytes per second is specified
858 # @bps_wr: write throughput limit in bytes per second is specified
860 # @iops: total I/O operations per second is specified
862 # @iops_rd: read I/O operations per second is specified
864 # @iops_wr: write I/O operations per second is specified
866 # @image: the info of image used (since: 1.6)
868 # @bps_max: #optional total max in bytes (Since 1.7)
870 # @bps_rd_max: #optional read max in bytes (Since 1.7)
872 # @bps_wr_max: #optional write max in bytes (Since 1.7)
874 # @iops_max: #optional total I/O operations max (Since 1.7)
876 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
878 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
880 # @iops_size: #optional an I/O size in bytes (Since 1.7)
882 # Since: 0.14.0
885 { 'type': 'BlockDeviceInfo',
886   'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
887             '*backing_file': 'str', 'backing_file_depth': 'int',
888             'encrypted': 'bool', 'encryption_key_missing': 'bool',
889             'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
890             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
891             'image': 'ImageInfo',
892             '*bps_max': 'int', '*bps_rd_max': 'int',
893             '*bps_wr_max': 'int', '*iops_max': 'int',
894             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
895             '*iops_size': 'int' } }
898 # @BlockDeviceIoStatus:
900 # An enumeration of block device I/O status.
902 # @ok: The last I/O operation has succeeded
904 # @failed: The last I/O operation has failed
906 # @nospace: The last I/O operation has failed due to a no-space condition
908 # Since: 1.0
910 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
913 # @BlockDeviceMapEntry:
915 # Entry in the metadata map of the device (returned by "qemu-img map")
917 # @start: Offset in the image of the first byte described by this entry
918 #         (in bytes)
920 # @length: Length of the range described by this entry (in bytes)
922 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
923 #         before reaching one for which the range is allocated.  The value is
924 #         in the range 0 to the depth of the image chain - 1.
926 # @zero: the sectors in this range read as zeros
928 # @data: reading the image will actually read data from a file (in particular,
929 #        if @offset is present this means that the sectors are not simply
930 #        preallocated, but contain actual data in raw format)
932 # @offset: if present, the image file stores the data for this range in
933 #          raw format at the given offset.
935 # Since 1.7
937 { 'type': 'BlockDeviceMapEntry',
938   'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
939             'data': 'bool', '*offset': 'int' } }
942 # @BlockDirtyInfo:
944 # Block dirty bitmap information.
946 # @count: number of dirty bytes according to the dirty bitmap
948 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
950 # Since: 1.3
952 { 'type': 'BlockDirtyInfo',
953   'data': {'count': 'int', 'granularity': 'int'} }
956 # @BlockInfo:
958 # Block device information.  This structure describes a virtual device and
959 # the backing device associated with it.
961 # @device: The device name associated with the virtual device.
963 # @type: This field is returned only for compatibility reasons, it should
964 #        not be used (always returns 'unknown')
966 # @removable: True if the device supports removable media.
968 # @locked: True if the guest has locked this device from having its media
969 #          removed
971 # @tray_open: #optional True if the device has a tray and it is open
972 #             (only present if removable is true)
974 # @dirty-bitmaps: #optional dirty bitmaps information (only present if the
975 #                 driver has one or more dirty bitmaps) (Since 2.0)
977 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
978 #             supports it and the VM is configured to stop on errors
980 # @inserted: #optional @BlockDeviceInfo describing the device if media is
981 #            present
983 # Since:  0.14.0
985 { 'type': 'BlockInfo',
986   'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
987            'locked': 'bool', '*inserted': 'BlockDeviceInfo',
988            '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
989            '*dirty-bitmaps': ['BlockDirtyInfo'] } }
992 # @query-block:
994 # Get a list of BlockInfo for all virtual block devices.
996 # Returns: a list of @BlockInfo describing each virtual block device
998 # Since: 0.14.0
1000 { 'command': 'query-block', 'returns': ['BlockInfo'] }
1003 # @BlockDeviceStats:
1005 # Statistics of a virtual block device or a block backing device.
1007 # @rd_bytes:      The number of bytes read by the device.
1009 # @wr_bytes:      The number of bytes written by the device.
1011 # @rd_operations: The number of read operations performed by the device.
1013 # @wr_operations: The number of write operations performed by the device.
1015 # @flush_operations: The number of cache flush operations performed by the
1016 #                    device (since 0.15.0)
1018 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
1019 #                       (since 0.15.0).
1021 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1023 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1025 # @wr_highest_offset: The offset after the greatest byte written to the
1026 #                     device.  The intended use of this information is for
1027 #                     growable sparse files (like qcow2) that are used on top
1028 #                     of a physical device.
1030 # Since: 0.14.0
1032 { 'type': 'BlockDeviceStats',
1033   'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1034            'wr_operations': 'int', 'flush_operations': 'int',
1035            'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1036            'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1039 # @BlockStats:
1041 # Statistics of a virtual block device or a block backing device.
1043 # @device: #optional If the stats are for a virtual block device, the name
1044 #          corresponding to the virtual block device.
1046 # @stats:  A @BlockDeviceStats for the device.
1048 # @parent: #optional This describes the file block device if it has one.
1050 # @backing: #optional This describes the backing block device if it has one.
1051 #           (Since 2.0)
1053 # Since: 0.14.0
1055 { 'type': 'BlockStats',
1056   'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1057            '*parent': 'BlockStats',
1058            '*backing': 'BlockStats'} }
1061 # @query-blockstats:
1063 # Query the @BlockStats for all virtual block devices.
1065 # Returns: A list of @BlockStats for each virtual block devices.
1067 # Since: 0.14.0
1069 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1072 # @VncClientInfo:
1074 # Information about a connected VNC client.
1076 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1077 #        when possible.
1079 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1080 #          'ipv4' if the client is connected via IPv4 and TCP
1081 #          'unix' if the client is connected via a unix domain socket
1082 #          'unknown' otherwise
1084 # @service: The service name of the client's port.  This may depends on the
1085 #           host system's service database so symbolic names should not be
1086 #           relied on.
1088 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1089 #              Name of the client.
1091 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1092 #                 used for authentication.
1094 # Since: 0.14.0
1096 { 'type': 'VncClientInfo',
1097   'data': {'host': 'str', 'family': 'str', 'service': 'str',
1098            '*x509_dname': 'str', '*sasl_username': 'str'} }
1101 # @VncInfo:
1103 # Information about the VNC session.
1105 # @enabled: true if the VNC server is enabled, false otherwise
1107 # @host: #optional The hostname the VNC server is bound to.  This depends on
1108 #        the name resolution on the host and may be an IP address.
1110 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1111 #                    'ipv4' if the host is listening for IPv4 connections
1112 #                    'unix' if the host is listening on a unix domain socket
1113 #                    'unknown' otherwise
1115 # @service: #optional The service name of the server's port.  This may depends
1116 #           on the host system's service database so symbolic names should not
1117 #           be relied on.
1119 # @auth: #optional the current authentication type used by the server
1120 #        'none' if no authentication is being used
1121 #        'vnc' if VNC authentication is being used
1122 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
1123 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1124 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1125 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1126 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1127 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1128 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1129 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1130 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1132 # @clients: a list of @VncClientInfo of all currently connected clients
1134 # Since: 0.14.0
1136 { 'type': 'VncInfo',
1137   'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1138            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1141 # @query-vnc:
1143 # Returns information about the current VNC server
1145 # Returns: @VncInfo
1147 # Since: 0.14.0
1149 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1152 # @SpiceChannel
1154 # Information about a SPICE client channel.
1156 # @host: The host name of the client.  QEMU tries to resolve this to a DNS name
1157 #        when possible.
1159 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1160 #          'ipv4' if the client is connected via IPv4 and TCP
1161 #          'unix' if the client is connected via a unix domain socket
1162 #          'unknown' otherwise
1164 # @port: The client's port number.
1166 # @connection-id: SPICE connection id number.  All channels with the same id
1167 #                 belong to the same SPICE session.
1169 # @connection-type: SPICE channel type number.  "1" is the main control
1170 #                   channel, filter for this one if you want to track spice
1171 #                   sessions only
1173 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
1174 #              multiple channels of the same type exist, such as multiple
1175 #              display channels in a multihead setup
1177 # @tls: true if the channel is encrypted, false otherwise.
1179 # Since: 0.14.0
1181 { 'type': 'SpiceChannel',
1182   'data': {'host': 'str', 'family': 'str', 'port': 'str',
1183            'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1184            'tls': 'bool'} }
1187 # @SpiceQueryMouseMode
1189 # An enumeration of Spice mouse states.
1191 # @client: Mouse cursor position is determined by the client.
1193 # @server: Mouse cursor position is determined by the server.
1195 # @unknown: No information is available about mouse mode used by
1196 #           the spice server.
1198 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1200 # Since: 1.1
1202 { 'enum': 'SpiceQueryMouseMode',
1203   'data': [ 'client', 'server', 'unknown' ] }
1206 # @SpiceInfo
1208 # Information about the SPICE session.
1210 # @enabled: true if the SPICE server is enabled, false otherwise
1212 # @migrated: true if the last guest migration completed and spice
1213 #            migration had completed as well. false otherwise.
1215 # @host: #optional The hostname the SPICE server is bound to.  This depends on
1216 #        the name resolution on the host and may be an IP address.
1218 # @port: #optional The SPICE server's port number.
1220 # @compiled-version: #optional SPICE server version.
1222 # @tls-port: #optional The SPICE server's TLS port number.
1224 # @auth: #optional the current authentication type used by the server
1225 #        'none'  if no authentication is being used
1226 #        'spice' uses SASL or direct TLS authentication, depending on command
1227 #                line options
1229 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1230 #              be determined by the client or the server, or unknown if spice
1231 #              server doesn't provide this information.
1233 #              Since: 1.1
1235 # @channels: a list of @SpiceChannel for each active spice channel
1237 # Since: 0.14.0
1239 { 'type': 'SpiceInfo',
1240   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1241            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1242            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1245 # @query-spice
1247 # Returns information about the current SPICE server
1249 # Returns: @SpiceInfo
1251 # Since: 0.14.0
1253 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1256 # @BalloonInfo:
1258 # Information about the guest balloon device.
1260 # @actual: the number of bytes the balloon currently contains
1262 # Since: 0.14.0
1265 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1268 # @query-balloon:
1270 # Return information about the balloon device.
1272 # Returns: @BalloonInfo on success
1273 #          If the balloon driver is enabled but not functional because the KVM
1274 #          kernel module cannot support it, KvmMissingCap
1275 #          If no balloon device is present, DeviceNotActive
1277 # Since: 0.14.0
1279 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1282 # @PciMemoryRange:
1284 # A PCI device memory region
1286 # @base: the starting address (guest physical)
1288 # @limit: the ending address (guest physical)
1290 # Since: 0.14.0
1292 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1295 # @PciMemoryRegion
1297 # Information about a PCI device I/O region.
1299 # @bar: the index of the Base Address Register for this region
1301 # @type: 'io' if the region is a PIO region
1302 #        'memory' if the region is a MMIO region
1304 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1306 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1308 # Since: 0.14.0
1310 { 'type': 'PciMemoryRegion',
1311   'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1312            '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1315 # @PciBridgeInfo:
1317 # Information about a PCI Bridge device
1319 # @bus.number: primary bus interface number.  This should be the number of the
1320 #              bus the device resides on.
1322 # @bus.secondary: secondary bus interface number.  This is the number of the
1323 #                 main bus for the bridge
1325 # @bus.subordinate: This is the highest number bus that resides below the
1326 #                   bridge.
1328 # @bus.io_range: The PIO range for all devices on this bridge
1330 # @bus.memory_range: The MMIO range for all devices on this bridge
1332 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1333 #                          this bridge
1335 # @devices: a list of @PciDeviceInfo for each device on this bridge
1337 # Since: 0.14.0
1339 { 'type': 'PciBridgeInfo',
1340   'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1341                     'io_range': 'PciMemoryRange',
1342                     'memory_range': 'PciMemoryRange',
1343                     'prefetchable_range': 'PciMemoryRange' },
1344            '*devices': ['PciDeviceInfo']} }
1347 # @PciDeviceInfo:
1349 # Information about a PCI device
1351 # @bus: the bus number of the device
1353 # @slot: the slot the device is located in
1355 # @function: the function of the slot used by the device
1357 # @class_info.desc: #optional a string description of the device's class
1359 # @class_info.class: the class code of the device
1361 # @id.device: the PCI device id
1363 # @id.vendor: the PCI vendor id
1365 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1367 # @qdev_id: the device name of the PCI device
1369 # @pci_bridge: if the device is a PCI bridge, the bridge information
1371 # @regions: a list of the PCI I/O regions associated with the device
1373 # Notes: the contents of @class_info.desc are not stable and should only be
1374 #        treated as informational.
1376 # Since: 0.14.0
1378 { 'type': 'PciDeviceInfo',
1379   'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1380            'class_info': {'*desc': 'str', 'class': 'int'},
1381            'id': {'device': 'int', 'vendor': 'int'},
1382            '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1383            'regions': ['PciMemoryRegion']} }
1386 # @PciInfo:
1388 # Information about a PCI bus
1390 # @bus: the bus index
1392 # @devices: a list of devices on this bus
1394 # Since: 0.14.0
1396 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1399 # @query-pci:
1401 # Return information about the PCI bus topology of the guest.
1403 # Returns: a list of @PciInfo for each PCI bus
1405 # Since: 0.14.0
1407 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1410 # @BlockdevOnError:
1412 # An enumeration of possible behaviors for errors on I/O operations.
1413 # The exact meaning depends on whether the I/O was initiated by a guest
1414 # or by a block job
1416 # @report: for guest operations, report the error to the guest;
1417 #          for jobs, cancel the job
1419 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1420 #          or BLOCK_JOB_ERROR)
1422 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1424 # @stop: for guest operations, stop the virtual machine;
1425 #        for jobs, pause the job
1427 # Since: 1.3
1429 { 'enum': 'BlockdevOnError',
1430   'data': ['report', 'ignore', 'enospc', 'stop'] }
1433 # @MirrorSyncMode:
1435 # An enumeration of possible behaviors for the initial synchronization
1436 # phase of storage mirroring.
1438 # @top: copies data in the topmost image to the destination
1440 # @full: copies data from all images to the destination
1442 # @none: only copy data written from now on
1444 # Since: 1.3
1446 { 'enum': 'MirrorSyncMode',
1447   'data': ['top', 'full', 'none'] }
1450 # @BlockJobType:
1452 # Type of a block job.
1454 # @commit: block commit job type, see "block-commit"
1456 # @stream: block stream job type, see "block-stream"
1458 # @mirror: drive mirror job type, see "drive-mirror"
1460 # @backup: drive backup job type, see "drive-backup"
1462 # Since: 1.7
1464 { 'enum': 'BlockJobType',
1465   'data': ['commit', 'stream', 'mirror', 'backup'] }
1468 # @BlockJobInfo:
1470 # Information about a long-running block device operation.
1472 # @type: the job type ('stream' for image streaming)
1474 # @device: the block device name
1476 # @len: the maximum progress value
1478 # @busy: false if the job is known to be in a quiescent state, with
1479 #        no pending I/O.  Since 1.3.
1481 # @paused: whether the job is paused or, if @busy is true, will
1482 #          pause itself as soon as possible.  Since 1.3.
1484 # @offset: the current progress value
1486 # @speed: the rate limit, bytes per second
1488 # @io-status: the status of the job (since 1.3)
1490 # Since: 1.1
1492 { 'type': 'BlockJobInfo',
1493   'data': {'type': 'str', 'device': 'str', 'len': 'int',
1494            'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1495            'io-status': 'BlockDeviceIoStatus'} }
1498 # @query-block-jobs:
1500 # Return information about long-running block device operations.
1502 # Returns: a list of @BlockJobInfo for each active block job
1504 # Since: 1.1
1506 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1509 # @quit:
1511 # This command will cause the QEMU process to exit gracefully.  While every
1512 # attempt is made to send the QMP response before terminating, this is not
1513 # guaranteed.  When using this interface, a premature EOF would not be
1514 # unexpected.
1516 # Since: 0.14.0
1518 { 'command': 'quit' }
1521 # @stop:
1523 # Stop all guest VCPU execution.
1525 # Since:  0.14.0
1527 # Notes:  This function will succeed even if the guest is already in the stopped
1528 #         state.  In "inmigrate" state, it will ensure that the guest
1529 #         remains paused once migration finishes, as if the -S option was
1530 #         passed on the command line.
1532 { 'command': 'stop' }
1535 # @system_reset:
1537 # Performs a hard reset of a guest.
1539 # Since: 0.14.0
1541 { 'command': 'system_reset' }
1544 # @system_powerdown:
1546 # Requests that a guest perform a powerdown operation.
1548 # Since: 0.14.0
1550 # Notes: A guest may or may not respond to this command.  This command
1551 #        returning does not indicate that a guest has accepted the request or
1552 #        that it has shut down.  Many guests will respond to this command by
1553 #        prompting the user in some way.
1555 { 'command': 'system_powerdown' }
1558 # @cpu:
1560 # This command is a nop that is only provided for the purposes of compatibility.
1562 # Since: 0.14.0
1564 # Notes: Do not use this command.
1566 { 'command': 'cpu', 'data': {'index': 'int'} }
1569 # @cpu-add
1571 # Adds CPU with specified ID
1573 # @id: ID of CPU to be created, valid values [0..max_cpus)
1575 # Returns: Nothing on success
1577 # Since 1.5
1579 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1582 # @memsave:
1584 # Save a portion of guest memory to a file.
1586 # @val: the virtual address of the guest to start from
1588 # @size: the size of memory region to save
1590 # @filename: the file to save the memory to as binary data
1592 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1593 #                       virtual address (defaults to CPU 0)
1595 # Returns: Nothing on success
1597 # Since: 0.14.0
1599 # Notes: Errors were not reliably returned until 1.1
1601 { 'command': 'memsave',
1602   'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1605 # @pmemsave:
1607 # Save a portion of guest physical memory to a file.
1609 # @val: the physical address of the guest to start from
1611 # @size: the size of memory region to save
1613 # @filename: the file to save the memory to as binary data
1615 # Returns: Nothing on success
1617 # Since: 0.14.0
1619 # Notes: Errors were not reliably returned until 1.1
1621 { 'command': 'pmemsave',
1622   'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1625 # @cont:
1627 # Resume guest VCPU execution.
1629 # Since:  0.14.0
1631 # Returns:  If successful, nothing
1632 #           If QEMU was started with an encrypted block device and a key has
1633 #              not yet been set, DeviceEncrypted.
1635 # Notes:  This command will succeed if the guest is currently running.  It
1636 #         will also succeed if the guest is in the "inmigrate" state; in
1637 #         this case, the effect of the command is to make sure the guest
1638 #         starts once migration finishes, removing the effect of the -S
1639 #         command line option if it was passed.
1641 { 'command': 'cont' }
1644 # @system_wakeup:
1646 # Wakeup guest from suspend.  Does nothing in case the guest isn't suspended.
1648 # Since:  1.1
1650 # Returns:  nothing.
1652 { 'command': 'system_wakeup' }
1655 # @inject-nmi:
1657 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1659 # Returns:  If successful, nothing
1661 # Since:  0.14.0
1663 # Notes: Only x86 Virtual Machines support this command.
1665 { 'command': 'inject-nmi' }
1668 # @set_link:
1670 # Sets the link status of a virtual network adapter.
1672 # @name: the device name of the virtual network adapter
1674 # @up: true to set the link status to be up
1676 # Returns: Nothing on success
1677 #          If @name is not a valid network device, DeviceNotFound
1679 # Since: 0.14.0
1681 # Notes: Not all network adapters support setting link status.  This command
1682 #        will succeed even if the network adapter does not support link status
1683 #        notification.
1685 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1688 # @block_passwd:
1690 # This command sets the password of a block device that has not been open
1691 # with a password and requires one.
1693 # The two cases where this can happen are a block device is created through
1694 # QEMU's initial command line or a block device is changed through the legacy
1695 # @change interface.
1697 # In the event that the block device is created through the initial command
1698 # line, the VM will start in the stopped state regardless of whether '-S' is
1699 # used.  The intention is for a management tool to query the block devices to
1700 # determine which ones are encrypted, set the passwords with this command, and
1701 # then start the guest with the @cont command.
1703 # Either @device or @node-name must be set but not both.
1705 # @device: #optional the name of the block backend device to set the password on
1707 # @node-name: #optional graph node name to set the password on (Since 2.0)
1709 # @password: the password to use for the device
1711 # Returns: nothing on success
1712 #          If @device is not a valid block device, DeviceNotFound
1713 #          If @device is not encrypted, DeviceNotEncrypted
1715 # Notes:  Not all block formats support encryption and some that do are not
1716 #         able to validate that a password is correct.  Disk corruption may
1717 #         occur if an invalid password is specified.
1719 # Since: 0.14.0
1721 { 'command': 'block_passwd', 'data': {'*device': 'str',
1722                                       '*node-name': 'str', 'password': 'str'} }
1725 # @balloon:
1727 # Request the balloon driver to change its balloon size.
1729 # @value: the target size of the balloon in bytes
1731 # Returns: Nothing on success
1732 #          If the balloon driver is enabled but not functional because the KVM
1733 #            kernel module cannot support it, KvmMissingCap
1734 #          If no balloon device is present, DeviceNotActive
1736 # Notes: This command just issues a request to the guest.  When it returns,
1737 #        the balloon size may not have changed.  A guest can change the balloon
1738 #        size independent of this command.
1740 # Since: 0.14.0
1742 { 'command': 'balloon', 'data': {'value': 'int'} }
1745 # @block_resize
1747 # Resize a block image while a guest is running.
1749 # Either @device or @node-name must be set but not both.
1751 # @device: #optional the name of the device to get the image resized
1753 # @node-name: #optional graph node name to get the image resized (Since 2.0)
1755 # @size:  new image size in bytes
1757 # Returns: nothing on success
1758 #          If @device is not a valid block device, DeviceNotFound
1760 # Since: 0.14.0
1762 { 'command': 'block_resize', 'data': { '*device': 'str',
1763                                        '*node-name': 'str',
1764                                        'size': 'int' }}
1767 # @NewImageMode
1769 # An enumeration that tells QEMU how to set the backing file path in
1770 # a new image file.
1772 # @existing: QEMU should look for an existing image file.
1774 # @absolute-paths: QEMU should create a new image with absolute paths
1775 # for the backing file. If there is no backing file available, the new
1776 # image will not be backed either.
1778 # Since: 1.1
1780 { 'enum': 'NewImageMode',
1781   'data': [ 'existing', 'absolute-paths' ] }
1784 # @BlockdevSnapshot
1786 # Either @device or @node-name must be set but not both.
1788 # @device: #optional the name of the device to generate the snapshot from.
1790 # @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
1792 # @snapshot-file: the target of the new image. A new file will be created.
1794 # @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
1796 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1798 # @mode: #optional whether and how QEMU should create a new image, default is
1799 #        'absolute-paths'.
1801 { 'type': 'BlockdevSnapshot',
1802   'data': { '*device': 'str', '*node-name': 'str',
1803             'snapshot-file': 'str', '*snapshot-node-name': 'str',
1804             '*format': 'str', '*mode': 'NewImageMode' } }
1807 # @BlockdevSnapshotInternal
1809 # @device: the name of the device to generate the snapshot from
1811 # @name: the name of the internal snapshot to be created
1813 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1814 #        exists, the operation will fail. Only some image formats support it,
1815 #        for example, qcow2, rbd, and sheepdog.
1817 # Since: 1.7
1819 { 'type': 'BlockdevSnapshotInternal',
1820   'data': { 'device': 'str', 'name': 'str' } }
1823 # @DriveBackup
1825 # @device: the name of the device which should be copied.
1827 # @target: the target of the new image. If the file exists, or if it
1828 #          is a device, the existing file/device will be used as the new
1829 #          destination.  If it does not exist, a new file will be created.
1831 # @format: #optional the format of the new destination, default is to
1832 #          probe if @mode is 'existing', else the format of the source
1834 # @sync: what parts of the disk image should be copied to the destination
1835 #        (all the disk, only the sectors allocated in the topmost image, or
1836 #        only new I/O).
1838 # @mode: #optional whether and how QEMU should create a new image, default is
1839 #        'absolute-paths'.
1841 # @speed: #optional the maximum speed, in bytes per second
1843 # @on-source-error: #optional the action to take on an error on the source,
1844 #                   default 'report'.  'stop' and 'enospc' can only be used
1845 #                   if the block device supports io-status (see BlockInfo).
1847 # @on-target-error: #optional the action to take on an error on the target,
1848 #                   default 'report' (no limitations, since this applies to
1849 #                   a different block device than @device).
1851 # Note that @on-source-error and @on-target-error only affect background I/O.
1852 # If an error occurs during a guest write request, the device's rerror/werror
1853 # actions will be used.
1855 # Since: 1.6
1857 { 'type': 'DriveBackup',
1858   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1859             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1860             '*speed': 'int',
1861             '*on-source-error': 'BlockdevOnError',
1862             '*on-target-error': 'BlockdevOnError' } }
1865 # @Abort
1867 # This action can be used to test transaction failure.
1869 # Since: 1.6
1871 { 'type': 'Abort',
1872   'data': { } }
1875 # @TransactionAction
1877 # A discriminated record of operations that can be performed with
1878 # @transaction.
1880 { 'union': 'TransactionAction',
1881   'data': {
1882        'blockdev-snapshot-sync': 'BlockdevSnapshot',
1883        'drive-backup': 'DriveBackup',
1884        'abort': 'Abort',
1885        'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1886    } }
1889 # @transaction
1891 # Executes a number of transactionable QMP commands atomically. If any
1892 # operation fails, then the entire set of actions will be abandoned and the
1893 # appropriate error returned.
1895 #  List of:
1896 #  @TransactionAction: information needed for the respective operation
1898 # Returns: nothing on success
1899 #          Errors depend on the operations of the transaction
1901 # Note: The transaction aborts on the first failure.  Therefore, there will be
1902 # information on only one failed operation returned in an error condition, and
1903 # subsequent actions will not have been attempted.
1905 # Since 1.1
1907 { 'command': 'transaction',
1908   'data': { 'actions': [ 'TransactionAction' ] } }
1911 # @blockdev-snapshot-sync
1913 # Generates a synchronous snapshot of a block device.
1915 # For the arguments, see the documentation of BlockdevSnapshot.
1917 # Returns: nothing on success
1918 #          If @device is not a valid block device, DeviceNotFound
1920 # Since 0.14.0
1922 { 'command': 'blockdev-snapshot-sync',
1923   'data': 'BlockdevSnapshot' }
1926 # @blockdev-snapshot-internal-sync
1928 # Synchronously take an internal snapshot of a block device, when the format
1929 # of the image used supports it.
1931 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1933 # Returns: nothing on success
1934 #          If @device is not a valid block device, DeviceNotFound
1935 #          If any snapshot matching @name exists, or @name is empty,
1936 #          GenericError
1937 #          If the format of the image used does not support it,
1938 #          BlockFormatFeatureNotSupported
1940 # Since 1.7
1942 { 'command': 'blockdev-snapshot-internal-sync',
1943   'data': 'BlockdevSnapshotInternal' }
1946 # @blockdev-snapshot-delete-internal-sync
1948 # Synchronously delete an internal snapshot of a block device, when the format
1949 # of the image used support it. The snapshot is identified by name or id or
1950 # both. One of the name or id is required. Return SnapshotInfo for the
1951 # successfully deleted snapshot.
1953 # @device: the name of the device to delete the snapshot from
1955 # @id: optional the snapshot's ID to be deleted
1957 # @name: optional the snapshot's name to be deleted
1959 # Returns: SnapshotInfo on success
1960 #          If @device is not a valid block device, DeviceNotFound
1961 #          If snapshot not found, GenericError
1962 #          If the format of the image used does not support it,
1963 #          BlockFormatFeatureNotSupported
1964 #          If @id and @name are both not specified, GenericError
1966 # Since 1.7
1968 { 'command': 'blockdev-snapshot-delete-internal-sync',
1969   'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
1970   'returns': 'SnapshotInfo' }
1973 # @human-monitor-command:
1975 # Execute a command on the human monitor and return the output.
1977 # @command-line: the command to execute in the human monitor
1979 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1981 # Returns: the output of the command as a string
1983 # Since: 0.14.0
1985 # Notes: This command only exists as a stop-gap.  Its use is highly
1986 #        discouraged.  The semantics of this command are not guaranteed.
1988 #        Known limitations:
1990 #        o This command is stateless, this means that commands that depend
1991 #          on state information (such as getfd) might not work
1993 #       o Commands that prompt the user for data (eg. 'cont' when the block
1994 #         device is encrypted) don't currently work
1996 { 'command': 'human-monitor-command',
1997   'data': {'command-line': 'str', '*cpu-index': 'int'},
1998   'returns': 'str' }
2001 # @block-commit
2003 # Live commit of data from overlay image nodes into backing nodes - i.e.,
2004 # writes data between 'top' and 'base' into 'base'.
2006 # @device:  the name of the device
2008 # @base:   #optional The file name of the backing image to write data into.
2009 #                    If not specified, this is the deepest backing image
2011 # @top:              The file name of the backing image within the image chain,
2012 #                    which contains the topmost data to be committed down.
2014 #                    If top == base, that is an error.
2015 #                    If top == active, the job will not be completed by itself,
2016 #                    user needs to complete the job with the block-job-complete
2017 #                    command after getting the ready event. (Since 2.0)
2019 #                    If the base image is smaller than top, then the base image
2020 #                    will be resized to be the same size as top.  If top is
2021 #                    smaller than the base image, the base will not be
2022 #                    truncated.  If you want the base image size to match the
2023 #                    size of the smaller top, you can safely truncate it
2024 #                    yourself once the commit operation successfully completes.
2027 # @speed:  #optional the maximum speed, in bytes per second
2029 # Returns: Nothing on success
2030 #          If commit or stream is already active on this device, DeviceInUse
2031 #          If @device does not exist, DeviceNotFound
2032 #          If image commit is not supported by this device, NotSupported
2033 #          If @base or @top is invalid, a generic error is returned
2034 #          If @speed is invalid, InvalidParameter
2036 # Since: 1.3
2039 { 'command': 'block-commit',
2040   'data': { 'device': 'str', '*base': 'str', 'top': 'str',
2041             '*speed': 'int' } }
2044 # @drive-backup
2046 # Start a point-in-time copy of a block device to a new destination.  The
2047 # status of ongoing drive-backup operations can be checked with
2048 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
2049 # The operation can be stopped before it has completed using the
2050 # block-job-cancel command.
2052 # For the arguments, see the documentation of DriveBackup.
2054 # Returns: nothing on success
2055 #          If @device is not a valid block device, DeviceNotFound
2057 # Since 1.6
2059 { 'command': 'drive-backup', 'data': 'DriveBackup' }
2062 # @query-named-block-nodes
2064 # Get the named block driver list
2066 # Returns: the list of BlockDeviceInfo
2068 # Since 2.0
2070 { 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
2073 # @drive-mirror
2075 # Start mirroring a block device's writes to a new destination.
2077 # @device:  the name of the device whose writes should be mirrored.
2079 # @target: the target of the new image. If the file exists, or if it
2080 #          is a device, the existing file/device will be used as the new
2081 #          destination.  If it does not exist, a new file will be created.
2083 # @format: #optional the format of the new destination, default is to
2084 #          probe if @mode is 'existing', else the format of the source
2086 # @mode: #optional whether and how QEMU should create a new image, default is
2087 #        'absolute-paths'.
2089 # @speed:  #optional the maximum speed, in bytes per second
2091 # @sync: what parts of the disk image should be copied to the destination
2092 #        (all the disk, only the sectors allocated in the topmost image, or
2093 #        only new I/O).
2095 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2096 #               if the image format doesn't have clusters, 4K if the clusters
2097 #               are smaller than that, else the cluster size.  Must be a
2098 #               power of 2 between 512 and 64M (since 1.4).
2100 # @buf-size: #optional maximum amount of data in flight from source to
2101 #            target (since 1.4).
2103 # @on-source-error: #optional the action to take on an error on the source,
2104 #                   default 'report'.  'stop' and 'enospc' can only be used
2105 #                   if the block device supports io-status (see BlockInfo).
2107 # @on-target-error: #optional the action to take on an error on the target,
2108 #                   default 'report' (no limitations, since this applies to
2109 #                   a different block device than @device).
2111 # Returns: nothing on success
2112 #          If @device is not a valid block device, DeviceNotFound
2114 # Since 1.3
2116 { 'command': 'drive-mirror',
2117   'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2118             'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2119             '*speed': 'int', '*granularity': 'uint32',
2120             '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2121             '*on-target-error': 'BlockdevOnError' } }
2124 # @migrate_cancel
2126 # Cancel the current executing migration process.
2128 # Returns: nothing on success
2130 # Notes: This command succeeds even if there is no migration process running.
2132 # Since: 0.14.0
2134 { 'command': 'migrate_cancel' }
2137 # @migrate_set_downtime
2139 # Set maximum tolerated downtime for migration.
2141 # @value: maximum downtime in seconds
2143 # Returns: nothing on success
2145 # Since: 0.14.0
2147 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2150 # @migrate_set_speed
2152 # Set maximum speed for migration.
2154 # @value: maximum speed in bytes.
2156 # Returns: nothing on success
2158 # Notes: A value lesser than zero will be automatically round up to zero.
2160 # Since: 0.14.0
2162 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2165 # @migrate-set-cache-size
2167 # Set XBZRLE cache size
2169 # @value: cache size in bytes
2171 # The size will be rounded down to the nearest power of 2.
2172 # The cache size can be modified before and during ongoing migration
2174 # Returns: nothing on success
2176 # Since: 1.2
2178 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2181 # @query-migrate-cache-size
2183 # query XBZRLE cache size
2185 # Returns: XBZRLE cache size in bytes
2187 # Since: 1.2
2189 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2192 # @ObjectPropertyInfo:
2194 # @name: the name of the property
2196 # @type: the type of the property.  This will typically come in one of four
2197 #        forms:
2199 #        1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2200 #           These types are mapped to the appropriate JSON type.
2202 #        2) A legacy type in the form 'legacy<subtype>' where subtype is the
2203 #           legacy qdev typename.  These types are always treated as strings.
2205 #        3) A child type in the form 'child<subtype>' where subtype is a qdev
2206 #           device type name.  Child properties create the composition tree.
2208 #        4) A link type in the form 'link<subtype>' where subtype is a qdev
2209 #           device type name.  Link properties form the device model graph.
2211 # Since: 1.2
2213 { 'type': 'ObjectPropertyInfo',
2214   'data': { 'name': 'str', 'type': 'str' } }
2217 # @qom-list:
2219 # This command will list any properties of a object given a path in the object
2220 # model.
2222 # @path: the path within the object model.  See @qom-get for a description of
2223 #        this parameter.
2225 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2226 #          object.
2228 # Since: 1.2
2230 { 'command': 'qom-list',
2231   'data': { 'path': 'str' },
2232   'returns': [ 'ObjectPropertyInfo' ] }
2235 # @qom-get:
2237 # This command will get a property from a object model path and return the
2238 # value.
2240 # @path: The path within the object model.  There are two forms of supported
2241 #        paths--absolute and partial paths.
2243 #        Absolute paths are derived from the root object and can follow child<>
2244 #        or link<> properties.  Since they can follow link<> properties, they
2245 #        can be arbitrarily long.  Absolute paths look like absolute filenames
2246 #        and are prefixed  with a leading slash.
2248 #        Partial paths look like relative filenames.  They do not begin
2249 #        with a prefix.  The matching rules for partial paths are subtle but
2250 #        designed to make specifying objects easy.  At each level of the
2251 #        composition tree, the partial path is matched as an absolute path.
2252 #        The first match is not returned.  At least two matches are searched
2253 #        for.  A successful result is only returned if only one match is
2254 #        found.  If more than one match is found, a flag is return to
2255 #        indicate that the match was ambiguous.
2257 # @property: The property name to read
2259 # Returns: The property value.  The type depends on the property type.  legacy<>
2260 #          properties are returned as #str.  child<> and link<> properties are
2261 #          returns as #str pathnames.  All integer property types (u8, u16, etc)
2262 #          are returned as #int.
2264 # Since: 1.2
2266 { 'command': 'qom-get',
2267   'data': { 'path': 'str', 'property': 'str' },
2268   'returns': 'visitor',
2269   'gen': 'no' }
2272 # @qom-set:
2274 # This command will set a property from a object model path.
2276 # @path: see @qom-get for a description of this parameter
2278 # @property: the property name to set
2280 # @value: a value who's type is appropriate for the property type.  See @qom-get
2281 #         for a description of type mapping.
2283 # Since: 1.2
2285 { 'command': 'qom-set',
2286   'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2287   'gen': 'no' }
2290 # @set_password:
2292 # Sets the password of a remote display session.
2294 # @protocol: `vnc' to modify the VNC server password
2295 #            `spice' to modify the Spice server password
2297 # @password: the new password
2299 # @connected: #optional how to handle existing clients when changing the
2300 #                       password.  If nothing is specified, defaults to `keep'
2301 #                       `fail' to fail the command if clients are connected
2302 #                       `disconnect' to disconnect existing clients
2303 #                       `keep' to maintain existing clients
2305 # Returns: Nothing on success
2306 #          If Spice is not enabled, DeviceNotFound
2308 # Since: 0.14.0
2310 { 'command': 'set_password',
2311   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2314 # @expire_password:
2316 # Expire the password of a remote display server.
2318 # @protocol: the name of the remote display protocol `vnc' or `spice'
2320 # @time: when to expire the password.
2321 #        `now' to expire the password immediately
2322 #        `never' to cancel password expiration
2323 #        `+INT' where INT is the number of seconds from now (integer)
2324 #        `INT' where INT is the absolute time in seconds
2326 # Returns: Nothing on success
2327 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
2329 # Since: 0.14.0
2331 # Notes: Time is relative to the server and currently there is no way to
2332 #        coordinate server time with client time.  It is not recommended to
2333 #        use the absolute time version of the @time parameter unless you're
2334 #        sure you are on the same machine as the QEMU instance.
2336 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2339 # @eject:
2341 # Ejects a device from a removable drive.
2343 # @device:  The name of the device
2345 # @force:   @optional If true, eject regardless of whether the drive is locked.
2346 #           If not specified, the default value is false.
2348 # Returns:  Nothing on success
2349 #           If @device is not a valid block device, DeviceNotFound
2351 # Notes:    Ejecting a device will no media results in success
2353 # Since: 0.14.0
2355 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2358 # @change-vnc-password:
2360 # Change the VNC server password.
2362 # @target:  the new password to use with VNC authentication
2364 # Since: 1.1
2366 # Notes:  An empty password in this command will set the password to the empty
2367 #         string.  Existing clients are unaffected by executing this command.
2369 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2372 # @change:
2374 # This command is multiple commands multiplexed together.
2376 # @device: This is normally the name of a block device but it may also be 'vnc'.
2377 #          when it's 'vnc', then sub command depends on @target
2379 # @target: If @device is a block device, then this is the new filename.
2380 #          If @device is 'vnc', then if the value 'password' selects the vnc
2381 #          change password command.   Otherwise, this specifies a new server URI
2382 #          address to listen to for VNC connections.
2384 # @arg:    If @device is a block device, then this is an optional format to open
2385 #          the device with.
2386 #          If @device is 'vnc' and @target is 'password', this is the new VNC
2387 #          password to set.  If this argument is an empty string, then no future
2388 #          logins will be allowed.
2390 # Returns: Nothing on success.
2391 #          If @device is not a valid block device, DeviceNotFound
2392 #          If the new block device is encrypted, DeviceEncrypted.  Note that
2393 #          if this error is returned, the device has been opened successfully
2394 #          and an additional call to @block_passwd is required to set the
2395 #          device's password.  The behavior of reads and writes to the block
2396 #          device between when these calls are executed is undefined.
2398 # Notes:  It is strongly recommended that this interface is not used especially
2399 #         for changing block devices.
2401 # Since: 0.14.0
2403 { 'command': 'change',
2404   'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2407 # @block_set_io_throttle:
2409 # Change I/O throttle limits for a block drive.
2411 # @device: The name of the device
2413 # @bps: total throughput limit in bytes per second
2415 # @bps_rd: read throughput limit in bytes per second
2417 # @bps_wr: write throughput limit in bytes per second
2419 # @iops: total I/O operations per second
2421 # @ops_rd: read I/O operations per second
2423 # @iops_wr: write I/O operations per second
2425 # @bps_max: #optional total max in bytes (Since 1.7)
2427 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2429 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2431 # @iops_max: #optional total I/O operations max (Since 1.7)
2433 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2435 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2437 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2439 # Returns: Nothing on success
2440 #          If @device is not a valid block device, DeviceNotFound
2442 # Since: 1.1
2444 { 'command': 'block_set_io_throttle',
2445   'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2446             'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2447             '*bps_max': 'int', '*bps_rd_max': 'int',
2448             '*bps_wr_max': 'int', '*iops_max': 'int',
2449             '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2450             '*iops_size': 'int' } }
2453 # @block-stream:
2455 # Copy data from a backing file into a block device.
2457 # The block streaming operation is performed in the background until the entire
2458 # backing file has been copied.  This command returns immediately once streaming
2459 # has started.  The status of ongoing block streaming operations can be checked
2460 # with query-block-jobs.  The operation can be stopped before it has completed
2461 # using the block-job-cancel command.
2463 # If a base file is specified then sectors are not copied from that base file and
2464 # its backing chain.  When streaming completes the image file will have the base
2465 # file as its backing file.  This can be used to stream a subset of the backing
2466 # file chain instead of flattening the entire image.
2468 # On successful completion the image file is updated to drop the backing file
2469 # and the BLOCK_JOB_COMPLETED event is emitted.
2471 # @device: the device name
2473 # @base:   #optional the common backing file name
2475 # @speed:  #optional the maximum speed, in bytes per second
2477 # @on-error: #optional the action to take on an error (default report).
2478 #            'stop' and 'enospc' can only be used if the block device
2479 #            supports io-status (see BlockInfo).  Since 1.3.
2481 # Returns: Nothing on success
2482 #          If @device does not exist, DeviceNotFound
2484 # Since: 1.1
2486 { 'command': 'block-stream',
2487   'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2488             '*on-error': 'BlockdevOnError' } }
2491 # @block-job-set-speed:
2493 # Set maximum speed for a background block operation.
2495 # This command can only be issued when there is an active block job.
2497 # Throttling can be disabled by setting the speed to 0.
2499 # @device: the device name
2501 # @speed:  the maximum speed, in bytes per second, or 0 for unlimited.
2502 #          Defaults to 0.
2504 # Returns: Nothing on success
2505 #          If no background operation is active on this device, DeviceNotActive
2507 # Since: 1.1
2509 { 'command': 'block-job-set-speed',
2510   'data': { 'device': 'str', 'speed': 'int' } }
2513 # @block-job-cancel:
2515 # Stop an active background block operation.
2517 # This command returns immediately after marking the active background block
2518 # operation for cancellation.  It is an error to call this command if no
2519 # operation is in progress.
2521 # The operation will cancel as soon as possible and then emit the
2522 # BLOCK_JOB_CANCELLED event.  Before that happens the job is still visible when
2523 # enumerated using query-block-jobs.
2525 # For streaming, the image file retains its backing file unless the streaming
2526 # operation happens to complete just as it is being cancelled.  A new streaming
2527 # operation can be started at a later time to finish copying all data from the
2528 # backing file.
2530 # @device: the device name
2532 # @force: #optional whether to allow cancellation of a paused job (default
2533 #         false).  Since 1.3.
2535 # Returns: Nothing on success
2536 #          If no background operation is active on this device, DeviceNotActive
2538 # Since: 1.1
2540 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2543 # @block-job-pause:
2545 # Pause an active background block operation.
2547 # This command returns immediately after marking the active background block
2548 # operation for pausing.  It is an error to call this command if no
2549 # operation is in progress.  Pausing an already paused job has no cumulative
2550 # effect; a single block-job-resume command will resume the job.
2552 # The operation will pause as soon as possible.  No event is emitted when
2553 # the operation is actually paused.  Cancelling a paused job automatically
2554 # resumes it.
2556 # @device: the device name
2558 # Returns: Nothing on success
2559 #          If no background operation is active on this device, DeviceNotActive
2561 # Since: 1.3
2563 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2566 # @block-job-resume:
2568 # Resume an active background block operation.
2570 # This command returns immediately after resuming a paused background block
2571 # operation.  It is an error to call this command if no operation is in
2572 # progress.  Resuming an already running job is not an error.
2574 # This command also clears the error status of the job.
2576 # @device: the device name
2578 # Returns: Nothing on success
2579 #          If no background operation is active on this device, DeviceNotActive
2581 # Since: 1.3
2583 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2586 # @block-job-complete:
2588 # Manually trigger completion of an active background block operation.  This
2589 # is supported for drive mirroring, where it also switches the device to
2590 # write to the target path only.  The ability to complete is signaled with
2591 # a BLOCK_JOB_READY event.
2593 # This command completes an active background block operation synchronously.
2594 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2595 # is not defined.  Note that if an I/O error occurs during the processing of
2596 # this command: 1) the command itself will fail; 2) the error will be processed
2597 # according to the rerror/werror arguments that were specified when starting
2598 # the operation.
2600 # A cancelled or paused job cannot be completed.
2602 # @device: the device name
2604 # Returns: Nothing on success
2605 #          If no background operation is active on this device, DeviceNotActive
2607 # Since: 1.3
2609 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2612 # @ObjectTypeInfo:
2614 # This structure describes a search result from @qom-list-types
2616 # @name: the type name found in the search
2618 # Since: 1.1
2620 # Notes: This command is experimental and may change syntax in future releases.
2622 { 'type': 'ObjectTypeInfo',
2623   'data': { 'name': 'str' } }
2626 # @qom-list-types:
2628 # This command will return a list of types given search parameters
2630 # @implements: if specified, only return types that implement this type name
2632 # @abstract: if true, include abstract types in the results
2634 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2636 # Since: 1.1
2638 { 'command': 'qom-list-types',
2639   'data': { '*implements': 'str', '*abstract': 'bool' },
2640   'returns': [ 'ObjectTypeInfo' ] }
2643 # @DevicePropertyInfo:
2645 # Information about device properties.
2647 # @name: the name of the property
2648 # @type: the typename of the property
2650 # Since: 1.2
2652 { 'type': 'DevicePropertyInfo',
2653   'data': { 'name': 'str', 'type': 'str' } }
2656 # @device-list-properties:
2658 # List properties associated with a device.
2660 # @typename: the type name of a device
2662 # Returns: a list of DevicePropertyInfo describing a devices properties
2664 # Since: 1.2
2666 { 'command': 'device-list-properties',
2667   'data': { 'typename': 'str'},
2668   'returns': [ 'DevicePropertyInfo' ] }
2671 # @migrate
2673 # Migrates the current running guest to another Virtual Machine.
2675 # @uri: the Uniform Resource Identifier of the destination VM
2677 # @blk: #optional do block migration (full disk copy)
2679 # @inc: #optional incremental disk copy migration
2681 # @detach: this argument exists only for compatibility reasons and
2682 #          is ignored by QEMU
2684 # Returns: nothing on success
2686 # Since: 0.14.0
2688 { 'command': 'migrate',
2689   'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2691 # @xen-save-devices-state:
2693 # Save the state of all devices to file. The RAM and the block devices
2694 # of the VM are not saved by this command.
2696 # @filename: the file to save the state of the devices to as binary
2697 # data. See xen-save-devices-state.txt for a description of the binary
2698 # format.
2700 # Returns: Nothing on success
2702 # Since: 1.1
2704 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2707 # @xen-set-global-dirty-log
2709 # Enable or disable the global dirty log mode.
2711 # @enable: true to enable, false to disable.
2713 # Returns: nothing
2715 # Since: 1.3
2717 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2720 # @device_del:
2722 # Remove a device from a guest
2724 # @id: the name of the device
2726 # Returns: Nothing on success
2727 #          If @id is not a valid device, DeviceNotFound
2729 # Notes: When this command completes, the device may not be removed from the
2730 #        guest.  Hot removal is an operation that requires guest cooperation.
2731 #        This command merely requests that the guest begin the hot removal
2732 #        process.  Completion of the device removal process is signaled with a
2733 #        DEVICE_DELETED event. Guest reset will automatically complete removal
2734 #        for all devices.
2736 # Since: 0.14.0
2738 { 'command': 'device_del', 'data': {'id': 'str'} }
2741 # @dump-guest-memory
2743 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2744 # very long depending on the amount of guest memory. This command is only
2745 # supported on i386 and x86_64.
2747 # @paging: if true, do paging to get guest's memory mapping. This allows
2748 #          using gdb to process the core file.
2750 #          IMPORTANT: this option can make QEMU allocate several gigabytes
2751 #                     of RAM. This can happen for a large guest, or a
2752 #                     malicious guest pretending to be large.
2754 #          Also, paging=true has the following limitations:
2756 #             1. The guest may be in a catastrophic state or can have corrupted
2757 #                memory, which cannot be trusted
2758 #             2. The guest can be in real-mode even if paging is enabled. For
2759 #                example, the guest uses ACPI to sleep, and ACPI sleep state
2760 #                goes in real-mode
2762 # @protocol: the filename or file descriptor of the vmcore. The supported
2763 #            protocols are:
2765 #            1. file: the protocol starts with "file:", and the following
2766 #               string is the file's path.
2767 #            2. fd: the protocol starts with "fd:", and the following string
2768 #               is the fd's name.
2770 # @begin: #optional if specified, the starting physical address.
2772 # @length: #optional if specified, the memory size, in bytes. If you don't
2773 #          want to dump all guest's memory, please specify the start @begin
2774 #          and @length
2776 # Returns: nothing on success
2778 # Since: 1.2
2780 { 'command': 'dump-guest-memory',
2781   'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2782             '*length': 'int' } }
2785 # @netdev_add:
2787 # Add a network backend.
2789 # @type: the type of network backend.  Current valid values are 'user', 'tap',
2790 #        'vde', 'socket', 'dump' and 'bridge'
2792 # @id: the name of the new network backend
2794 # @props: #optional a list of properties to be passed to the backend in
2795 #         the format 'name=value', like 'ifname=tap0,script=no'
2797 # Notes: The semantics of @props is not well defined.  Future commands will be
2798 #        introduced that provide stronger typing for backend creation.
2800 # Since: 0.14.0
2802 # Returns: Nothing on success
2803 #          If @type is not a valid network backend, DeviceNotFound
2805 { 'command': 'netdev_add',
2806   'data': {'type': 'str', 'id': 'str', '*props': '**'},
2807   'gen': 'no' }
2810 # @netdev_del:
2812 # Remove a network backend.
2814 # @id: the name of the network backend to remove
2816 # Returns: Nothing on success
2817 #          If @id is not a valid network backend, DeviceNotFound
2819 # Since: 0.14.0
2821 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2824 # @object-add:
2826 # Create a QOM object.
2828 # @qom-type: the class name for the object to be created
2830 # @id: the name of the new object
2832 # @props: #optional a dictionary of properties to be passed to the backend
2834 # Returns: Nothing on success
2835 #          Error if @qom-type is not a valid class name
2837 # Since: 2.0
2839 { 'command': 'object-add',
2840   'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
2841   'gen': 'no' }
2844 # @object-del:
2846 # Remove a QOM object.
2848 # @id: the name of the QOM object to remove
2850 # Returns: Nothing on success
2851 #          Error if @id is not a valid id for a QOM object
2853 # Since: 2.0
2855 { 'command': 'object-del', 'data': {'id': 'str'} }
2858 # @NetdevNoneOptions
2860 # Use it alone to have zero network devices.
2862 # Since 1.2
2864 { 'type': 'NetdevNoneOptions',
2865   'data': { } }
2868 # @NetLegacyNicOptions
2870 # Create a new Network Interface Card.
2872 # @netdev: #optional id of -netdev to connect to
2874 # @macaddr: #optional MAC address
2876 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2878 # @addr: #optional PCI device address
2880 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2882 # Since 1.2
2884 { 'type': 'NetLegacyNicOptions',
2885   'data': {
2886     '*netdev':  'str',
2887     '*macaddr': 'str',
2888     '*model':   'str',
2889     '*addr':    'str',
2890     '*vectors': 'uint32' } }
2893 # @String
2895 # A fat type wrapping 'str', to be embedded in lists.
2897 # Since 1.2
2899 { 'type': 'String',
2900   'data': {
2901     'str': 'str' } }
2904 # @NetdevUserOptions
2906 # Use the user mode network stack which requires no administrator privilege to
2907 # run.
2909 # @hostname: #optional client hostname reported by the builtin DHCP server
2911 # @restrict: #optional isolate the guest from the host
2913 # @ip: #optional legacy parameter, use net= instead
2915 # @net: #optional IP address and optional netmask
2917 # @host: #optional guest-visible address of the host
2919 # @tftp: #optional root directory of the built-in TFTP server
2921 # @bootfile: #optional BOOTP filename, for use with tftp=
2923 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2924 #             assign
2926 # @dns: #optional guest-visible address of the virtual nameserver
2928 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2929 #             to the guest
2931 # @smb: #optional root directory of the built-in SMB server
2933 # @smbserver: #optional IP address of the built-in SMB server
2935 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2936 #           endpoints
2938 # @guestfwd: #optional forward guest TCP connections
2940 # Since 1.2
2942 { 'type': 'NetdevUserOptions',
2943   'data': {
2944     '*hostname':  'str',
2945     '*restrict':  'bool',
2946     '*ip':        'str',
2947     '*net':       'str',
2948     '*host':      'str',
2949     '*tftp':      'str',
2950     '*bootfile':  'str',
2951     '*dhcpstart': 'str',
2952     '*dns':       'str',
2953     '*dnssearch': ['String'],
2954     '*smb':       'str',
2955     '*smbserver': 'str',
2956     '*hostfwd':   ['String'],
2957     '*guestfwd':  ['String'] } }
2960 # @NetdevTapOptions
2962 # Connect the host TAP network interface name to the VLAN.
2964 # @ifname: #optional interface name
2966 # @fd: #optional file descriptor of an already opened tap
2968 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2969 # tap
2971 # @script: #optional script to initialize the interface
2973 # @downscript: #optional script to shut down the interface
2975 # @helper: #optional command to execute to configure bridge
2977 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2979 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2981 # @vhost: #optional enable vhost-net network accelerator
2983 # @vhostfd: #optional file descriptor of an already opened vhost net device
2985 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2986 # devices
2988 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2990 # @queues: #optional number of queues to be created for multiqueue capable tap
2992 # Since 1.2
2994 { 'type': 'NetdevTapOptions',
2995   'data': {
2996     '*ifname':     'str',
2997     '*fd':         'str',
2998     '*fds':        'str',
2999     '*script':     'str',
3000     '*downscript': 'str',
3001     '*helper':     'str',
3002     '*sndbuf':     'size',
3003     '*vnet_hdr':   'bool',
3004     '*vhost':      'bool',
3005     '*vhostfd':    'str',
3006     '*vhostfds':   'str',
3007     '*vhostforce': 'bool',
3008     '*queues':     'uint32'} }
3011 # @NetdevSocketOptions
3013 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3014 # socket connection.
3016 # @fd: #optional file descriptor of an already opened socket
3018 # @listen: #optional port number, and optional hostname, to listen on
3020 # @connect: #optional port number, and optional hostname, to connect to
3022 # @mcast: #optional UDP multicast address and port number
3024 # @localaddr: #optional source address and port for multicast and udp packets
3026 # @udp: #optional UDP unicast address and port number
3028 # Since 1.2
3030 { 'type': 'NetdevSocketOptions',
3031   'data': {
3032     '*fd':        'str',
3033     '*listen':    'str',
3034     '*connect':   'str',
3035     '*mcast':     'str',
3036     '*localaddr': 'str',
3037     '*udp':       'str' } }
3040 # @NetdevVdeOptions
3042 # Connect the VLAN to a vde switch running on the host.
3044 # @sock: #optional socket path
3046 # @port: #optional port number
3048 # @group: #optional group owner of socket
3050 # @mode: #optional permissions for socket
3052 # Since 1.2
3054 { 'type': 'NetdevVdeOptions',
3055   'data': {
3056     '*sock':  'str',
3057     '*port':  'uint16',
3058     '*group': 'str',
3059     '*mode':  'uint16' } }
3062 # @NetdevDumpOptions
3064 # Dump VLAN network traffic to a file.
3066 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3067 # suffixes.
3069 # @file: #optional dump file path (default is qemu-vlan0.pcap)
3071 # Since 1.2
3073 { 'type': 'NetdevDumpOptions',
3074   'data': {
3075     '*len':  'size',
3076     '*file': 'str' } }
3079 # @NetdevBridgeOptions
3081 # Connect a host TAP network interface to a host bridge device.
3083 # @br: #optional bridge name
3085 # @helper: #optional command to execute to configure bridge
3087 # Since 1.2
3089 { 'type': 'NetdevBridgeOptions',
3090   'data': {
3091     '*br':     'str',
3092     '*helper': 'str' } }
3095 # @NetdevHubPortOptions
3097 # Connect two or more net clients through a software hub.
3099 # @hubid: hub identifier number
3101 # Since 1.2
3103 { 'type': 'NetdevHubPortOptions',
3104   'data': {
3105     'hubid':     'int32' } }
3108 # @NetdevNetmapOptions
3110 # Connect a client to a netmap-enabled NIC or to a VALE switch port
3112 # @ifname: Either the name of an existing network interface supported by
3113 #          netmap, or the name of a VALE port (created on the fly).
3114 #          A VALE port name is in the form 'valeXXX:YYY', where XXX and
3115 #          YYY are non-negative integers. XXX identifies a switch and
3116 #          YYY identifies a port of the switch. VALE ports having the
3117 #          same XXX are therefore connected to the same switch.
3119 # @devname: #optional path of the netmap device (default: '/dev/netmap').
3121 # Since 2.0
3123 { 'type': 'NetdevNetmapOptions',
3124   'data': {
3125     'ifname':     'str',
3126     '*devname':    'str' } }
3129 # @NetClientOptions
3131 # A discriminated record of network device traits.
3133 # Since 1.2
3135 { 'union': 'NetClientOptions',
3136   'data': {
3137     'none':     'NetdevNoneOptions',
3138     'nic':      'NetLegacyNicOptions',
3139     'user':     'NetdevUserOptions',
3140     'tap':      'NetdevTapOptions',
3141     'socket':   'NetdevSocketOptions',
3142     'vde':      'NetdevVdeOptions',
3143     'dump':     'NetdevDumpOptions',
3144     'bridge':   'NetdevBridgeOptions',
3145     'hubport':  'NetdevHubPortOptions',
3146     'netmap':   'NetdevNetmapOptions' } }
3149 # @NetLegacy
3151 # Captures the configuration of a network device; legacy.
3153 # @vlan: #optional vlan number
3155 # @id: #optional identifier for monitor commands
3157 # @name: #optional identifier for monitor commands, ignored if @id is present
3159 # @opts: device type specific properties (legacy)
3161 # Since 1.2
3163 { 'type': 'NetLegacy',
3164   'data': {
3165     '*vlan': 'int32',
3166     '*id':   'str',
3167     '*name': 'str',
3168     'opts':  'NetClientOptions' } }
3171 # @Netdev
3173 # Captures the configuration of a network device.
3175 # @id: identifier for monitor commands.
3177 # @opts: device type specific properties
3179 # Since 1.2
3181 { 'type': 'Netdev',
3182   'data': {
3183     'id':   'str',
3184     'opts': 'NetClientOptions' } }
3187 # @InetSocketAddress
3189 # Captures a socket address or address range in the Internet namespace.
3191 # @host: host part of the address
3193 # @port: port part of the address, or lowest port if @to is present
3195 # @to: highest port to try
3197 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3198 #        #optional
3200 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3201 #        #optional
3203 # Since 1.3
3205 { 'type': 'InetSocketAddress',
3206   'data': {
3207     'host': 'str',
3208     'port': 'str',
3209     '*to': 'uint16',
3210     '*ipv4': 'bool',
3211     '*ipv6': 'bool' } }
3214 # @UnixSocketAddress
3216 # Captures a socket address in the local ("Unix socket") namespace.
3218 # @path: filesystem path to use
3220 # Since 1.3
3222 { 'type': 'UnixSocketAddress',
3223   'data': {
3224     'path': 'str' } }
3227 # @SocketAddress
3229 # Captures the address of a socket, which could also be a named file descriptor
3231 # Since 1.3
3233 { 'union': 'SocketAddress',
3234   'data': {
3235     'inet': 'InetSocketAddress',
3236     'unix': 'UnixSocketAddress',
3237     'fd': 'String' } }
3240 # @getfd:
3242 # Receive a file descriptor via SCM rights and assign it a name
3244 # @fdname: file descriptor name
3246 # Returns: Nothing on success
3248 # Since: 0.14.0
3250 # Notes: If @fdname already exists, the file descriptor assigned to
3251 #        it will be closed and replaced by the received file
3252 #        descriptor.
3253 #        The 'closefd' command can be used to explicitly close the
3254 #        file descriptor when it is no longer needed.
3256 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3259 # @closefd:
3261 # Close a file descriptor previously passed via SCM rights
3263 # @fdname: file descriptor name
3265 # Returns: Nothing on success
3267 # Since: 0.14.0
3269 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3272 # @MachineInfo:
3274 # Information describing a machine.
3276 # @name: the name of the machine
3278 # @alias: #optional an alias for the machine name
3280 # @default: #optional whether the machine is default
3282 # @cpu-max: maximum number of CPUs supported by the machine type
3283 #           (since 1.5.0)
3285 # Since: 1.2.0
3287 { 'type': 'MachineInfo',
3288   'data': { 'name': 'str', '*alias': 'str',
3289             '*is-default': 'bool', 'cpu-max': 'int' } }
3292 # @query-machines:
3294 # Return a list of supported machines
3296 # Returns: a list of MachineInfo
3298 # Since: 1.2.0
3300 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3303 # @CpuDefinitionInfo:
3305 # Virtual CPU definition.
3307 # @name: the name of the CPU definition
3309 # Since: 1.2.0
3311 { 'type': 'CpuDefinitionInfo',
3312   'data': { 'name': 'str' } }
3315 # @query-cpu-definitions:
3317 # Return a list of supported virtual CPU definitions
3319 # Returns: a list of CpuDefInfo
3321 # Since: 1.2.0
3323 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3325 # @AddfdInfo:
3327 # Information about a file descriptor that was added to an fd set.
3329 # @fdset-id: The ID of the fd set that @fd was added to.
3331 # @fd: The file descriptor that was received via SCM rights and
3332 #      added to the fd set.
3334 # Since: 1.2.0
3336 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3339 # @add-fd:
3341 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3343 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3345 # @opaque: #optional A free-form string that can be used to describe the fd.
3347 # Returns: @AddfdInfo on success
3348 #          If file descriptor was not received, FdNotSupplied
3349 #          If @fdset-id is a negative value, InvalidParameterValue
3351 # Notes: The list of fd sets is shared by all monitor connections.
3353 #        If @fdset-id is not specified, a new fd set will be created.
3355 # Since: 1.2.0
3357 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3358   'returns': 'AddfdInfo' }
3361 # @remove-fd:
3363 # Remove a file descriptor from an fd set.
3365 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3367 # @fd: #optional The file descriptor that is to be removed.
3369 # Returns: Nothing on success
3370 #          If @fdset-id or @fd is not found, FdNotFound
3372 # Since: 1.2.0
3374 # Notes: The list of fd sets is shared by all monitor connections.
3376 #        If @fd is not specified, all file descriptors in @fdset-id
3377 #        will be removed.
3379 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3382 # @FdsetFdInfo:
3384 # Information about a file descriptor that belongs to an fd set.
3386 # @fd: The file descriptor value.
3388 # @opaque: #optional A free-form string that can be used to describe the fd.
3390 # Since: 1.2.0
3392 { 'type': 'FdsetFdInfo',
3393   'data': {'fd': 'int', '*opaque': 'str'} }
3396 # @FdsetInfo:
3398 # Information about an fd set.
3400 # @fdset-id: The ID of the fd set.
3402 # @fds: A list of file descriptors that belong to this fd set.
3404 # Since: 1.2.0
3406 { 'type': 'FdsetInfo',
3407   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3410 # @query-fdsets:
3412 # Return information describing all fd sets.
3414 # Returns: A list of @FdsetInfo
3416 # Since: 1.2.0
3418 # Note: The list of fd sets is shared by all monitor connections.
3421 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3424 # @TargetInfo:
3426 # Information describing the QEMU target.
3428 # @arch: the target architecture (eg "x86_64", "i386", etc)
3430 # Since: 1.2.0
3432 { 'type': 'TargetInfo',
3433   'data': { 'arch': 'str' } }
3436 # @query-target:
3438 # Return information about the target for this QEMU
3440 # Returns: TargetInfo
3442 # Since: 1.2.0
3444 { 'command': 'query-target', 'returns': 'TargetInfo' }
3447 # @QKeyCode:
3449 # An enumeration of key name.
3451 # This is used by the send-key command.
3453 # Since: 1.3.0
3455 { 'enum': 'QKeyCode',
3456   'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3457             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3458             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3459             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3460             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3461             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3462             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3463             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3464             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3465             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3466             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3467             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3468             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3469             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3470              'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3473 # @KeyValue
3475 # Represents a keyboard key.
3477 # Since: 1.3.0
3479 { 'union': 'KeyValue',
3480   'data': {
3481     'number': 'int',
3482     'qcode': 'QKeyCode' } }
3485 # @send-key:
3487 # Send keys to guest.
3489 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3490 #        simultaneously sent to the guest. A @KeyValue.number value is sent
3491 #        directly to the guest, while @KeyValue.qcode must be a valid
3492 #        @QKeyCode value
3494 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3495 #             to 100
3497 # Returns: Nothing on success
3498 #          If key is unknown or redundant, InvalidParameter
3500 # Since: 1.3.0
3503 { 'command': 'send-key',
3504   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3507 # @screendump:
3509 # Write a PPM of the VGA screen to a file.
3511 # @filename: the path of a new PPM file to store the image
3513 # Returns: Nothing on success
3515 # Since: 0.14.0
3517 { 'command': 'screendump', 'data': {'filename': 'str'} }
3520 # @nbd-server-start:
3522 # Start an NBD server listening on the given host and port.  Block
3523 # devices can then be exported using @nbd-server-add.  The NBD
3524 # server will present them as named exports; for example, another
3525 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3527 # @addr: Address on which to listen.
3529 # Returns: error if the server is already running.
3531 # Since: 1.3.0
3533 { 'command': 'nbd-server-start',
3534   'data': { 'addr': 'SocketAddress' } }
3537 # @nbd-server-add:
3539 # Export a device to QEMU's embedded NBD server.
3541 # @device: Block device to be exported
3543 # @writable: Whether clients should be able to write to the device via the
3544 #     NBD connection (default false). #optional
3546 # Returns: error if the device is already marked for export.
3548 # Since: 1.3.0
3550 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3553 # @nbd-server-stop:
3555 # Stop QEMU's embedded NBD server, and unregister all devices previously
3556 # added via @nbd-server-add.
3558 # Since: 1.3.0
3560 { 'command': 'nbd-server-stop' }
3563 # @ChardevFile:
3565 # Configuration info for file chardevs.
3567 # @in:  #optional The name of the input file
3568 # @out: The name of the output file
3570 # Since: 1.4
3572 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3573                                    'out' : 'str' } }
3576 # @ChardevHostdev:
3578 # Configuration info for device and pipe chardevs.
3580 # @device: The name of the special file for the device,
3581 #          i.e. /dev/ttyS0 on Unix or COM1: on Windows
3582 # @type: What kind of device this is.
3584 # Since: 1.4
3586 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3589 # @ChardevSocket:
3591 # Configuration info for (stream) socket chardevs.
3593 # @addr: socket address to listen on (server=true)
3594 #        or connect to (server=false)
3595 # @server: #optional create server socket (default: true)
3596 # @wait: #optional wait for incoming connection on server
3597 #        sockets (default: false).
3598 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3599 # @telnet: #optional enable telnet protocol on server
3600 #          sockets (default: false)
3602 # Since: 1.4
3604 { 'type': 'ChardevSocket', 'data': { 'addr'     : 'SocketAddress',
3605                                      '*server'  : 'bool',
3606                                      '*wait'    : 'bool',
3607                                      '*nodelay' : 'bool',
3608                                      '*telnet'  : 'bool' } }
3611 # @ChardevUdp:
3613 # Configuration info for datagram socket chardevs.
3615 # @remote: remote address
3616 # @local: #optional local address
3618 # Since: 1.5
3620 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3621                                   '*local' : 'SocketAddress' } }
3624 # @ChardevMux:
3626 # Configuration info for mux chardevs.
3628 # @chardev: name of the base chardev.
3630 # Since: 1.5
3632 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3635 # @ChardevStdio:
3637 # Configuration info for stdio chardevs.
3639 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3640 #          be delivered to qemu.  Default: true in -nographic mode,
3641 #          false otherwise.
3643 # Since: 1.5
3645 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3648 # @ChardevSpiceChannel:
3650 # Configuration info for spice vm channel chardevs.
3652 # @type: kind of channel (for example vdagent).
3654 # Since: 1.5
3656 { 'type': 'ChardevSpiceChannel', 'data': { 'type'  : 'str' } }
3659 # @ChardevSpicePort:
3661 # Configuration info for spice port chardevs.
3663 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3665 # Since: 1.5
3667 { 'type': 'ChardevSpicePort', 'data': { 'fqdn'  : 'str' } }
3670 # @ChardevVC:
3672 # Configuration info for virtual console chardevs.
3674 # @width:  console width,  in pixels
3675 # @height: console height, in pixels
3676 # @cols:   console width,  in chars
3677 # @rows:   console height, in chars
3679 # Since: 1.5
3681 { 'type': 'ChardevVC', 'data': { '*width'  : 'int',
3682                                  '*height' : 'int',
3683                                  '*cols'   : 'int',
3684                                  '*rows'   : 'int' } }
3687 # @ChardevRingbuf:
3689 # Configuration info for ring buffer chardevs.
3691 # @size: #optional ring buffer size, must be power of two, default is 65536
3693 # Since: 1.5
3695 { 'type': 'ChardevRingbuf', 'data': { '*size'  : 'int' } }
3698 # @ChardevBackend:
3700 # Configuration info for the new chardev backend.
3702 # Since: 1.4
3704 { 'type': 'ChardevDummy', 'data': { } }
3706 { 'union': 'ChardevBackend', 'data': { 'file'   : 'ChardevFile',
3707                                        'serial' : 'ChardevHostdev',
3708                                        'parallel': 'ChardevHostdev',
3709                                        'pipe'   : 'ChardevHostdev',
3710                                        'socket' : 'ChardevSocket',
3711                                        'udp'    : 'ChardevUdp',
3712                                        'pty'    : 'ChardevDummy',
3713                                        'null'   : 'ChardevDummy',
3714                                        'mux'    : 'ChardevMux',
3715                                        'msmouse': 'ChardevDummy',
3716                                        'braille': 'ChardevDummy',
3717                                        'stdio'  : 'ChardevStdio',
3718                                        'console': 'ChardevDummy',
3719                                        'spicevmc' : 'ChardevSpiceChannel',
3720                                        'spiceport' : 'ChardevSpicePort',
3721                                        'vc'     : 'ChardevVC',
3722                                        'ringbuf': 'ChardevRingbuf',
3723                                        # next one is just for compatibility
3724                                        'memory' : 'ChardevRingbuf' } }
3727 # @ChardevReturn:
3729 # Return info about the chardev backend just created.
3731 # @pty: #optional name of the slave pseudoterminal device, present if
3732 #       and only if a chardev of type 'pty' was created
3734 # Since: 1.4
3736 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3739 # @chardev-add:
3741 # Add a character device backend
3743 # @id: the chardev's ID, must be unique
3744 # @backend: backend type and parameters
3746 # Returns: ChardevReturn.
3748 # Since: 1.4
3750 { 'command': 'chardev-add', 'data': {'id'      : 'str',
3751                                      'backend' : 'ChardevBackend' },
3752   'returns': 'ChardevReturn' }
3755 # @chardev-remove:
3757 # Remove a character device backend
3759 # @id: the chardev's ID, must exist and not be in use
3761 # Returns: Nothing on success
3763 # Since: 1.4
3765 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3768 # @TpmModel:
3770 # An enumeration of TPM models
3772 # @tpm-tis: TPM TIS model
3774 # Since: 1.5
3776 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3779 # @query-tpm-models:
3781 # Return a list of supported TPM models
3783 # Returns: a list of TpmModel
3785 # Since: 1.5
3787 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3790 # @TpmType:
3792 # An enumeration of TPM types
3794 # @passthrough: TPM passthrough type
3796 # Since: 1.5
3798 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3801 # @query-tpm-types:
3803 # Return a list of supported TPM types
3805 # Returns: a list of TpmType
3807 # Since: 1.5
3809 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3812 # @TPMPassthroughOptions:
3814 # Information about the TPM passthrough type
3816 # @path: #optional string describing the path used for accessing the TPM device
3818 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3819 #               for cancellation of TPM commands while they are executing
3821 # Since: 1.5
3823 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3824                                              '*cancel-path' : 'str'} }
3827 # @TpmTypeOptions:
3829 # A union referencing different TPM backend types' configuration options
3831 # @passthrough: The configuration options for the TPM passthrough type
3833 # Since: 1.5
3835 { 'union': 'TpmTypeOptions',
3836    'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3839 # @TpmInfo:
3841 # Information about the TPM
3843 # @id: The Id of the TPM
3845 # @model: The TPM frontend model
3847 # @options: The TPM (backend) type configuration options
3849 # Since: 1.5
3851 { 'type': 'TPMInfo',
3852   'data': {'id': 'str',
3853            'model': 'TpmModel',
3854            'options': 'TpmTypeOptions' } }
3857 # @query-tpm:
3859 # Return information about the TPM device
3861 # Returns: @TPMInfo on success
3863 # Since: 1.5
3865 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3868 # @AcpiTableOptions
3870 # Specify an ACPI table on the command line to load.
3872 # At most one of @file and @data can be specified. The list of files specified
3873 # by any one of them is loaded and concatenated in order. If both are omitted,
3874 # @data is implied.
3876 # Other fields / optargs can be used to override fields of the generic ACPI
3877 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3878 # Description Table Header. If a header field is not overridden, then the
3879 # corresponding value from the concatenated blob is used (in case of @file), or
3880 # it is filled in with a hard-coded value (in case of @data).
3882 # String fields are copied into the matching ACPI member from lowest address
3883 # upwards, and silently truncated / NUL-padded to length.
3885 # @sig: #optional table signature / identifier (4 bytes)
3887 # @rev: #optional table revision number (dependent on signature, 1 byte)
3889 # @oem_id: #optional OEM identifier (6 bytes)
3891 # @oem_table_id: #optional OEM table identifier (8 bytes)
3893 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3895 # @asl_compiler_id: #optional identifier of the utility that created the table
3896 #                   (4 bytes)
3898 # @asl_compiler_rev: #optional revision number of the utility that created the
3899 #                    table (4 bytes)
3901 # @file: #optional colon (:) separated list of pathnames to load and
3902 #        concatenate as table data. The resultant binary blob is expected to
3903 #        have an ACPI table header. At least one file is required. This field
3904 #        excludes @data.
3906 # @data: #optional colon (:) separated list of pathnames to load and
3907 #        concatenate as table data. The resultant binary blob must not have an
3908 #        ACPI table header. At least one file is required. This field excludes
3909 #        @file.
3911 # Since 1.5
3913 { 'type': 'AcpiTableOptions',
3914   'data': {
3915     '*sig':               'str',
3916     '*rev':               'uint8',
3917     '*oem_id':            'str',
3918     '*oem_table_id':      'str',
3919     '*oem_rev':           'uint32',
3920     '*asl_compiler_id':   'str',
3921     '*asl_compiler_rev':  'uint32',
3922     '*file':              'str',
3923     '*data':              'str' }}
3926 # @CommandLineParameterType:
3928 # Possible types for an option parameter.
3930 # @string: accepts a character string
3932 # @boolean: accepts "on" or "off"
3934 # @number: accepts a number
3936 # @size: accepts a number followed by an optional suffix (K)ilo,
3937 #        (M)ega, (G)iga, (T)era
3939 # Since 1.5
3941 { 'enum': 'CommandLineParameterType',
3942   'data': ['string', 'boolean', 'number', 'size'] }
3945 # @CommandLineParameterInfo:
3947 # Details about a single parameter of a command line option.
3949 # @name: parameter name
3951 # @type: parameter @CommandLineParameterType
3953 # @help: #optional human readable text string, not suitable for parsing.
3955 # Since 1.5
3957 { 'type': 'CommandLineParameterInfo',
3958   'data': { 'name': 'str',
3959             'type': 'CommandLineParameterType',
3960             '*help': 'str' } }
3963 # @CommandLineOptionInfo:
3965 # Details about a command line option, including its list of parameter details
3967 # @option: option name
3969 # @parameters: an array of @CommandLineParameterInfo
3971 # Since 1.5
3973 { 'type': 'CommandLineOptionInfo',
3974   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3977 # @query-command-line-options:
3979 # Query command line option schema.
3981 # @option: #optional option name
3983 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3984 #          @option).  Returns an error if the given @option doesn't exist.
3986 # Since 1.5
3988 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3989  'returns': ['CommandLineOptionInfo'] }
3992 # @X86CPURegister32
3994 # A X86 32-bit register
3996 # Since: 1.5
3998 { 'enum': 'X86CPURegister32',
3999   'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
4002 # @X86CPUFeatureWordInfo
4004 # Information about a X86 CPU feature word
4006 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
4008 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
4009 #                   feature word
4011 # @cpuid-register: Output register containing the feature bits
4013 # @features: value of output register, containing the feature bits
4015 # Since: 1.5
4017 { 'type': 'X86CPUFeatureWordInfo',
4018   'data': { 'cpuid-input-eax': 'int',
4019             '*cpuid-input-ecx': 'int',
4020             'cpuid-register': 'X86CPURegister32',
4021             'features': 'int' } }
4024 # @RxState:
4026 # Packets receiving state
4028 # @normal: filter assigned packets according to the mac-table
4030 # @none: don't receive any assigned packet
4032 # @all: receive all assigned packets
4034 # Since: 1.6
4036 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4039 # @RxFilterInfo:
4041 # Rx-filter information for a NIC.
4043 # @name: net client name
4045 # @promiscuous: whether promiscuous mode is enabled
4047 # @multicast: multicast receive state
4049 # @unicast: unicast receive state
4051 # @broadcast-allowed: whether to receive broadcast
4053 # @multicast-overflow: multicast table is overflowed or not
4055 # @unicast-overflow: unicast table is overflowed or not
4057 # @main-mac: the main macaddr string
4059 # @vlan-table: a list of active vlan id
4061 # @unicast-table: a list of unicast macaddr string
4063 # @multicast-table: a list of multicast macaddr string
4065 # Since 1.6
4068 { 'type': 'RxFilterInfo',
4069   'data': {
4070     'name':               'str',
4071     'promiscuous':        'bool',
4072     'multicast':          'RxState',
4073     'unicast':            'RxState',
4074     'broadcast-allowed':  'bool',
4075     'multicast-overflow': 'bool',
4076     'unicast-overflow':   'bool',
4077     'main-mac':           'str',
4078     'vlan-table':         ['int'],
4079     'unicast-table':      ['str'],
4080     'multicast-table':    ['str'] }}
4083 # @query-rx-filter:
4085 # Return rx-filter information for all NICs (or for the given NIC).
4087 # @name: #optional net client name
4089 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4090 #          Returns an error if the given @name doesn't exist, or given
4091 #          NIC doesn't support rx-filter querying, or given net client
4092 #          isn't a NIC.
4094 # Since: 1.6
4096 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4097   'returns': ['RxFilterInfo'] }
4101 # @BlockdevDiscardOptions
4103 # Determines how to handle discard requests.
4105 # @ignore:      Ignore the request
4106 # @unmap:       Forward as an unmap request
4108 # Since: 1.7
4110 { 'enum': 'BlockdevDiscardOptions',
4111   'data': [ 'ignore', 'unmap' ] }
4114 # @BlockdevAioOptions
4116 # Selects the AIO backend to handle I/O requests
4118 # @threads:     Use qemu's thread pool
4119 # @native:      Use native AIO backend (only Linux and Windows)
4121 # Since: 1.7
4123 { 'enum': 'BlockdevAioOptions',
4124   'data': [ 'threads', 'native' ] }
4127 # @BlockdevCacheOptions
4129 # Includes cache-related options for block devices
4131 # @writeback:   #optional enables writeback mode for any caches (default: true)
4132 # @direct:      #optional enables use of O_DIRECT (bypass the host page cache;
4133 #               default: false)
4134 # @no-flush:    #optional ignore any flush requests for the device (default:
4135 #               false)
4137 # Since: 1.7
4139 { 'type': 'BlockdevCacheOptions',
4140   'data': { '*writeback': 'bool',
4141             '*direct': 'bool',
4142             '*no-flush': 'bool' } }
4145 # @BlockdevOptionsBase
4147 # Options that are available for all block devices, independent of the block
4148 # driver.
4150 # @driver:      block driver name
4151 # @id:          #optional id by which the new block device can be referred to.
4152 #               This is a required option on the top level of blockdev-add, and
4153 #               currently not allowed on any other level.
4154 # @node-name:   #optional the name of a block driver state node (Since 2.0)
4155 # @discard:     #optional discard-related options (default: ignore)
4156 # @cache:       #optional cache-related options
4157 # @aio:         #optional AIO backend (default: threads)
4158 # @rerror:      #optional how to handle read errors on the device
4159 #               (default: report)
4160 # @werror:      #optional how to handle write errors on the device
4161 #               (default: enospc)
4162 # @read-only:   #optional whether the block device should be read-only
4163 #               (default: false)
4165 # Since: 1.7
4167 { 'type': 'BlockdevOptionsBase',
4168   'data': { 'driver': 'str',
4169             '*id': 'str',
4170             '*node-name': 'str',
4171             '*discard': 'BlockdevDiscardOptions',
4172             '*cache': 'BlockdevCacheOptions',
4173             '*aio': 'BlockdevAioOptions',
4174             '*rerror': 'BlockdevOnError',
4175             '*werror': 'BlockdevOnError',
4176             '*read-only': 'bool' } }
4179 # @BlockdevOptionsFile
4181 # Driver specific block device options for the file backend and similar
4182 # protocols.
4184 # @filename:    path to the image file
4186 # Since: 1.7
4188 { 'type': 'BlockdevOptionsFile',
4189   'data': { 'filename': 'str' } }
4192 # @BlockdevOptionsVVFAT
4194 # Driver specific block device options for the vvfat protocol.
4196 # @dir:         directory to be exported as FAT image
4197 # @fat-type:    #optional FAT type: 12, 16 or 32
4198 # @floppy:      #optional whether to export a floppy image (true) or
4199 #               partitioned hard disk (false; default)
4200 # @rw:          #optional whether to allow write operations (default: false)
4202 # Since: 1.7
4204 { 'type': 'BlockdevOptionsVVFAT',
4205   'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4206             '*rw': 'bool' } }
4209 # @BlockdevOptionsGenericFormat
4211 # Driver specific block device options for image format that have no option
4212 # besides their data source.
4214 # @file:        reference to or definition of the data source block device
4216 # Since: 1.7
4218 { 'type': 'BlockdevOptionsGenericFormat',
4219   'data': { 'file': 'BlockdevRef' } }
4222 # @BlockdevOptionsGenericCOWFormat
4224 # Driver specific block device options for image format that have no option
4225 # besides their data source and an optional backing file.
4227 # @backing:     #optional reference to or definition of the backing file block
4228 #               device (if missing, taken from the image file content). It is
4229 #               allowed to pass an empty string here in order to disable the
4230 #               default backing file.
4232 # Since: 1.7
4234 { 'type': 'BlockdevOptionsGenericCOWFormat',
4235   'base': 'BlockdevOptionsGenericFormat',
4236   'data': { '*backing': 'BlockdevRef' } }
4239 # @BlockdevOptionsQcow2
4241 # Driver specific block device options for qcow2.
4243 # @lazy-refcounts:        #optional whether to enable the lazy refcounts
4244 #                         feature (default is taken from the image file)
4246 # @pass-discard-request:  #optional whether discard requests to the qcow2
4247 #                         device should be forwarded to the data source
4249 # @pass-discard-snapshot: #optional whether discard requests for the data source
4250 #                         should be issued when a snapshot operation (e.g.
4251 #                         deleting a snapshot) frees clusters in the qcow2 file
4253 # @pass-discard-other:    #optional whether discard requests for the data source
4254 #                         should be issued on other occasions where a cluster
4255 #                         gets freed
4257 # Since: 1.7
4259 { 'type': 'BlockdevOptionsQcow2',
4260   'base': 'BlockdevOptionsGenericCOWFormat',
4261   'data': { '*lazy-refcounts': 'bool',
4262             '*pass-discard-request': 'bool',
4263             '*pass-discard-snapshot': 'bool',
4264             '*pass-discard-other': 'bool' } }
4267 # @BlkdebugEvent
4269 # Trigger events supported by blkdebug.
4271 { 'enum': 'BlkdebugEvent',
4272   'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
4273             'l1_grow.activate_table', 'l2_load', 'l2_update',
4274             'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
4275             'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
4276             'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
4277             'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
4278             'refblock_load', 'refblock_update', 'refblock_update_part',
4279             'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
4280             'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
4281             'refblock_alloc.switch_table', 'cluster_alloc',
4282             'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
4283             'flush_to_disk' ] }
4286 # @BlkdebugInjectErrorOptions
4288 # Describes a single error injection for blkdebug.
4290 # @event:       trigger event
4292 # @state:       #optional the state identifier blkdebug needs to be in to
4293 #               actually trigger the event; defaults to "any"
4295 # @errno:       #optional error identifier (errno) to be returned; defaults to
4296 #               EIO
4298 # @sector:      #optional specifies the sector index which has to be affected
4299 #               in order to actually trigger the event; defaults to "any
4300 #               sector"
4302 # @once:        #optional disables further events after this one has been
4303 #               triggered; defaults to false
4305 # @immediately: #optional fail immediately; defaults to false
4307 # Since: 2.0
4309 { 'type': 'BlkdebugInjectErrorOptions',
4310   'data': { 'event': 'BlkdebugEvent',
4311             '*state': 'int',
4312             '*errno': 'int',
4313             '*sector': 'int',
4314             '*once': 'bool',
4315             '*immediately': 'bool' } }
4318 # @BlkdebugSetStateOptions
4320 # Describes a single state-change event for blkdebug.
4322 # @event:       trigger event
4324 # @state:       #optional the current state identifier blkdebug needs to be in;
4325 #               defaults to "any"
4327 # @new_state:   the state identifier blkdebug is supposed to assume if
4328 #               this event is triggered
4330 # Since: 2.0
4332 { 'type': 'BlkdebugSetStateOptions',
4333   'data': { 'event': 'BlkdebugEvent',
4334             '*state': 'int',
4335             'new_state': 'int' } }
4338 # @BlockdevOptionsBlkdebug
4340 # Driver specific block device options for blkdebug.
4342 # @image:           underlying raw block device (or image file)
4344 # @config:          #optional filename of the configuration file
4346 # @align:           #optional required alignment for requests in bytes
4348 # @inject-error:    #optional array of error injection descriptions
4350 # @set-state:       #optional array of state-change descriptions
4352 # Since: 2.0
4354 { 'type': 'BlockdevOptionsBlkdebug',
4355   'data': { 'image': 'BlockdevRef',
4356             '*config': 'str',
4357             '*align': 'int',
4358             '*inject-error': ['BlkdebugInjectErrorOptions'],
4359             '*set-state': ['BlkdebugSetStateOptions'] } }
4362 # @BlockdevOptionsBlkverify
4364 # Driver specific block device options for blkverify.
4366 # @test:    block device to be tested
4368 # @raw:     raw image used for verification
4370 # Since: 2.0
4372 { 'type': 'BlockdevOptionsBlkverify',
4373   'data': { 'test': 'BlockdevRef',
4374             'raw': 'BlockdevRef' } }
4377 # @BlockdevOptions
4379 # Options for creating a block device.
4381 # Since: 1.7
4383 { 'union': 'BlockdevOptions',
4384   'base': 'BlockdevOptionsBase',
4385   'discriminator': 'driver',
4386   'data': {
4387       'file':       'BlockdevOptionsFile',
4388       'http':       'BlockdevOptionsFile',
4389       'https':      'BlockdevOptionsFile',
4390       'ftp':        'BlockdevOptionsFile',
4391       'ftps':       'BlockdevOptionsFile',
4392       'tftp':       'BlockdevOptionsFile',
4393 # TODO gluster: Wait for structured options
4394 # TODO iscsi: Wait for structured options
4395 # TODO nbd: Should take InetSocketAddress for 'host'?
4396 # TODO nfs: Wait for structured options
4397 # TODO rbd: Wait for structured options
4398 # TODO sheepdog: Wait for structured options
4399 # TODO ssh: Should take InetSocketAddress for 'host'?
4400       'vvfat':      'BlockdevOptionsVVFAT',
4401       'blkdebug':   'BlockdevOptionsBlkdebug',
4402       'blkverify':  'BlockdevOptionsBlkverify',
4403       'bochs':      'BlockdevOptionsGenericFormat',
4404       'cloop':      'BlockdevOptionsGenericFormat',
4405       'cow':        'BlockdevOptionsGenericCOWFormat',
4406       'dmg':        'BlockdevOptionsGenericFormat',
4407       'parallels':  'BlockdevOptionsGenericFormat',
4408       'qcow':       'BlockdevOptionsGenericCOWFormat',
4409       'qcow2':      'BlockdevOptionsQcow2',
4410       'qed':        'BlockdevOptionsGenericCOWFormat',
4411       'raw':        'BlockdevOptionsGenericFormat',
4412       'vdi':        'BlockdevOptionsGenericFormat',
4413       'vhdx':       'BlockdevOptionsGenericFormat',
4414       'vmdk':       'BlockdevOptionsGenericCOWFormat',
4415       'vpc':        'BlockdevOptionsGenericFormat'
4416   } }
4419 # @BlockdevRef
4421 # Reference to a block device.
4423 # @definition:      defines a new block device inline
4424 # @reference:       references the ID of an existing block device. An
4425 #                   empty string means that no block device should be
4426 #                   referenced.
4428 # Since: 1.7
4430 { 'union': 'BlockdevRef',
4431   'discriminator': {},
4432   'data': { 'definition': 'BlockdevOptions',
4433             'reference': 'str' } }
4436 # @blockdev-add:
4438 # Creates a new block device.
4440 # @options: block device options for the new device
4442 # Since: 1.7
4444 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }