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
27 { 'enum': 'ErrorClass',
28 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
29 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
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"
48 # Returns: nothing on success.
52 { 'command': 'add_client',
53 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
59 # Guest name information.
61 # @name: #optional The name of the guest
65 { 'type': 'NameInfo', 'data': {'*name': 'str'} }
70 # Return the name information of a guest.
72 # Returns: @NameInfo of the guest
76 { 'command': 'query-name', 'returns': 'NameInfo' }
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.
100 { 'type': 'VersionInfo',
101 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
107 # Returns the current version of QEMU.
109 # Returns: A @VersionInfo object describing the current version of QEMU.
113 { 'command': 'query-version', 'returns': 'VersionInfo' }
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
126 { 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
131 # Returns information about KVM acceleration
137 { 'command': 'query-kvm', 'returns': 'KvmInfo' }
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
154 # @internal-error: An internal error that prevents further guest execution
157 # @io-error: the last IOP has failed and the device is configured to pause
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',
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
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
221 { 'type': 'ImageInfoSpecificQCow2',
224 '*lazy-refcounts': 'bool'
228 # @ImageInfoSpecific:
230 # A discriminated record of image format specific information structures.
235 { 'union': 'ImageInfoSpecific',
237 'qcow2': 'ImageInfoSpecificQCow2'
243 # Information about a QEMU image file
245 # @filename: name of the image file
247 # @format: format of the image file
249 # @virtual-size: maximum capacity in bytes of the image
251 # @actual-size: #optional actual size on disk in bytes of the image
253 # @dirty-flag: #optional true if image is not cleanly closed
255 # @cluster-size: #optional size of a cluster in bytes
257 # @encrypted: #optional true if the image is encrypted
259 # @backing-filename: #optional name of the backing file
261 # @full-backing-filename: #optional full path of the backing file
263 # @backing-filename-format: #optional the format of the backing file
265 # @snapshots: #optional list of VM snapshots
267 # @backing-image: #optional info of the backing image (since 1.6)
269 # @format-specific: #optional structure supplying additional format-specific
270 # information (since 1.7)
276 { 'type': 'ImageInfo',
277 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
278 '*actual-size': 'int', 'virtual-size': 'int',
279 '*cluster-size': 'int', '*encrypted': 'bool',
280 '*backing-filename': 'str', '*full-backing-filename': 'str',
281 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
282 '*backing-image': 'ImageInfo',
283 '*format-specific': 'ImageInfoSpecific' } }
288 # Information about a QEMU image file check
290 # @filename: name of the image file checked
292 # @format: format of the image file checked
294 # @check-errors: number of unexpected errors occurred during check
296 # @image-end-offset: #optional offset (in bytes) where the image ends, this
297 # field is present if the driver for the image format
300 # @corruptions: #optional number of corruptions found during the check if any
302 # @leaks: #optional number of leaks found during the check if any
304 # @corruptions-fixed: #optional number of corruptions fixed during the check
307 # @leaks-fixed: #optional number of leaks fixed during the check if any
309 # @total-clusters: #optional total number of clusters, this field is present
310 # if the driver for the image format supports it
312 # @allocated-clusters: #optional total number of allocated clusters, this
313 # field is present if the driver for the image format
316 # @fragmented-clusters: #optional total number of fragmented clusters, this
317 # field is present if the driver for the image format
320 # @compressed-clusters: #optional total number of compressed clusters, this
321 # field is present if the driver for the image format
328 { 'type': 'ImageCheck',
329 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
330 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
331 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
332 '*total-clusters': 'int', '*allocated-clusters': 'int',
333 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
338 # Information about VCPU run state
340 # @running: true if all VCPUs are runnable, false if not runnable
342 # @singlestep: true if VCPUs are in single-step mode
344 # @status: the virtual machine @RunState
348 # Notes: @singlestep is enabled through the GDB stub
350 { 'type': 'StatusInfo',
351 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
356 # Query the run status of all VCPUs
358 # Returns: @StatusInfo reflecting all VCPUs
362 { 'command': 'query-status', 'returns': 'StatusInfo' }
367 # Guest UUID information.
369 # @UUID: the UUID of the guest
373 # Notes: If no UUID was specified for the guest, a null UUID is returned.
375 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
380 # Query the guest UUID information.
382 # Returns: The @UuidInfo for the guest
386 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
391 # Information about a character device.
393 # @label: the label of the character device
395 # @filename: the filename of the character device
397 # Notes: @filename is encoded using the QEMU command line character device
398 # encoding. See the QEMU man page for details.
402 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
407 # Returns information about current character devices.
409 # Returns: a list of @ChardevInfo
413 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
418 # An enumeration of data format.
420 # @utf8: Data is a UTF-8 string (RFC 3629)
422 # @base64: Data is Base64 encoded binary (RFC 3548)
426 { 'enum': 'DataFormat',
427 'data': [ 'utf8', 'base64' ] }
432 # Write to a ring buffer character device.
434 # @device: the ring buffer character device name
436 # @data: data to write
438 # @format: #optional data encoding (default 'utf8').
439 # - base64: data must be base64 encoded text. Its binary
440 # decoding gets written.
441 # Bug: invalid base64 is currently not rejected.
442 # Whitespace *is* invalid.
443 # - utf8: data's UTF-8 encoding is written
444 # - data itself is always Unicode regardless of format, like
447 # Returns: Nothing on success
451 { 'command': 'ringbuf-write',
452 'data': {'device': 'str', 'data': 'str',
453 '*format': 'DataFormat'} }
458 # Read from a ring buffer character device.
460 # @device: the ring buffer character device name
462 # @size: how many bytes to read at most
464 # @format: #optional data encoding (default 'utf8').
465 # - base64: the data read is returned in base64 encoding.
466 # - utf8: the data read is interpreted as UTF-8.
467 # Bug: can screw up when the buffer contains invalid UTF-8
468 # sequences, NUL characters, after the ring buffer lost
469 # data, and when reading stops because the size limit is
471 # - The return value is always Unicode regardless of format,
472 # like any other string.
474 # Returns: data read from the device
478 { 'command': 'ringbuf-read',
479 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
485 # Information about a QMP command
487 # @name: The command name
491 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
496 # Return a list of supported QMP commands by this server
498 # Returns: A list of @CommandInfo for all supported commands
502 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
507 # Information about a QMP event
509 # @name: The event name
513 { 'type': 'EventInfo', 'data': {'name': 'str'} }
518 # Return a list of supported QMP events by this server
520 # Returns: A list of @EventInfo for all supported events
524 { 'command': 'query-events', 'returns': ['EventInfo'] }
529 # Detailed migration status.
531 # @transferred: amount of bytes already transferred to the target VM
533 # @remaining: amount of bytes remaining to be transferred to the target VM
535 # @total: total amount of bytes involved in the migration process
537 # @duplicate: number of duplicate (zero) pages (since 1.2)
539 # @skipped: number of skipped zero pages (since 1.5)
541 # @normal : number of normal pages (since 1.2)
543 # @normal-bytes: number of normal bytes sent (since 1.2)
545 # @dirty-pages-rate: number of pages dirtied by second by the
548 # @mbps: throughput in megabits/sec. (since 1.6)
552 { 'type': 'MigrationStats',
553 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
554 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
555 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
556 'mbps' : 'number' } }
561 # Detailed XBZRLE migration cache statistics
563 # @cache-size: XBZRLE cache size
565 # @bytes: amount of bytes already transferred to the target VM
567 # @pages: amount of pages transferred to the target VM
569 # @cache-miss: number of cache miss
571 # @overflow: number of overflows
575 { 'type': 'XBZRLECacheStats',
576 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
577 'cache-miss': 'int', 'overflow': 'int' } }
582 # Information about current migration process.
584 # @status: #optional string describing the current migration status.
585 # As of 0.14.0 this can be 'active', 'completed', 'failed' or
586 # 'cancelled'. If this field is not returned, no migration process
589 # @ram: #optional @MigrationStats containing detailed migration
590 # status, only returned if status is 'active' or
591 # 'completed'. 'comppleted' (since 1.2)
593 # @disk: #optional @MigrationStats containing detailed disk migration
594 # status, only returned if status is 'active' and it is a block
597 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
598 # migration statistics, only returned if XBZRLE feature is on and
599 # status is 'active' or 'completed' (since 1.2)
601 # @total-time: #optional total amount of milliseconds since migration started.
602 # If migration has ended, it returns the total migration
605 # @downtime: #optional only present when migration finishes correctly
606 # total downtime in milliseconds for the guest.
609 # @expected-downtime: #optional only present while migration is active
610 # expected downtime in milliseconds for the guest in last walk
611 # of the dirty bitmap. (since 1.3)
613 # @setup-time: #optional amount of setup time in milliseconds _before_ the
614 # iterations begin but _after_ the QMP command is issued. This is designed
615 # to provide an accounting of any activities (such as RDMA pinning) which
616 # may be expensive, but do not actually occur during the iterative
617 # migration rounds themselves. (since 1.6)
621 { 'type': 'MigrationInfo',
622 'data': {'*status': 'str', '*ram': 'MigrationStats',
623 '*disk': 'MigrationStats',
624 '*xbzrle-cache': 'XBZRLECacheStats',
625 '*total-time': 'int',
626 '*expected-downtime': 'int',
628 '*setup-time': 'int'} }
633 # Returns information about current migration process.
635 # Returns: @MigrationInfo
639 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
642 # @MigrationCapability
644 # Migration capabilities enumeration
646 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
647 # This feature allows us to minimize migration traffic for certain work
648 # loads, by sending compressed difference of the pages
650 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
651 # mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
652 # Disabled by default. Experimental: may (or may not) be renamed after
653 # further testing is complete. (since 1.6)
655 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
656 # essentially saves 1MB of zeroes per block on the wire. Enabling requires
657 # source and target VM to support this feature. To enable it is sufficient
658 # to enable the capability on the source VM. The feature is disabled by
659 # default. (since 1.6)
661 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
662 # to speed up convergence of RAM migration. (since 1.6)
666 { 'enum': 'MigrationCapability',
667 'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
670 # @MigrationCapabilityStatus
672 # Migration capability information
674 # @capability: capability enum
676 # @state: capability state bool
680 { 'type': 'MigrationCapabilityStatus',
681 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
684 # @migrate-set-capabilities
686 # Enable/Disable the following migration capabilities (like xbzrle)
688 # @capabilities: json array of capability modifications to make
692 { 'command': 'migrate-set-capabilities',
693 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
696 # @query-migrate-capabilities
698 # Returns information about the current migration capabilities status
700 # Returns: @MigrationCapabilitiesStatus
704 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
709 # Information about a mouse device.
711 # @name: the name of the mouse device
713 # @index: the index of the mouse device
715 # @current: true if this device is currently receiving mouse events
717 # @absolute: true if this device supports absolute coordinates as input
721 { 'type': 'MouseInfo',
722 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
723 'absolute': 'bool'} }
728 # Returns information about each active mouse device
730 # Returns: a list of @MouseInfo for each device
734 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
739 # Information about a virtual CPU
741 # @CPU: the index of the virtual CPU
743 # @current: this only exists for backwards compatible and should be ignored
745 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
746 # to a processor specific low power mode.
748 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
750 # If the target is Sparc, this is the PC component of the
751 # instruction pointer.
753 # @nip: #optional If the target is PPC, the instruction pointer
755 # @npc: #optional If the target is Sparc, the NPC component of the instruction
758 # @PC: #optional If the target is MIPS, the instruction pointer
760 # @thread_id: ID of the underlying host thread
764 # Notes: @halted is a transient state that changes frequently. By the time the
765 # data is sent to the client, the guest may no longer be halted.
768 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
769 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
774 # Returns a list of information about each virtual CPU.
776 # Returns: a list of @CpuInfo for each virtual CPU
780 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
785 # Information about the backing device for a block device.
787 # @file: the filename of the backing device
789 # @ro: true if the backing device was open read-only
791 # @drv: the name of the block format used to open the backing device. As of
792 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
793 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
794 # 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
795 # 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
797 # @backing_file: #optional the name of the backing file (for copy-on-write)
799 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
801 # @encrypted: true if the backing device is encrypted
803 # @encryption_key_missing: true if the backing device is encrypted but an
804 # valid encryption key is missing
806 # @bps: total throughput limit in bytes per second is specified
808 # @bps_rd: read throughput limit in bytes per second is specified
810 # @bps_wr: write throughput limit in bytes per second is specified
812 # @iops: total I/O operations per second is specified
814 # @iops_rd: read I/O operations per second is specified
816 # @iops_wr: write I/O operations per second is specified
818 # @image: the info of image used (since: 1.6)
820 # @bps_max: #optional total max in bytes (Since 1.7)
822 # @bps_rd_max: #optional read max in bytes (Since 1.7)
824 # @bps_wr_max: #optional write max in bytes (Since 1.7)
826 # @iops_max: #optional total I/O operations max (Since 1.7)
828 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
830 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
832 # @iops_size: #optional an I/O size in bytes (Since 1.7)
836 # Notes: This interface is only found in @BlockInfo.
838 { 'type': 'BlockDeviceInfo',
839 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
840 '*backing_file': 'str', 'backing_file_depth': 'int',
841 'encrypted': 'bool', 'encryption_key_missing': 'bool',
842 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
843 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
844 'image': 'ImageInfo',
845 '*bps_max': 'int', '*bps_rd_max': 'int',
846 '*bps_wr_max': 'int', '*iops_max': 'int',
847 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
848 '*iops_size': 'int' } }
851 # @BlockDeviceIoStatus:
853 # An enumeration of block device I/O status.
855 # @ok: The last I/O operation has succeeded
857 # @failed: The last I/O operation has failed
859 # @nospace: The last I/O operation has failed due to a no-space condition
863 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
866 # @BlockDeviceMapEntry:
868 # Entry in the metadata map of the device (returned by "qemu-img map")
870 # @start: Offset in the image of the first byte described by this entry
873 # @length: Length of the range described by this entry (in bytes)
875 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
876 # before reaching one for which the range is allocated. The value is
877 # in the range 0 to the depth of the image chain - 1.
879 # @zero: the sectors in this range read as zeros
881 # @data: reading the image will actually read data from a file (in particular,
882 # if @offset is present this means that the sectors are not simply
883 # preallocated, but contain actual data in raw format)
885 # @offset: if present, the image file stores the data for this range in
886 # raw format at the given offset.
890 { 'type': 'BlockDeviceMapEntry',
891 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
892 'data': 'bool', '*offset': 'int' } }
897 # Block dirty bitmap information.
899 # @count: number of dirty bytes according to the dirty bitmap
901 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
905 { 'type': 'BlockDirtyInfo',
906 'data': {'count': 'int', 'granularity': 'int'} }
911 # Block device information. This structure describes a virtual device and
912 # the backing device associated with it.
914 # @device: The device name associated with the virtual device.
916 # @type: This field is returned only for compatibility reasons, it should
917 # not be used (always returns 'unknown')
919 # @removable: True if the device supports removable media.
921 # @locked: True if the guest has locked this device from having its media
924 # @tray_open: #optional True if the device has a tray and it is open
925 # (only present if removable is true)
927 # @dirty: #optional dirty bitmap information (only present if the dirty
930 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
931 # supports it and the VM is configured to stop on errors
933 # @inserted: #optional @BlockDeviceInfo describing the device if media is
938 { 'type': 'BlockInfo',
939 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
940 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
941 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
942 '*dirty': 'BlockDirtyInfo' } }
947 # Get a list of BlockInfo for all virtual block devices.
949 # Returns: a list of @BlockInfo describing each virtual block device
953 { 'command': 'query-block', 'returns': ['BlockInfo'] }
958 # Statistics of a virtual block device or a block backing device.
960 # @rd_bytes: The number of bytes read by the device.
962 # @wr_bytes: The number of bytes written by the device.
964 # @rd_operations: The number of read operations performed by the device.
966 # @wr_operations: The number of write operations performed by the device.
968 # @flush_operations: The number of cache flush operations performed by the
969 # device (since 0.15.0)
971 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
974 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
976 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
978 # @wr_highest_offset: The offset after the greatest byte written to the
979 # device. The intended use of this information is for
980 # growable sparse files (like qcow2) that are used on top
981 # of a physical device.
985 { 'type': 'BlockDeviceStats',
986 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
987 'wr_operations': 'int', 'flush_operations': 'int',
988 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
989 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
994 # Statistics of a virtual block device or a block backing device.
996 # @device: #optional If the stats are for a virtual block device, the name
997 # corresponding to the virtual block device.
999 # @stats: A @BlockDeviceStats for the device.
1001 # @parent: #optional This may point to the backing block device if this is a
1002 # a virtual block device. If it's a backing block, this will point
1003 # to the backing file is one is present.
1007 { 'type': 'BlockStats',
1008 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1009 '*parent': 'BlockStats'} }
1012 # @query-blockstats:
1014 # Query the @BlockStats for all virtual block devices.
1016 # Returns: A list of @BlockStats for each virtual block devices.
1020 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1025 # Information about a connected VNC client.
1027 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
1030 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1031 # 'ipv4' if the client is connected via IPv4 and TCP
1032 # 'unix' if the client is connected via a unix domain socket
1033 # 'unknown' otherwise
1035 # @service: The service name of the client's port. This may depends on the
1036 # host system's service database so symbolic names should not be
1039 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1040 # Name of the client.
1042 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1043 # used for authentication.
1047 { 'type': 'VncClientInfo',
1048 'data': {'host': 'str', 'family': 'str', 'service': 'str',
1049 '*x509_dname': 'str', '*sasl_username': 'str'} }
1054 # Information about the VNC session.
1056 # @enabled: true if the VNC server is enabled, false otherwise
1058 # @host: #optional The hostname the VNC server is bound to. This depends on
1059 # the name resolution on the host and may be an IP address.
1061 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1062 # 'ipv4' if the host is listening for IPv4 connections
1063 # 'unix' if the host is listening on a unix domain socket
1064 # 'unknown' otherwise
1066 # @service: #optional The service name of the server's port. This may depends
1067 # on the host system's service database so symbolic names should not
1070 # @auth: #optional the current authentication type used by the server
1071 # 'none' if no authentication is being used
1072 # 'vnc' if VNC authentication is being used
1073 # 'vencrypt+plain' if VEncrypt is used with plain text authentication
1074 # 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1075 # 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1076 # 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1077 # 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1078 # 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1079 # 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1080 # 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1081 # 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1083 # @clients: a list of @VncClientInfo of all currently connected clients
1087 { 'type': 'VncInfo',
1088 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1089 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1094 # Returns information about the current VNC server
1100 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1105 # Information about a SPICE client channel.
1107 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
1110 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1111 # 'ipv4' if the client is connected via IPv4 and TCP
1112 # 'unix' if the client is connected via a unix domain socket
1113 # 'unknown' otherwise
1115 # @port: The client's port number.
1117 # @connection-id: SPICE connection id number. All channels with the same id
1118 # belong to the same SPICE session.
1120 # @connection-type: SPICE channel type number. "1" is the main control
1121 # channel, filter for this one if you want to track spice
1124 # @channel-id: SPICE channel ID number. Usually "0", might be different when
1125 # multiple channels of the same type exist, such as multiple
1126 # display channels in a multihead setup
1128 # @tls: true if the channel is encrypted, false otherwise.
1132 { 'type': 'SpiceChannel',
1133 'data': {'host': 'str', 'family': 'str', 'port': 'str',
1134 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1138 # @SpiceQueryMouseMode
1140 # An enumeration of Spice mouse states.
1142 # @client: Mouse cursor position is determined by the client.
1144 # @server: Mouse cursor position is determined by the server.
1146 # @unknown: No information is available about mouse mode used by
1149 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1153 { 'enum': 'SpiceQueryMouseMode',
1154 'data': [ 'client', 'server', 'unknown' ] }
1159 # Information about the SPICE session.
1161 # @enabled: true if the SPICE server is enabled, false otherwise
1163 # @migrated: true if the last guest migration completed and spice
1164 # migration had completed as well. false otherwise.
1166 # @host: #optional The hostname the SPICE server is bound to. This depends on
1167 # the name resolution on the host and may be an IP address.
1169 # @port: #optional The SPICE server's port number.
1171 # @compiled-version: #optional SPICE server version.
1173 # @tls-port: #optional The SPICE server's TLS port number.
1175 # @auth: #optional the current authentication type used by the server
1176 # 'none' if no authentication is being used
1177 # 'spice' uses SASL or direct TLS authentication, depending on command
1180 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1181 # be determined by the client or the server, or unknown if spice
1182 # server doesn't provide this information.
1186 # @channels: a list of @SpiceChannel for each active spice channel
1190 { 'type': 'SpiceInfo',
1191 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1192 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1193 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1198 # Returns information about the current SPICE server
1200 # Returns: @SpiceInfo
1204 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1209 # Information about the guest balloon device.
1211 # @actual: the number of bytes the balloon currently contains
1216 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1221 # Return information about the balloon device.
1223 # Returns: @BalloonInfo on success
1224 # If the balloon driver is enabled but not functional because the KVM
1225 # kernel module cannot support it, KvmMissingCap
1226 # If no balloon device is present, DeviceNotActive
1230 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1235 # A PCI device memory region
1237 # @base: the starting address (guest physical)
1239 # @limit: the ending address (guest physical)
1243 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1248 # Information about a PCI device I/O region.
1250 # @bar: the index of the Base Address Register for this region
1252 # @type: 'io' if the region is a PIO region
1253 # 'memory' if the region is a MMIO region
1255 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1257 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1261 { 'type': 'PciMemoryRegion',
1262 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1263 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1268 # Information about a PCI Bridge device
1270 # @bus.number: primary bus interface number. This should be the number of the
1271 # bus the device resides on.
1273 # @bus.secondary: secondary bus interface number. This is the number of the
1274 # main bus for the bridge
1276 # @bus.subordinate: This is the highest number bus that resides below the
1279 # @bus.io_range: The PIO range for all devices on this bridge
1281 # @bus.memory_range: The MMIO range for all devices on this bridge
1283 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1286 # @devices: a list of @PciDeviceInfo for each device on this bridge
1290 { 'type': 'PciBridgeInfo',
1291 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1292 'io_range': 'PciMemoryRange',
1293 'memory_range': 'PciMemoryRange',
1294 'prefetchable_range': 'PciMemoryRange' },
1295 '*devices': ['PciDeviceInfo']} }
1300 # Information about a PCI device
1302 # @bus: the bus number of the device
1304 # @slot: the slot the device is located in
1306 # @function: the function of the slot used by the device
1308 # @class_info.desc: #optional a string description of the device's class
1310 # @class_info.class: the class code of the device
1312 # @id.device: the PCI device id
1314 # @id.vendor: the PCI vendor id
1316 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1318 # @qdev_id: the device name of the PCI device
1320 # @pci_bridge: if the device is a PCI bridge, the bridge information
1322 # @regions: a list of the PCI I/O regions associated with the device
1324 # Notes: the contents of @class_info.desc are not stable and should only be
1325 # treated as informational.
1329 { 'type': 'PciDeviceInfo',
1330 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1331 'class_info': {'*desc': 'str', 'class': 'int'},
1332 'id': {'device': 'int', 'vendor': 'int'},
1333 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1334 'regions': ['PciMemoryRegion']} }
1339 # Information about a PCI bus
1341 # @bus: the bus index
1343 # @devices: a list of devices on this bus
1347 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1352 # Return information about the PCI bus topology of the guest.
1354 # Returns: a list of @PciInfo for each PCI bus
1358 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1363 # An enumeration of possible behaviors for errors on I/O operations.
1364 # The exact meaning depends on whether the I/O was initiated by a guest
1367 # @report: for guest operations, report the error to the guest;
1368 # for jobs, cancel the job
1370 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1371 # or BLOCK_JOB_ERROR)
1373 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1375 # @stop: for guest operations, stop the virtual machine;
1376 # for jobs, pause the job
1380 { 'enum': 'BlockdevOnError',
1381 'data': ['report', 'ignore', 'enospc', 'stop'] }
1386 # An enumeration of possible behaviors for the initial synchronization
1387 # phase of storage mirroring.
1389 # @top: copies data in the topmost image to the destination
1391 # @full: copies data from all images to the destination
1393 # @none: only copy data written from now on
1397 { 'enum': 'MirrorSyncMode',
1398 'data': ['top', 'full', 'none'] }
1403 # Type of a block job.
1405 # @commit: block commit job type, see "block-commit"
1407 # @stream: block stream job type, see "block-stream"
1409 # @mirror: drive mirror job type, see "drive-mirror"
1411 # @backup: drive backup job type, see "drive-backup"
1415 { 'enum': 'BlockJobType',
1416 'data': ['commit', 'stream', 'mirror', 'backup'] }
1421 # Information about a long-running block device operation.
1423 # @type: the job type ('stream' for image streaming)
1425 # @device: the block device name
1427 # @len: the maximum progress value
1429 # @busy: false if the job is known to be in a quiescent state, with
1430 # no pending I/O. Since 1.3.
1432 # @paused: whether the job is paused or, if @busy is true, will
1433 # pause itself as soon as possible. Since 1.3.
1435 # @offset: the current progress value
1437 # @speed: the rate limit, bytes per second
1439 # @io-status: the status of the job (since 1.3)
1443 { 'type': 'BlockJobInfo',
1444 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1445 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1446 'io-status': 'BlockDeviceIoStatus'} }
1449 # @query-block-jobs:
1451 # Return information about long-running block device operations.
1453 # Returns: a list of @BlockJobInfo for each active block job
1457 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1462 # This command will cause the QEMU process to exit gracefully. While every
1463 # attempt is made to send the QMP response before terminating, this is not
1464 # guaranteed. When using this interface, a premature EOF would not be
1469 { 'command': 'quit' }
1474 # Stop all guest VCPU execution.
1478 # Notes: This function will succeed even if the guest is already in the stopped
1479 # state. In "inmigrate" state, it will ensure that the guest
1480 # remains paused once migration finishes, as if the -S option was
1481 # passed on the command line.
1483 { 'command': 'stop' }
1488 # Performs a hard reset of a guest.
1492 { 'command': 'system_reset' }
1495 # @system_powerdown:
1497 # Requests that a guest perform a powerdown operation.
1501 # Notes: A guest may or may not respond to this command. This command
1502 # returning does not indicate that a guest has accepted the request or
1503 # that it has shut down. Many guests will respond to this command by
1504 # prompting the user in some way.
1506 { 'command': 'system_powerdown' }
1511 # This command is a nop that is only provided for the purposes of compatibility.
1515 # Notes: Do not use this command.
1517 { 'command': 'cpu', 'data': {'index': 'int'} }
1522 # Adds CPU with specified ID
1524 # @id: ID of CPU to be created, valid values [0..max_cpus)
1526 # Returns: Nothing on success
1530 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1535 # Save a portion of guest memory to a file.
1537 # @val: the virtual address of the guest to start from
1539 # @size: the size of memory region to save
1541 # @filename: the file to save the memory to as binary data
1543 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1544 # virtual address (defaults to CPU 0)
1546 # Returns: Nothing on success
1550 # Notes: Errors were not reliably returned until 1.1
1552 { 'command': 'memsave',
1553 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1558 # Save a portion of guest physical memory to a file.
1560 # @val: the physical address of the guest to start from
1562 # @size: the size of memory region to save
1564 # @filename: the file to save the memory to as binary data
1566 # Returns: Nothing on success
1570 # Notes: Errors were not reliably returned until 1.1
1572 { 'command': 'pmemsave',
1573 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1578 # Resume guest VCPU execution.
1582 # Returns: If successful, nothing
1583 # If QEMU was started with an encrypted block device and a key has
1584 # not yet been set, DeviceEncrypted.
1586 # Notes: This command will succeed if the guest is currently running. It
1587 # will also succeed if the guest is in the "inmigrate" state; in
1588 # this case, the effect of the command is to make sure the guest
1589 # starts once migration finishes, removing the effect of the -S
1590 # command line option if it was passed.
1592 { 'command': 'cont' }
1597 # Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1603 { 'command': 'system_wakeup' }
1608 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1610 # Returns: If successful, nothing
1614 # Notes: Only x86 Virtual Machines support this command.
1616 { 'command': 'inject-nmi' }
1621 # Sets the link status of a virtual network adapter.
1623 # @name: the device name of the virtual network adapter
1625 # @up: true to set the link status to be up
1627 # Returns: Nothing on success
1628 # If @name is not a valid network device, DeviceNotFound
1632 # Notes: Not all network adapters support setting link status. This command
1633 # will succeed even if the network adapter does not support link status
1636 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1641 # This command sets the password of a block device that has not been open
1642 # with a password and requires one.
1644 # The two cases where this can happen are a block device is created through
1645 # QEMU's initial command line or a block device is changed through the legacy
1646 # @change interface.
1648 # In the event that the block device is created through the initial command
1649 # line, the VM will start in the stopped state regardless of whether '-S' is
1650 # used. The intention is for a management tool to query the block devices to
1651 # determine which ones are encrypted, set the passwords with this command, and
1652 # then start the guest with the @cont command.
1654 # @device: the name of the device to set the password on
1656 # @password: the password to use for the device
1658 # Returns: nothing on success
1659 # If @device is not a valid block device, DeviceNotFound
1660 # If @device is not encrypted, DeviceNotEncrypted
1662 # Notes: Not all block formats support encryption and some that do are not
1663 # able to validate that a password is correct. Disk corruption may
1664 # occur if an invalid password is specified.
1668 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1673 # Request the balloon driver to change its balloon size.
1675 # @value: the target size of the balloon in bytes
1677 # Returns: Nothing on success
1678 # If the balloon driver is enabled but not functional because the KVM
1679 # kernel module cannot support it, KvmMissingCap
1680 # If no balloon device is present, DeviceNotActive
1682 # Notes: This command just issues a request to the guest. When it returns,
1683 # the balloon size may not have changed. A guest can change the balloon
1684 # size independent of this command.
1688 { 'command': 'balloon', 'data': {'value': 'int'} }
1693 # Resize a block image while a guest is running.
1695 # @device: the name of the device to get the image resized
1697 # @size: new image size in bytes
1699 # Returns: nothing on success
1700 # If @device is not a valid block device, DeviceNotFound
1704 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1709 # An enumeration that tells QEMU how to set the backing file path in
1712 # @existing: QEMU should look for an existing image file.
1714 # @absolute-paths: QEMU should create a new image with absolute paths
1715 # for the backing file.
1719 { 'enum': 'NewImageMode',
1720 'data': [ 'existing', 'absolute-paths' ] }
1725 # @device: the name of the device to generate the snapshot from.
1727 # @snapshot-file: the target of the new image. A new file will be created.
1729 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1731 # @mode: #optional whether and how QEMU should create a new image, default is
1734 { 'type': 'BlockdevSnapshot',
1735 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1736 '*mode': 'NewImageMode' } }
1739 # @BlockdevSnapshotInternal
1741 # @device: the name of the device to generate the snapshot from
1743 # @name: the name of the internal snapshot to be created
1745 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1746 # exists, the operation will fail. Only some image formats support it,
1747 # for example, qcow2, rbd, and sheepdog.
1751 { 'type': 'BlockdevSnapshotInternal',
1752 'data': { 'device': 'str', 'name': 'str' } }
1757 # @device: the name of the device which should be copied.
1759 # @target: the target of the new image. If the file exists, or if it
1760 # is a device, the existing file/device will be used as the new
1761 # destination. If it does not exist, a new file will be created.
1763 # @format: #optional the format of the new destination, default is to
1764 # probe if @mode is 'existing', else the format of the source
1766 # @sync: what parts of the disk image should be copied to the destination
1767 # (all the disk, only the sectors allocated in the topmost image, or
1770 # @mode: #optional whether and how QEMU should create a new image, default is
1773 # @speed: #optional the maximum speed, in bytes per second
1775 # @on-source-error: #optional the action to take on an error on the source,
1776 # default 'report'. 'stop' and 'enospc' can only be used
1777 # if the block device supports io-status (see BlockInfo).
1779 # @on-target-error: #optional the action to take on an error on the target,
1780 # default 'report' (no limitations, since this applies to
1781 # a different block device than @device).
1783 # Note that @on-source-error and @on-target-error only affect background I/O.
1784 # If an error occurs during a guest write request, the device's rerror/werror
1785 # actions will be used.
1789 { 'type': 'DriveBackup',
1790 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1791 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1793 '*on-source-error': 'BlockdevOnError',
1794 '*on-target-error': 'BlockdevOnError' } }
1799 # This action can be used to test transaction failure.
1807 # @TransactionAction
1809 # A discriminated record of operations that can be performed with
1812 { 'union': 'TransactionAction',
1814 'blockdev-snapshot-sync': 'BlockdevSnapshot',
1815 'drive-backup': 'DriveBackup',
1817 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1823 # Executes a number of transactionable QMP commands atomically. If any
1824 # operation fails, then the entire set of actions will be abandoned and the
1825 # appropriate error returned.
1828 # @TransactionAction: information needed for the respective operation
1830 # Returns: nothing on success
1831 # Errors depend on the operations of the transaction
1833 # Note: The transaction aborts on the first failure. Therefore, there will be
1834 # information on only one failed operation returned in an error condition, and
1835 # subsequent actions will not have been attempted.
1839 { 'command': 'transaction',
1840 'data': { 'actions': [ 'TransactionAction' ] } }
1843 # @blockdev-snapshot-sync
1845 # Generates a synchronous snapshot of a block device.
1847 # For the arguments, see the documentation of BlockdevSnapshot.
1849 # Returns: nothing on success
1850 # If @device is not a valid block device, DeviceNotFound
1854 { 'command': 'blockdev-snapshot-sync',
1855 'data': 'BlockdevSnapshot' }
1858 # @blockdev-snapshot-internal-sync
1860 # Synchronously take an internal snapshot of a block device, when the format
1861 # of the image used supports it.
1863 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1865 # Returns: nothing on success
1866 # If @device is not a valid block device, DeviceNotFound
1867 # If any snapshot matching @name exists, or @name is empty,
1869 # If the format of the image used does not support it,
1870 # BlockFormatFeatureNotSupported
1874 { 'command': 'blockdev-snapshot-internal-sync',
1875 'data': 'BlockdevSnapshotInternal' }
1878 # @blockdev-snapshot-delete-internal-sync
1880 # Synchronously delete an internal snapshot of a block device, when the format
1881 # of the image used support it. The snapshot is identified by name or id or
1882 # both. One of the name or id is required. Return SnapshotInfo for the
1883 # successfully deleted snapshot.
1885 # @device: the name of the device to delete the snapshot from
1887 # @id: optional the snapshot's ID to be deleted
1889 # @name: optional the snapshot's name to be deleted
1891 # Returns: SnapshotInfo on success
1892 # If @device is not a valid block device, DeviceNotFound
1893 # If snapshot not found, GenericError
1894 # If the format of the image used does not support it,
1895 # BlockFormatFeatureNotSupported
1896 # If @id and @name are both not specified, GenericError
1900 { 'command': 'blockdev-snapshot-delete-internal-sync',
1901 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
1902 'returns': 'SnapshotInfo' }
1905 # @human-monitor-command:
1907 # Execute a command on the human monitor and return the output.
1909 # @command-line: the command to execute in the human monitor
1911 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1913 # Returns: the output of the command as a string
1917 # Notes: This command only exists as a stop-gap. It's use is highly
1918 # discouraged. The semantics of this command are not guaranteed.
1920 # Known limitations:
1922 # o This command is stateless, this means that commands that depend
1923 # on state information (such as getfd) might not work
1925 # o Commands that prompt the user for data (eg. 'cont' when the block
1926 # device is encrypted) don't currently work
1928 { 'command': 'human-monitor-command',
1929 'data': {'command-line': 'str', '*cpu-index': 'int'},
1935 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1936 # writes data between 'top' and 'base' into 'base'.
1938 # @device: the name of the device
1940 # @base: #optional The file name of the backing image to write data into.
1941 # If not specified, this is the deepest backing image
1943 # @top: The file name of the backing image within the image chain,
1944 # which contains the topmost data to be committed down.
1945 # Note, the active layer as 'top' is currently unsupported.
1947 # If top == base, that is an error.
1950 # @speed: #optional the maximum speed, in bytes per second
1952 # Returns: Nothing on success
1953 # If commit or stream is already active on this device, DeviceInUse
1954 # If @device does not exist, DeviceNotFound
1955 # If image commit is not supported by this device, NotSupported
1956 # If @base or @top is invalid, a generic error is returned
1957 # If @top is the active layer, or omitted, a generic error is returned
1958 # If @speed is invalid, InvalidParameter
1963 { 'command': 'block-commit',
1964 'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1970 # Start a point-in-time copy of a block device to a new destination. The
1971 # status of ongoing drive-backup operations can be checked with
1972 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1973 # The operation can be stopped before it has completed using the
1974 # block-job-cancel command.
1976 # For the arguments, see the documentation of DriveBackup.
1978 # Returns: nothing on success
1979 # If @device is not a valid block device, DeviceNotFound
1983 { 'command': 'drive-backup', 'data': 'DriveBackup' }
1988 # Start mirroring a block device's writes to a new destination.
1990 # @device: the name of the device whose writes should be mirrored.
1992 # @target: the target of the new image. If the file exists, or if it
1993 # is a device, the existing file/device will be used as the new
1994 # destination. If it does not exist, a new file will be created.
1996 # @format: #optional the format of the new destination, default is to
1997 # probe if @mode is 'existing', else the format of the source
1999 # @mode: #optional whether and how QEMU should create a new image, default is
2002 # @speed: #optional the maximum speed, in bytes per second
2004 # @sync: what parts of the disk image should be copied to the destination
2005 # (all the disk, only the sectors allocated in the topmost image, or
2008 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2009 # if the image format doesn't have clusters, 4K if the clusters
2010 # are smaller than that, else the cluster size. Must be a
2011 # power of 2 between 512 and 64M (since 1.4).
2013 # @buf-size: #optional maximum amount of data in flight from source to
2014 # target (since 1.4).
2016 # @on-source-error: #optional the action to take on an error on the source,
2017 # default 'report'. 'stop' and 'enospc' can only be used
2018 # if the block device supports io-status (see BlockInfo).
2020 # @on-target-error: #optional the action to take on an error on the target,
2021 # default 'report' (no limitations, since this applies to
2022 # a different block device than @device).
2024 # Returns: nothing on success
2025 # If @device is not a valid block device, DeviceNotFound
2029 { 'command': 'drive-mirror',
2030 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2031 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2032 '*speed': 'int', '*granularity': 'uint32',
2033 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2034 '*on-target-error': 'BlockdevOnError' } }
2039 # Cancel the current executing migration process.
2041 # Returns: nothing on success
2043 # Notes: This command succeeds even if there is no migration process running.
2047 { 'command': 'migrate_cancel' }
2050 # @migrate_set_downtime
2052 # Set maximum tolerated downtime for migration.
2054 # @value: maximum downtime in seconds
2056 # Returns: nothing on success
2060 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2063 # @migrate_set_speed
2065 # Set maximum speed for migration.
2067 # @value: maximum speed in bytes.
2069 # Returns: nothing on success
2071 # Notes: A value lesser than zero will be automatically round up to zero.
2075 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2078 # @migrate-set-cache-size
2080 # Set XBZRLE cache size
2082 # @value: cache size in bytes
2084 # The size will be rounded down to the nearest power of 2.
2085 # The cache size can be modified before and during ongoing migration
2087 # Returns: nothing on success
2091 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2094 # @query-migrate-cache-size
2096 # query XBZRLE cache size
2098 # Returns: XBZRLE cache size in bytes
2102 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2105 # @ObjectPropertyInfo:
2107 # @name: the name of the property
2109 # @type: the type of the property. This will typically come in one of four
2112 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2113 # These types are mapped to the appropriate JSON type.
2115 # 2) A legacy type in the form 'legacy<subtype>' where subtype is the
2116 # legacy qdev typename. These types are always treated as strings.
2118 # 3) A child type in the form 'child<subtype>' where subtype is a qdev
2119 # device type name. Child properties create the composition tree.
2121 # 4) A link type in the form 'link<subtype>' where subtype is a qdev
2122 # device type name. Link properties form the device model graph.
2126 { 'type': 'ObjectPropertyInfo',
2127 'data': { 'name': 'str', 'type': 'str' } }
2132 # This command will list any properties of a object given a path in the object
2135 # @path: the path within the object model. See @qom-get for a description of
2138 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2143 { 'command': 'qom-list',
2144 'data': { 'path': 'str' },
2145 'returns': [ 'ObjectPropertyInfo' ] }
2150 # This command will get a property from a object model path and return the
2153 # @path: The path within the object model. There are two forms of supported
2154 # paths--absolute and partial paths.
2156 # Absolute paths are derived from the root object and can follow child<>
2157 # or link<> properties. Since they can follow link<> properties, they
2158 # can be arbitrarily long. Absolute paths look like absolute filenames
2159 # and are prefixed with a leading slash.
2161 # Partial paths look like relative filenames. They do not begin
2162 # with a prefix. The matching rules for partial paths are subtle but
2163 # designed to make specifying objects easy. At each level of the
2164 # composition tree, the partial path is matched as an absolute path.
2165 # The first match is not returned. At least two matches are searched
2166 # for. A successful result is only returned if only one match is
2167 # found. If more than one match is found, a flag is return to
2168 # indicate that the match was ambiguous.
2170 # @property: The property name to read
2172 # Returns: The property value. The type depends on the property type. legacy<>
2173 # properties are returned as #str. child<> and link<> properties are
2174 # returns as #str pathnames. All integer property types (u8, u16, etc)
2175 # are returned as #int.
2179 { 'command': 'qom-get',
2180 'data': { 'path': 'str', 'property': 'str' },
2181 'returns': 'visitor',
2187 # This command will set a property from a object model path.
2189 # @path: see @qom-get for a description of this parameter
2191 # @property: the property name to set
2193 # @value: a value who's type is appropriate for the property type. See @qom-get
2194 # for a description of type mapping.
2198 { 'command': 'qom-set',
2199 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2205 # Sets the password of a remote display session.
2207 # @protocol: `vnc' to modify the VNC server password
2208 # `spice' to modify the Spice server password
2210 # @password: the new password
2212 # @connected: #optional how to handle existing clients when changing the
2213 # password. If nothing is specified, defaults to `keep'
2214 # `fail' to fail the command if clients are connected
2215 # `disconnect' to disconnect existing clients
2216 # `keep' to maintain existing clients
2218 # Returns: Nothing on success
2219 # If Spice is not enabled, DeviceNotFound
2223 { 'command': 'set_password',
2224 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2229 # Expire the password of a remote display server.
2231 # @protocol: the name of the remote display protocol `vnc' or `spice'
2233 # @time: when to expire the password.
2234 # `now' to expire the password immediately
2235 # `never' to cancel password expiration
2236 # `+INT' where INT is the number of seconds from now (integer)
2237 # `INT' where INT is the absolute time in seconds
2239 # Returns: Nothing on success
2240 # If @protocol is `spice' and Spice is not active, DeviceNotFound
2244 # Notes: Time is relative to the server and currently there is no way to
2245 # coordinate server time with client time. It is not recommended to
2246 # use the absolute time version of the @time parameter unless you're
2247 # sure you are on the same machine as the QEMU instance.
2249 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2254 # Ejects a device from a removable drive.
2256 # @device: The name of the device
2258 # @force: @optional If true, eject regardless of whether the drive is locked.
2259 # If not specified, the default value is false.
2261 # Returns: Nothing on success
2262 # If @device is not a valid block device, DeviceNotFound
2264 # Notes: Ejecting a device will no media results in success
2268 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2271 # @change-vnc-password:
2273 # Change the VNC server password.
2275 # @target: the new password to use with VNC authentication
2279 # Notes: An empty password in this command will set the password to the empty
2280 # string. Existing clients are unaffected by executing this command.
2282 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2287 # This command is multiple commands multiplexed together.
2289 # @device: This is normally the name of a block device but it may also be 'vnc'.
2290 # when it's 'vnc', then sub command depends on @target
2292 # @target: If @device is a block device, then this is the new filename.
2293 # If @device is 'vnc', then if the value 'password' selects the vnc
2294 # change password command. Otherwise, this specifies a new server URI
2295 # address to listen to for VNC connections.
2297 # @arg: If @device is a block device, then this is an optional format to open
2299 # If @device is 'vnc' and @target is 'password', this is the new VNC
2300 # password to set. If this argument is an empty string, then no future
2301 # logins will be allowed.
2303 # Returns: Nothing on success.
2304 # If @device is not a valid block device, DeviceNotFound
2305 # If the new block device is encrypted, DeviceEncrypted. Note that
2306 # if this error is returned, the device has been opened successfully
2307 # and an additional call to @block_passwd is required to set the
2308 # device's password. The behavior of reads and writes to the block
2309 # device between when these calls are executed is undefined.
2311 # Notes: It is strongly recommended that this interface is not used especially
2312 # for changing block devices.
2316 { 'command': 'change',
2317 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2320 # @block_set_io_throttle:
2322 # Change I/O throttle limits for a block drive.
2324 # @device: The name of the device
2326 # @bps: total throughput limit in bytes per second
2328 # @bps_rd: read throughput limit in bytes per second
2330 # @bps_wr: write throughput limit in bytes per second
2332 # @iops: total I/O operations per second
2334 # @ops_rd: read I/O operations per second
2336 # @iops_wr: write I/O operations per second
2338 # @bps_max: #optional total max in bytes (Since 1.7)
2340 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2342 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2344 # @iops_max: #optional total I/O operations max (Since 1.7)
2346 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2348 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2350 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2352 # Returns: Nothing on success
2353 # If @device is not a valid block device, DeviceNotFound
2357 { 'command': 'block_set_io_throttle',
2358 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2359 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2360 '*bps_max': 'int', '*bps_rd_max': 'int',
2361 '*bps_wr_max': 'int', '*iops_max': 'int',
2362 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2363 '*iops_size': 'int' } }
2368 # Copy data from a backing file into a block device.
2370 # The block streaming operation is performed in the background until the entire
2371 # backing file has been copied. This command returns immediately once streaming
2372 # has started. The status of ongoing block streaming operations can be checked
2373 # with query-block-jobs. The operation can be stopped before it has completed
2374 # using the block-job-cancel command.
2376 # If a base file is specified then sectors are not copied from that base file and
2377 # its backing chain. When streaming completes the image file will have the base
2378 # file as its backing file. This can be used to stream a subset of the backing
2379 # file chain instead of flattening the entire image.
2381 # On successful completion the image file is updated to drop the backing file
2382 # and the BLOCK_JOB_COMPLETED event is emitted.
2384 # @device: the device name
2386 # @base: #optional the common backing file name
2388 # @speed: #optional the maximum speed, in bytes per second
2390 # @on-error: #optional the action to take on an error (default report).
2391 # 'stop' and 'enospc' can only be used if the block device
2392 # supports io-status (see BlockInfo). Since 1.3.
2394 # Returns: Nothing on success
2395 # If @device does not exist, DeviceNotFound
2399 { 'command': 'block-stream',
2400 'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2401 '*on-error': 'BlockdevOnError' } }
2404 # @block-job-set-speed:
2406 # Set maximum speed for a background block operation.
2408 # This command can only be issued when there is an active block job.
2410 # Throttling can be disabled by setting the speed to 0.
2412 # @device: the device name
2414 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2417 # Returns: Nothing on success
2418 # If no background operation is active on this device, DeviceNotActive
2422 { 'command': 'block-job-set-speed',
2423 'data': { 'device': 'str', 'speed': 'int' } }
2426 # @block-job-cancel:
2428 # Stop an active background block operation.
2430 # This command returns immediately after marking the active background block
2431 # operation for cancellation. It is an error to call this command if no
2432 # operation is in progress.
2434 # The operation will cancel as soon as possible and then emit the
2435 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2436 # enumerated using query-block-jobs.
2438 # For streaming, the image file retains its backing file unless the streaming
2439 # operation happens to complete just as it is being cancelled. A new streaming
2440 # operation can be started at a later time to finish copying all data from the
2443 # @device: the device name
2445 # @force: #optional whether to allow cancellation of a paused job (default
2446 # false). Since 1.3.
2448 # Returns: Nothing on success
2449 # If no background operation is active on this device, DeviceNotActive
2453 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2458 # Pause an active background block operation.
2460 # This command returns immediately after marking the active background block
2461 # operation for pausing. It is an error to call this command if no
2462 # operation is in progress. Pausing an already paused job has no cumulative
2463 # effect; a single block-job-resume command will resume the job.
2465 # The operation will pause as soon as possible. No event is emitted when
2466 # the operation is actually paused. Cancelling a paused job automatically
2469 # @device: the device name
2471 # Returns: Nothing on success
2472 # If no background operation is active on this device, DeviceNotActive
2476 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2479 # @block-job-resume:
2481 # Resume an active background block operation.
2483 # This command returns immediately after resuming a paused background block
2484 # operation. It is an error to call this command if no operation is in
2485 # progress. Resuming an already running job is not an error.
2487 # This command also clears the error status of the job.
2489 # @device: the device name
2491 # Returns: Nothing on success
2492 # If no background operation is active on this device, DeviceNotActive
2496 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2499 # @block-job-complete:
2501 # Manually trigger completion of an active background block operation. This
2502 # is supported for drive mirroring, where it also switches the device to
2503 # write to the target path only. The ability to complete is signaled with
2504 # a BLOCK_JOB_READY event.
2506 # This command completes an active background block operation synchronously.
2507 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2508 # is not defined. Note that if an I/O error occurs during the processing of
2509 # this command: 1) the command itself will fail; 2) the error will be processed
2510 # according to the rerror/werror arguments that were specified when starting
2513 # A cancelled or paused job cannot be completed.
2515 # @device: the device name
2517 # Returns: Nothing on success
2518 # If no background operation is active on this device, DeviceNotActive
2522 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2527 # This structure describes a search result from @qom-list-types
2529 # @name: the type name found in the search
2533 # Notes: This command is experimental and may change syntax in future releases.
2535 { 'type': 'ObjectTypeInfo',
2536 'data': { 'name': 'str' } }
2541 # This command will return a list of types given search parameters
2543 # @implements: if specified, only return types that implement this type name
2545 # @abstract: if true, include abstract types in the results
2547 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2551 { 'command': 'qom-list-types',
2552 'data': { '*implements': 'str', '*abstract': 'bool' },
2553 'returns': [ 'ObjectTypeInfo' ] }
2556 # @DevicePropertyInfo:
2558 # Information about device properties.
2560 # @name: the name of the property
2561 # @type: the typename of the property
2565 { 'type': 'DevicePropertyInfo',
2566 'data': { 'name': 'str', 'type': 'str' } }
2569 # @device-list-properties:
2571 # List properties associated with a device.
2573 # @typename: the type name of a device
2575 # Returns: a list of DevicePropertyInfo describing a devices properties
2579 { 'command': 'device-list-properties',
2580 'data': { 'typename': 'str'},
2581 'returns': [ 'DevicePropertyInfo' ] }
2586 # Migrates the current running guest to another Virtual Machine.
2588 # @uri: the Uniform Resource Identifier of the destination VM
2590 # @blk: #optional do block migration (full disk copy)
2592 # @inc: #optional incremental disk copy migration
2594 # @detach: this argument exists only for compatibility reasons and
2595 # is ignored by QEMU
2597 # Returns: nothing on success
2601 { 'command': 'migrate',
2602 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2604 # @xen-save-devices-state:
2606 # Save the state of all devices to file. The RAM and the block devices
2607 # of the VM are not saved by this command.
2609 # @filename: the file to save the state of the devices to as binary
2610 # data. See xen-save-devices-state.txt for a description of the binary
2613 # Returns: Nothing on success
2617 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2620 # @xen-set-global-dirty-log
2622 # Enable or disable the global dirty log mode.
2624 # @enable: true to enable, false to disable.
2630 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2635 # Remove a device from a guest
2637 # @id: the name of the device
2639 # Returns: Nothing on success
2640 # If @id is not a valid device, DeviceNotFound
2642 # Notes: When this command completes, the device may not be removed from the
2643 # guest. Hot removal is an operation that requires guest cooperation.
2644 # This command merely requests that the guest begin the hot removal
2645 # process. Completion of the device removal process is signaled with a
2646 # DEVICE_DELETED event. Guest reset will automatically complete removal
2651 { 'command': 'device_del', 'data': {'id': 'str'} }
2654 # @dump-guest-memory
2656 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2657 # very long depending on the amount of guest memory. This command is only
2658 # supported on i386 and x86_64.
2660 # @paging: if true, do paging to get guest's memory mapping. This allows
2661 # using gdb to process the core file.
2663 # IMPORTANT: this option can make QEMU allocate several gigabytes
2664 # of RAM. This can happen for a large guest, or a
2665 # malicious guest pretending to be large.
2667 # Also, paging=true has the following limitations:
2669 # 1. The guest may be in a catastrophic state or can have corrupted
2670 # memory, which cannot be trusted
2671 # 2. The guest can be in real-mode even if paging is enabled. For
2672 # example, the guest uses ACPI to sleep, and ACPI sleep state
2675 # @protocol: the filename or file descriptor of the vmcore. The supported
2678 # 1. file: the protocol starts with "file:", and the following
2679 # string is the file's path.
2680 # 2. fd: the protocol starts with "fd:", and the following string
2683 # @begin: #optional if specified, the starting physical address.
2685 # @length: #optional if specified, the memory size, in bytes. If you don't
2686 # want to dump all guest's memory, please specify the start @begin
2689 # Returns: nothing on success
2693 { 'command': 'dump-guest-memory',
2694 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2695 '*length': 'int' } }
2700 # Add a network backend.
2702 # @type: the type of network backend. Current valid values are 'user', 'tap',
2703 # 'vde', 'socket', 'dump' and 'bridge'
2705 # @id: the name of the new network backend
2707 # @props: #optional a list of properties to be passed to the backend in
2708 # the format 'name=value', like 'ifname=tap0,script=no'
2710 # Notes: The semantics of @props is not well defined. Future commands will be
2711 # introduced that provide stronger typing for backend creation.
2715 # Returns: Nothing on success
2716 # If @type is not a valid network backend, DeviceNotFound
2718 { 'command': 'netdev_add',
2719 'data': {'type': 'str', 'id': 'str', '*props': '**'},
2725 # Remove a network backend.
2727 # @id: the name of the network backend to remove
2729 # Returns: Nothing on success
2730 # If @id is not a valid network backend, DeviceNotFound
2734 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2737 # @NetdevNoneOptions
2739 # Use it alone to have zero network devices.
2743 { 'type': 'NetdevNoneOptions',
2747 # @NetLegacyNicOptions
2749 # Create a new Network Interface Card.
2751 # @netdev: #optional id of -netdev to connect to
2753 # @macaddr: #optional MAC address
2755 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2757 # @addr: #optional PCI device address
2759 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2763 { 'type': 'NetLegacyNicOptions',
2769 '*vectors': 'uint32' } }
2774 # A fat type wrapping 'str', to be embedded in lists.
2783 # @NetdevUserOptions
2785 # Use the user mode network stack which requires no administrator privilege to
2788 # @hostname: #optional client hostname reported by the builtin DHCP server
2790 # @restrict: #optional isolate the guest from the host
2792 # @ip: #optional legacy parameter, use net= instead
2794 # @net: #optional IP address and optional netmask
2796 # @host: #optional guest-visible address of the host
2798 # @tftp: #optional root directory of the built-in TFTP server
2800 # @bootfile: #optional BOOTP filename, for use with tftp=
2802 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2805 # @dns: #optional guest-visible address of the virtual nameserver
2807 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2810 # @smb: #optional root directory of the built-in SMB server
2812 # @smbserver: #optional IP address of the built-in SMB server
2814 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2817 # @guestfwd: #optional forward guest TCP connections
2821 { 'type': 'NetdevUserOptions',
2824 '*restrict': 'bool',
2830 '*dhcpstart': 'str',
2832 '*dnssearch': ['String'],
2834 '*smbserver': 'str',
2835 '*hostfwd': ['String'],
2836 '*guestfwd': ['String'] } }
2841 # Connect the host TAP network interface name to the VLAN.
2843 # @ifname: #optional interface name
2845 # @fd: #optional file descriptor of an already opened tap
2847 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2850 # @script: #optional script to initialize the interface
2852 # @downscript: #optional script to shut down the interface
2854 # @helper: #optional command to execute to configure bridge
2856 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2858 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2860 # @vhost: #optional enable vhost-net network accelerator
2862 # @vhostfd: #optional file descriptor of an already opened vhost net device
2864 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2867 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2869 # @queues: #optional number of queues to be created for multiqueue capable tap
2873 { 'type': 'NetdevTapOptions',
2879 '*downscript': 'str',
2882 '*vnet_hdr': 'bool',
2886 '*vhostforce': 'bool',
2887 '*queues': 'uint32'} }
2890 # @NetdevSocketOptions
2892 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2893 # socket connection.
2895 # @fd: #optional file descriptor of an already opened socket
2897 # @listen: #optional port number, and optional hostname, to listen on
2899 # @connect: #optional port number, and optional hostname, to connect to
2901 # @mcast: #optional UDP multicast address and port number
2903 # @localaddr: #optional source address and port for multicast and udp packets
2905 # @udp: #optional UDP unicast address and port number
2909 { 'type': 'NetdevSocketOptions',
2915 '*localaddr': 'str',
2921 # Connect the VLAN to a vde switch running on the host.
2923 # @sock: #optional socket path
2925 # @port: #optional port number
2927 # @group: #optional group owner of socket
2929 # @mode: #optional permissions for socket
2933 { 'type': 'NetdevVdeOptions',
2938 '*mode': 'uint16' } }
2941 # @NetdevDumpOptions
2943 # Dump VLAN network traffic to a file.
2945 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2948 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2952 { 'type': 'NetdevDumpOptions',
2958 # @NetdevBridgeOptions
2960 # Connect a host TAP network interface to a host bridge device.
2962 # @br: #optional bridge name
2964 # @helper: #optional command to execute to configure bridge
2968 { 'type': 'NetdevBridgeOptions',
2971 '*helper': 'str' } }
2974 # @NetdevHubPortOptions
2976 # Connect two or more net clients through a software hub.
2978 # @hubid: hub identifier number
2982 { 'type': 'NetdevHubPortOptions',
2984 'hubid': 'int32' } }
2989 # A discriminated record of network device traits.
2993 { 'union': 'NetClientOptions',
2995 'none': 'NetdevNoneOptions',
2996 'nic': 'NetLegacyNicOptions',
2997 'user': 'NetdevUserOptions',
2998 'tap': 'NetdevTapOptions',
2999 'socket': 'NetdevSocketOptions',
3000 'vde': 'NetdevVdeOptions',
3001 'dump': 'NetdevDumpOptions',
3002 'bridge': 'NetdevBridgeOptions',
3003 'hubport': 'NetdevHubPortOptions' } }
3008 # Captures the configuration of a network device; legacy.
3010 # @vlan: #optional vlan number
3012 # @id: #optional identifier for monitor commands
3014 # @name: #optional identifier for monitor commands, ignored if @id is present
3016 # @opts: device type specific properties (legacy)
3020 { 'type': 'NetLegacy',
3025 'opts': 'NetClientOptions' } }
3030 # Captures the configuration of a network device.
3032 # @id: identifier for monitor commands.
3034 # @opts: device type specific properties
3041 'opts': 'NetClientOptions' } }
3044 # @InetSocketAddress
3046 # Captures a socket address or address range in the Internet namespace.
3048 # @host: host part of the address
3050 # @port: port part of the address, or lowest port if @to is present
3052 # @to: highest port to try
3054 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3057 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3062 { 'type': 'InetSocketAddress',
3071 # @UnixSocketAddress
3073 # Captures a socket address in the local ("Unix socket") namespace.
3075 # @path: filesystem path to use
3079 { 'type': 'UnixSocketAddress',
3086 # Captures the address of a socket, which could also be a named file descriptor
3090 { 'union': 'SocketAddress',
3092 'inet': 'InetSocketAddress',
3093 'unix': 'UnixSocketAddress',
3099 # Receive a file descriptor via SCM rights and assign it a name
3101 # @fdname: file descriptor name
3103 # Returns: Nothing on success
3107 # Notes: If @fdname already exists, the file descriptor assigned to
3108 # it will be closed and replaced by the received file
3110 # The 'closefd' command can be used to explicitly close the
3111 # file descriptor when it is no longer needed.
3113 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3118 # Close a file descriptor previously passed via SCM rights
3120 # @fdname: file descriptor name
3122 # Returns: Nothing on success
3126 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3131 # Information describing a machine.
3133 # @name: the name of the machine
3135 # @alias: #optional an alias for the machine name
3137 # @default: #optional whether the machine is default
3139 # @cpu-max: maximum number of CPUs supported by the machine type
3144 { 'type': 'MachineInfo',
3145 'data': { 'name': 'str', '*alias': 'str',
3146 '*is-default': 'bool', 'cpu-max': 'int' } }
3151 # Return a list of supported machines
3153 # Returns: a list of MachineInfo
3157 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3160 # @CpuDefinitionInfo:
3162 # Virtual CPU definition.
3164 # @name: the name of the CPU definition
3168 { 'type': 'CpuDefinitionInfo',
3169 'data': { 'name': 'str' } }
3172 # @query-cpu-definitions:
3174 # Return a list of supported virtual CPU definitions
3176 # Returns: a list of CpuDefInfo
3180 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3184 # Information about a file descriptor that was added to an fd set.
3186 # @fdset-id: The ID of the fd set that @fd was added to.
3188 # @fd: The file descriptor that was received via SCM rights and
3189 # added to the fd set.
3193 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3198 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3200 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3202 # @opaque: #optional A free-form string that can be used to describe the fd.
3204 # Returns: @AddfdInfo on success
3205 # If file descriptor was not received, FdNotSupplied
3206 # If @fdset-id is a negative value, InvalidParameterValue
3208 # Notes: The list of fd sets is shared by all monitor connections.
3210 # If @fdset-id is not specified, a new fd set will be created.
3214 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3215 'returns': 'AddfdInfo' }
3220 # Remove a file descriptor from an fd set.
3222 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3224 # @fd: #optional The file descriptor that is to be removed.
3226 # Returns: Nothing on success
3227 # If @fdset-id or @fd is not found, FdNotFound
3231 # Notes: The list of fd sets is shared by all monitor connections.
3233 # If @fd is not specified, all file descriptors in @fdset-id
3236 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3241 # Information about a file descriptor that belongs to an fd set.
3243 # @fd: The file descriptor value.
3245 # @opaque: #optional A free-form string that can be used to describe the fd.
3249 { 'type': 'FdsetFdInfo',
3250 'data': {'fd': 'int', '*opaque': 'str'} }
3255 # Information about an fd set.
3257 # @fdset-id: The ID of the fd set.
3259 # @fds: A list of file descriptors that belong to this fd set.
3263 { 'type': 'FdsetInfo',
3264 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3269 # Return information describing all fd sets.
3271 # Returns: A list of @FdsetInfo
3275 # Note: The list of fd sets is shared by all monitor connections.
3278 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3283 # Information describing the QEMU target.
3285 # @arch: the target architecture (eg "x86_64", "i386", etc)
3289 { 'type': 'TargetInfo',
3290 'data': { 'arch': 'str' } }
3295 # Return information about the target for this QEMU
3297 # Returns: TargetInfo
3301 { 'command': 'query-target', 'returns': 'TargetInfo' }
3306 # An enumeration of key name.
3308 # This is used by the send-key command.
3312 { 'enum': 'QKeyCode',
3313 'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3314 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3315 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3316 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3317 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3318 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3319 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3320 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3321 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3322 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3323 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3324 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3325 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3326 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3327 'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3332 # Represents a keyboard key.
3336 { 'union': 'KeyValue',
3339 'qcode': 'QKeyCode' } }
3344 # Send keys to guest.
3346 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3347 # simultaneously sent to the guest. A @KeyValue.number value is sent
3348 # directly to the guest, while @KeyValue.qcode must be a valid
3351 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3354 # Returns: Nothing on success
3355 # If key is unknown or redundant, InvalidParameter
3360 { 'command': 'send-key',
3361 'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3366 # Write a PPM of the VGA screen to a file.
3368 # @filename: the path of a new PPM file to store the image
3370 # Returns: Nothing on success
3374 { 'command': 'screendump', 'data': {'filename': 'str'} }
3377 # @nbd-server-start:
3379 # Start an NBD server listening on the given host and port. Block
3380 # devices can then be exported using @nbd-server-add. The NBD
3381 # server will present them as named exports; for example, another
3382 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3384 # @addr: Address on which to listen.
3386 # Returns: error if the server is already running.
3390 { 'command': 'nbd-server-start',
3391 'data': { 'addr': 'SocketAddress' } }
3396 # Export a device to QEMU's embedded NBD server.
3398 # @device: Block device to be exported
3400 # @writable: Whether clients should be able to write to the device via the
3401 # NBD connection (default false). #optional
3403 # Returns: error if the device is already marked for export.
3407 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3412 # Stop QEMU's embedded NBD server, and unregister all devices previously
3413 # added via @nbd-server-add.
3417 { 'command': 'nbd-server-stop' }
3422 # Configuration info for file chardevs.
3424 # @in: #optional The name of the input file
3425 # @out: The name of the output file
3429 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3435 # Configuration info for device and pipe chardevs.
3437 # @device: The name of the special file for the device,
3438 # i.e. /dev/ttyS0 on Unix or COM1: on Windows
3439 # @type: What kind of device this is.
3443 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3448 # Configuration info for (stream) socket chardevs.
3450 # @addr: socket address to listen on (server=true)
3451 # or connect to (server=false)
3452 # @server: #optional create server socket (default: true)
3453 # @wait: #optional wait for incoming connection on server
3454 # sockets (default: false).
3455 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3456 # @telnet: #optional enable telnet protocol on server
3457 # sockets (default: false)
3461 { 'type': 'ChardevSocket', 'data': { 'addr' : 'SocketAddress',
3464 '*nodelay' : 'bool',
3465 '*telnet' : 'bool' } }
3470 # Configuration info for datagram socket chardevs.
3472 # @remote: remote address
3473 # @local: #optional local address
3477 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3478 '*local' : 'SocketAddress' } }
3483 # Configuration info for mux chardevs.
3485 # @chardev: name of the base chardev.
3489 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3494 # Configuration info for stdio chardevs.
3496 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3497 # be delivered to qemu. Default: true in -nographic mode,
3502 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3505 # @ChardevSpiceChannel:
3507 # Configuration info for spice vm channel chardevs.
3509 # @type: kind of channel (for example vdagent).
3513 { 'type': 'ChardevSpiceChannel', 'data': { 'type' : 'str' } }
3516 # @ChardevSpicePort:
3518 # Configuration info for spice port chardevs.
3520 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3524 { 'type': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' } }
3529 # Configuration info for virtual console chardevs.
3531 # @width: console width, in pixels
3532 # @height: console height, in pixels
3533 # @cols: console width, in chars
3534 # @rows: console height, in chars
3538 { 'type': 'ChardevVC', 'data': { '*width' : 'int',
3546 # Configuration info for ring buffer chardevs.
3548 # @size: #optional ring buffer size, must be power of two, default is 65536
3552 { 'type': 'ChardevRingbuf', 'data': { '*size' : 'int' } }
3557 # Configuration info for the new chardev backend.
3561 { 'type': 'ChardevDummy', 'data': { } }
3563 { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
3564 'serial' : 'ChardevHostdev',
3565 'parallel': 'ChardevHostdev',
3566 'pipe' : 'ChardevHostdev',
3567 'socket' : 'ChardevSocket',
3568 'udp' : 'ChardevUdp',
3569 'pty' : 'ChardevDummy',
3570 'null' : 'ChardevDummy',
3571 'mux' : 'ChardevMux',
3572 'msmouse': 'ChardevDummy',
3573 'braille': 'ChardevDummy',
3574 'stdio' : 'ChardevStdio',
3575 'console': 'ChardevDummy',
3576 'spicevmc' : 'ChardevSpiceChannel',
3577 'spiceport' : 'ChardevSpicePort',
3579 'ringbuf': 'ChardevRingbuf',
3580 # next one is just for compatibility
3581 'memory' : 'ChardevRingbuf' } }
3586 # Return info about the chardev backend just created.
3588 # @pty: #optional name of the slave pseudoterminal device, present if
3589 # and only if a chardev of type 'pty' was created
3593 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3598 # Add a character device backend
3600 # @id: the chardev's ID, must be unique
3601 # @backend: backend type and parameters
3603 # Returns: ChardevReturn.
3607 { 'command': 'chardev-add', 'data': {'id' : 'str',
3608 'backend' : 'ChardevBackend' },
3609 'returns': 'ChardevReturn' }
3614 # Remove a character device backend
3616 # @id: the chardev's ID, must exist and not be in use
3618 # Returns: Nothing on success
3622 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3627 # An enumeration of TPM models
3629 # @tpm-tis: TPM TIS model
3633 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3636 # @query-tpm-models:
3638 # Return a list of supported TPM models
3640 # Returns: a list of TpmModel
3644 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3649 # An enumeration of TPM types
3651 # @passthrough: TPM passthrough type
3655 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3660 # Return a list of supported TPM types
3662 # Returns: a list of TpmType
3666 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3669 # @TPMPassthroughOptions:
3671 # Information about the TPM passthrough type
3673 # @path: #optional string describing the path used for accessing the TPM device
3675 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3676 # for cancellation of TPM commands while they are executing
3680 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3681 '*cancel-path' : 'str'} }
3686 # A union referencing different TPM backend types' configuration options
3688 # @passthrough: The configuration options for the TPM passthrough type
3692 { 'union': 'TpmTypeOptions',
3693 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3698 # Information about the TPM
3700 # @id: The Id of the TPM
3702 # @model: The TPM frontend model
3704 # @options: The TPM (backend) type configuration options
3708 { 'type': 'TPMInfo',
3709 'data': {'id': 'str',
3710 'model': 'TpmModel',
3711 'options': 'TpmTypeOptions' } }
3716 # Return information about the TPM device
3718 # Returns: @TPMInfo on success
3722 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3727 # Specify an ACPI table on the command line to load.
3729 # At most one of @file and @data can be specified. The list of files specified
3730 # by any one of them is loaded and concatenated in order. If both are omitted,
3733 # Other fields / optargs can be used to override fields of the generic ACPI
3734 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3735 # Description Table Header. If a header field is not overridden, then the
3736 # corresponding value from the concatenated blob is used (in case of @file), or
3737 # it is filled in with a hard-coded value (in case of @data).
3739 # String fields are copied into the matching ACPI member from lowest address
3740 # upwards, and silently truncated / NUL-padded to length.
3742 # @sig: #optional table signature / identifier (4 bytes)
3744 # @rev: #optional table revision number (dependent on signature, 1 byte)
3746 # @oem_id: #optional OEM identifier (6 bytes)
3748 # @oem_table_id: #optional OEM table identifier (8 bytes)
3750 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3752 # @asl_compiler_id: #optional identifier of the utility that created the table
3755 # @asl_compiler_rev: #optional revision number of the utility that created the
3758 # @file: #optional colon (:) separated list of pathnames to load and
3759 # concatenate as table data. The resultant binary blob is expected to
3760 # have an ACPI table header. At least one file is required. This field
3763 # @data: #optional colon (:) separated list of pathnames to load and
3764 # concatenate as table data. The resultant binary blob must not have an
3765 # ACPI table header. At least one file is required. This field excludes
3770 { 'type': 'AcpiTableOptions',
3775 '*oem_table_id': 'str',
3776 '*oem_rev': 'uint32',
3777 '*asl_compiler_id': 'str',
3778 '*asl_compiler_rev': 'uint32',
3783 # @CommandLineParameterType:
3785 # Possible types for an option parameter.
3787 # @string: accepts a character string
3789 # @boolean: accepts "on" or "off"
3791 # @number: accepts a number
3793 # @size: accepts a number followed by an optional suffix (K)ilo,
3794 # (M)ega, (G)iga, (T)era
3798 { 'enum': 'CommandLineParameterType',
3799 'data': ['string', 'boolean', 'number', 'size'] }
3802 # @CommandLineParameterInfo:
3804 # Details about a single parameter of a command line option.
3806 # @name: parameter name
3808 # @type: parameter @CommandLineParameterType
3810 # @help: #optional human readable text string, not suitable for parsing.
3814 { 'type': 'CommandLineParameterInfo',
3815 'data': { 'name': 'str',
3816 'type': 'CommandLineParameterType',
3820 # @CommandLineOptionInfo:
3822 # Details about a command line option, including its list of parameter details
3824 # @option: option name
3826 # @parameters: an array of @CommandLineParameterInfo
3830 { 'type': 'CommandLineOptionInfo',
3831 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3834 # @query-command-line-options:
3836 # Query command line option schema.
3838 # @option: #optional option name
3840 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3841 # @option). Returns an error if the given @option doesn't exist.
3845 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3846 'returns': ['CommandLineOptionInfo'] }
3851 # A X86 32-bit register
3855 { 'enum': 'X86CPURegister32',
3856 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3859 # @X86CPUFeatureWordInfo
3861 # Information about a X86 CPU feature word
3863 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3865 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3868 # @cpuid-register: Output register containing the feature bits
3870 # @features: value of output register, containing the feature bits
3874 { 'type': 'X86CPUFeatureWordInfo',
3875 'data': { 'cpuid-input-eax': 'int',
3876 '*cpuid-input-ecx': 'int',
3877 'cpuid-register': 'X86CPURegister32',
3878 'features': 'int' } }
3883 # Packets receiving state
3885 # @normal: filter assigned packets according to the mac-table
3887 # @none: don't receive any assigned packet
3889 # @all: receive all assigned packets
3893 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
3898 # Rx-filter information for a NIC.
3900 # @name: net client name
3902 # @promiscuous: whether promiscuous mode is enabled
3904 # @multicast: multicast receive state
3906 # @unicast: unicast receive state
3908 # @broadcast-allowed: whether to receive broadcast
3910 # @multicast-overflow: multicast table is overflowed or not
3912 # @unicast-overflow: unicast table is overflowed or not
3914 # @main-mac: the main macaddr string
3916 # @vlan-table: a list of active vlan id
3918 # @unicast-table: a list of unicast macaddr string
3920 # @multicast-table: a list of multicast macaddr string
3925 { 'type': 'RxFilterInfo',
3928 'promiscuous': 'bool',
3929 'multicast': 'RxState',
3930 'unicast': 'RxState',
3931 'broadcast-allowed': 'bool',
3932 'multicast-overflow': 'bool',
3933 'unicast-overflow': 'bool',
3935 'vlan-table': ['int'],
3936 'unicast-table': ['str'],
3937 'multicast-table': ['str'] }}
3942 # Return rx-filter information for all NICs (or for the given NIC).
3944 # @name: #optional net client name
3946 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
3947 # Returns an error if the given @name doesn't exist, or given
3948 # NIC doesn't support rx-filter querying, or given net client
3953 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
3954 'returns': ['RxFilterInfo'] }
3958 # @BlockdevDiscardOptions
3960 # Determines how to handle discard requests.
3962 # @ignore: Ignore the request
3963 # @unmap: Forward as an unmap request
3967 { 'enum': 'BlockdevDiscardOptions',
3968 'data': [ 'ignore', 'unmap' ] }
3971 # @BlockdevAioOptions
3973 # Selects the AIO backend to handle I/O requests
3975 # @threads: Use qemu's thread pool
3976 # @native: Use native AIO backend (only Linux and Windows)
3980 { 'enum': 'BlockdevAioOptions',
3981 'data': [ 'threads', 'native' ] }
3984 # @BlockdevCacheOptions
3986 # Includes cache-related options for block devices
3988 # @writeback: #optional enables writeback mode for any caches (default: true)
3989 # @direct: #optional enables use of O_DIRECT (bypass the host page cache;
3991 # @no-flush: #optional ignore any flush requests for the device (default:
3996 { 'type': 'BlockdevCacheOptions',
3997 'data': { '*writeback': 'bool',
3999 '*no-flush': 'bool' } }
4002 # @BlockdevOptionsBase
4004 # Options that are available for all block devices, independent of the block
4007 # @driver: block driver name
4008 # @id: #optional id by which the new block device can be referred to.
4009 # This is a required option on the top level of blockdev-add, and
4010 # currently not allowed on any other level.
4011 # @discard: #optional discard-related options (default: ignore)
4012 # @cache: #optional cache-related options
4013 # @aio: #optional AIO backend (default: threads)
4014 # @rerror: #optional how to handle read errors on the device
4016 # @werror: #optional how to handle write errors on the device
4018 # @read-only: #optional whether the block device should be read-only
4023 { 'type': 'BlockdevOptionsBase',
4024 'data': { 'driver': 'str',
4026 '*discard': 'BlockdevDiscardOptions',
4027 '*cache': 'BlockdevCacheOptions',
4028 '*aio': 'BlockdevAioOptions',
4029 '*rerror': 'BlockdevOnError',
4030 '*werror': 'BlockdevOnError',
4031 '*read-only': 'bool' } }
4034 # @BlockdevOptionsFile
4036 # Driver specific block device options for the file backend and similar
4039 # @filename: path to the image file
4043 { 'type': 'BlockdevOptionsFile',
4044 'data': { 'filename': 'str' } }
4047 # @BlockdevOptionsVVFAT
4049 # Driver specific block device options for the vvfat protocol.
4051 # @dir: directory to be exported as FAT image
4052 # @fat-type: #optional FAT type: 12, 16 or 32
4053 # @floppy: #optional whether to export a floppy image (true) or
4054 # partitioned hard disk (false; default)
4055 # @rw: #optional whether to allow write operations (default: false)
4059 { 'type': 'BlockdevOptionsVVFAT',
4060 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4064 # @BlockdevOptionsGenericFormat
4066 # Driver specific block device options for image format that have no option
4067 # besides their data source.
4069 # @file: reference to or definition of the data source block device
4073 { 'type': 'BlockdevOptionsGenericFormat',
4074 'data': { 'file': 'BlockdevRef' } }
4077 # @BlockdevOptionsGenericCOWFormat
4079 # Driver specific block device options for image format that have no option
4080 # besides their data source and an optional backing file.
4082 # @backing: #optional reference to or definition of the backing file block
4083 # device (if missing, taken from the image file content). It is
4084 # allowed to pass an empty string here in order to disable the
4085 # default backing file.
4089 { 'type': 'BlockdevOptionsGenericCOWFormat',
4090 'base': 'BlockdevOptionsGenericFormat',
4091 'data': { '*backing': 'BlockdevRef' } }
4094 # @BlockdevOptionsQcow2
4096 # Driver specific block device options for qcow2.
4098 # @lazy-refcounts: #optional whether to enable the lazy refcounts
4099 # feature (default is taken from the image file)
4101 # @pass-discard-request: #optional whether discard requests to the qcow2
4102 # device should be forwarded to the data source
4104 # @pass-discard-snapshot: #optional whether discard requests for the data source
4105 # should be issued when a snapshot operation (e.g.
4106 # deleting a snapshot) frees clusters in the qcow2 file
4108 # @pass-discard-other: #optional whether discard requests for the data source
4109 # should be issued on other occasions where a cluster
4114 { 'type': 'BlockdevOptionsQcow2',
4115 'base': 'BlockdevOptionsGenericCOWFormat',
4116 'data': { '*lazy-refcounts': 'bool',
4117 '*pass-discard-request': 'bool',
4118 '*pass-discard-snapshot': 'bool',
4119 '*pass-discard-other': 'bool' } }
4124 # Options for creating a block device.
4128 { 'union': 'BlockdevOptions',
4129 'base': 'BlockdevOptionsBase',
4130 'discriminator': 'driver',
4132 'file': 'BlockdevOptionsFile',
4133 'http': 'BlockdevOptionsFile',
4134 'https': 'BlockdevOptionsFile',
4135 'ftp': 'BlockdevOptionsFile',
4136 'ftps': 'BlockdevOptionsFile',
4137 'tftp': 'BlockdevOptionsFile',
4138 # TODO gluster: Wait for structured options
4139 # TODO iscsi: Wait for structured options
4140 # TODO nbd: Should take InetSocketAddress for 'host'?
4141 # TODO rbd: Wait for structured options
4142 # TODO sheepdog: Wait for structured options
4143 # TODO ssh: Should take InetSocketAddress for 'host'?
4144 'vvfat': 'BlockdevOptionsVVFAT',
4146 # TODO blkdebug: Wait for structured options
4147 # TODO blkverify: Wait for structured options
4149 'bochs': 'BlockdevOptionsGenericFormat',
4150 'cloop': 'BlockdevOptionsGenericFormat',
4151 'cow': 'BlockdevOptionsGenericCOWFormat',
4152 'dmg': 'BlockdevOptionsGenericFormat',
4153 'parallels': 'BlockdevOptionsGenericFormat',
4154 'qcow': 'BlockdevOptionsGenericCOWFormat',
4155 'qcow2': 'BlockdevOptionsQcow2',
4156 'qed': 'BlockdevOptionsGenericCOWFormat',
4157 'raw': 'BlockdevOptionsGenericFormat',
4158 'vdi': 'BlockdevOptionsGenericFormat',
4159 'vhdx': 'BlockdevOptionsGenericFormat',
4160 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4161 'vpc': 'BlockdevOptionsGenericFormat'
4167 # Reference to a block device.
4169 # @definition: defines a new block device inline
4170 # @reference: references the ID of an existing block device. An
4171 # empty string means that no block device should be
4176 { 'union': 'BlockdevRef',
4177 'discriminator': {},
4178 'data': { 'definition': 'BlockdevOptions',
4179 'reference': 'str' } }
4184 # Creates a new block device.
4186 # @options: block device options for the new device
4190 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }