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 # @compressed: #optional true if the image is compressed (Since 1.7)
261 # @backing-filename: #optional name of the backing file
263 # @full-backing-filename: #optional full path of the backing file
265 # @backing-filename-format: #optional the format of the backing file
267 # @snapshots: #optional list of VM snapshots
269 # @backing-image: #optional info of the backing image (since 1.6)
271 # @format-specific: #optional structure supplying additional format-specific
272 # information (since 1.7)
278 { 'type': 'ImageInfo',
279 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
280 '*actual-size': 'int', 'virtual-size': 'int',
281 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
282 '*backing-filename': 'str', '*full-backing-filename': 'str',
283 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
284 '*backing-image': 'ImageInfo',
285 '*format-specific': 'ImageInfoSpecific' } }
290 # Information about a QEMU image file check
292 # @filename: name of the image file checked
294 # @format: format of the image file checked
296 # @check-errors: number of unexpected errors occurred during check
298 # @image-end-offset: #optional offset (in bytes) where the image ends, this
299 # field is present if the driver for the image format
302 # @corruptions: #optional number of corruptions found during the check if any
304 # @leaks: #optional number of leaks found during the check if any
306 # @corruptions-fixed: #optional number of corruptions fixed during the check
309 # @leaks-fixed: #optional number of leaks fixed during the check if any
311 # @total-clusters: #optional total number of clusters, this field is present
312 # if the driver for the image format supports it
314 # @allocated-clusters: #optional total number of allocated clusters, this
315 # field is present if the driver for the image format
318 # @fragmented-clusters: #optional total number of fragmented clusters, this
319 # field is present if the driver for the image format
322 # @compressed-clusters: #optional total number of compressed clusters, this
323 # field is present if the driver for the image format
330 { 'type': 'ImageCheck',
331 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
332 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
333 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
334 '*total-clusters': 'int', '*allocated-clusters': 'int',
335 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
340 # Information about VCPU run state
342 # @running: true if all VCPUs are runnable, false if not runnable
344 # @singlestep: true if VCPUs are in single-step mode
346 # @status: the virtual machine @RunState
350 # Notes: @singlestep is enabled through the GDB stub
352 { 'type': 'StatusInfo',
353 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
358 # Query the run status of all VCPUs
360 # Returns: @StatusInfo reflecting all VCPUs
364 { 'command': 'query-status', 'returns': 'StatusInfo' }
369 # Guest UUID information.
371 # @UUID: the UUID of the guest
375 # Notes: If no UUID was specified for the guest, a null UUID is returned.
377 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
382 # Query the guest UUID information.
384 # Returns: The @UuidInfo for the guest
388 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
393 # Information about a character device.
395 # @label: the label of the character device
397 # @filename: the filename of the character device
399 # Notes: @filename is encoded using the QEMU command line character device
400 # encoding. See the QEMU man page for details.
404 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
409 # Returns information about current character devices.
411 # Returns: a list of @ChardevInfo
415 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
420 # An enumeration of data format.
422 # @utf8: Data is a UTF-8 string (RFC 3629)
424 # @base64: Data is Base64 encoded binary (RFC 3548)
428 { 'enum': 'DataFormat',
429 'data': [ 'utf8', 'base64' ] }
434 # Write to a ring buffer character device.
436 # @device: the ring buffer character device name
438 # @data: data to write
440 # @format: #optional data encoding (default 'utf8').
441 # - base64: data must be base64 encoded text. Its binary
442 # decoding gets written.
443 # Bug: invalid base64 is currently not rejected.
444 # Whitespace *is* invalid.
445 # - utf8: data's UTF-8 encoding is written
446 # - data itself is always Unicode regardless of format, like
449 # Returns: Nothing on success
453 { 'command': 'ringbuf-write',
454 'data': {'device': 'str', 'data': 'str',
455 '*format': 'DataFormat'} }
460 # Read from a ring buffer character device.
462 # @device: the ring buffer character device name
464 # @size: how many bytes to read at most
466 # @format: #optional data encoding (default 'utf8').
467 # - base64: the data read is returned in base64 encoding.
468 # - utf8: the data read is interpreted as UTF-8.
469 # Bug: can screw up when the buffer contains invalid UTF-8
470 # sequences, NUL characters, after the ring buffer lost
471 # data, and when reading stops because the size limit is
473 # - The return value is always Unicode regardless of format,
474 # like any other string.
476 # Returns: data read from the device
480 { 'command': 'ringbuf-read',
481 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
487 # Information about a QMP command
489 # @name: The command name
493 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
498 # Return a list of supported QMP commands by this server
500 # Returns: A list of @CommandInfo for all supported commands
504 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
509 # Information about a QMP event
511 # @name: The event name
515 { 'type': 'EventInfo', 'data': {'name': 'str'} }
520 # Return a list of supported QMP events by this server
522 # Returns: A list of @EventInfo for all supported events
526 { 'command': 'query-events', 'returns': ['EventInfo'] }
531 # Detailed migration status.
533 # @transferred: amount of bytes already transferred to the target VM
535 # @remaining: amount of bytes remaining to be transferred to the target VM
537 # @total: total amount of bytes involved in the migration process
539 # @duplicate: number of duplicate (zero) pages (since 1.2)
541 # @skipped: number of skipped zero pages (since 1.5)
543 # @normal : number of normal pages (since 1.2)
545 # @normal-bytes: number of normal bytes sent (since 1.2)
547 # @dirty-pages-rate: number of pages dirtied by second by the
550 # @mbps: throughput in megabits/sec. (since 1.6)
554 { 'type': 'MigrationStats',
555 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
556 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
557 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
558 'mbps' : 'number' } }
563 # Detailed XBZRLE migration cache statistics
565 # @cache-size: XBZRLE cache size
567 # @bytes: amount of bytes already transferred to the target VM
569 # @pages: amount of pages transferred to the target VM
571 # @cache-miss: number of cache miss
573 # @overflow: number of overflows
577 { 'type': 'XBZRLECacheStats',
578 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
579 'cache-miss': 'int', 'overflow': 'int' } }
584 # Information about current migration process.
586 # @status: #optional string describing the current migration status.
587 # As of 0.14.0 this can be 'active', 'completed', 'failed' or
588 # 'cancelled'. If this field is not returned, no migration process
591 # @ram: #optional @MigrationStats containing detailed migration
592 # status, only returned if status is 'active' or
593 # 'completed'. 'comppleted' (since 1.2)
595 # @disk: #optional @MigrationStats containing detailed disk migration
596 # status, only returned if status is 'active' and it is a block
599 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
600 # migration statistics, only returned if XBZRLE feature is on and
601 # status is 'active' or 'completed' (since 1.2)
603 # @total-time: #optional total amount of milliseconds since migration started.
604 # If migration has ended, it returns the total migration
607 # @downtime: #optional only present when migration finishes correctly
608 # total downtime in milliseconds for the guest.
611 # @expected-downtime: #optional only present while migration is active
612 # expected downtime in milliseconds for the guest in last walk
613 # of the dirty bitmap. (since 1.3)
615 # @setup-time: #optional amount of setup time in milliseconds _before_ the
616 # iterations begin but _after_ the QMP command is issued. This is designed
617 # to provide an accounting of any activities (such as RDMA pinning) which
618 # may be expensive, but do not actually occur during the iterative
619 # migration rounds themselves. (since 1.6)
623 { 'type': 'MigrationInfo',
624 'data': {'*status': 'str', '*ram': 'MigrationStats',
625 '*disk': 'MigrationStats',
626 '*xbzrle-cache': 'XBZRLECacheStats',
627 '*total-time': 'int',
628 '*expected-downtime': 'int',
630 '*setup-time': 'int'} }
635 # Returns information about current migration process.
637 # Returns: @MigrationInfo
641 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
644 # @MigrationCapability
646 # Migration capabilities enumeration
648 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
649 # This feature allows us to minimize migration traffic for certain work
650 # loads, by sending compressed difference of the pages
652 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
653 # mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
654 # Disabled by default. Experimental: may (or may not) be renamed after
655 # further testing is complete. (since 1.6)
657 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
658 # essentially saves 1MB of zeroes per block on the wire. Enabling requires
659 # source and target VM to support this feature. To enable it is sufficient
660 # to enable the capability on the source VM. The feature is disabled by
661 # default. (since 1.6)
663 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
664 # to speed up convergence of RAM migration. (since 1.6)
668 { 'enum': 'MigrationCapability',
669 'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
672 # @MigrationCapabilityStatus
674 # Migration capability information
676 # @capability: capability enum
678 # @state: capability state bool
682 { 'type': 'MigrationCapabilityStatus',
683 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
686 # @migrate-set-capabilities
688 # Enable/Disable the following migration capabilities (like xbzrle)
690 # @capabilities: json array of capability modifications to make
694 { 'command': 'migrate-set-capabilities',
695 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
698 # @query-migrate-capabilities
700 # Returns information about the current migration capabilities status
702 # Returns: @MigrationCapabilitiesStatus
706 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
711 # Information about a mouse device.
713 # @name: the name of the mouse device
715 # @index: the index of the mouse device
717 # @current: true if this device is currently receiving mouse events
719 # @absolute: true if this device supports absolute coordinates as input
723 { 'type': 'MouseInfo',
724 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
725 'absolute': 'bool'} }
730 # Returns information about each active mouse device
732 # Returns: a list of @MouseInfo for each device
736 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
741 # Information about a virtual CPU
743 # @CPU: the index of the virtual CPU
745 # @current: this only exists for backwards compatible and should be ignored
747 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
748 # to a processor specific low power mode.
750 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
752 # If the target is Sparc, this is the PC component of the
753 # instruction pointer.
755 # @nip: #optional If the target is PPC, the instruction pointer
757 # @npc: #optional If the target is Sparc, the NPC component of the instruction
760 # @PC: #optional If the target is MIPS, the instruction pointer
762 # @thread_id: ID of the underlying host thread
766 # Notes: @halted is a transient state that changes frequently. By the time the
767 # data is sent to the client, the guest may no longer be halted.
770 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
771 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
776 # Returns a list of information about each virtual CPU.
778 # Returns: a list of @CpuInfo for each virtual CPU
782 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
787 # Information about the backing device for a block device.
789 # @file: the filename of the backing device
791 # @ro: true if the backing device was open read-only
793 # @drv: the name of the block format used to open the backing device. As of
794 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
795 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
796 # 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
797 # 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
799 # @backing_file: #optional the name of the backing file (for copy-on-write)
801 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
803 # @encrypted: true if the backing device is encrypted
805 # @encryption_key_missing: true if the backing device is encrypted but an
806 # valid encryption key is missing
808 # @bps: total throughput limit in bytes per second is specified
810 # @bps_rd: read throughput limit in bytes per second is specified
812 # @bps_wr: write throughput limit in bytes per second is specified
814 # @iops: total I/O operations per second is specified
816 # @iops_rd: read I/O operations per second is specified
818 # @iops_wr: write I/O operations per second is specified
820 # @image: the info of image used (since: 1.6)
822 # @bps_max: #optional total max in bytes (Since 1.7)
824 # @bps_rd_max: #optional read max in bytes (Since 1.7)
826 # @bps_wr_max: #optional write max in bytes (Since 1.7)
828 # @iops_max: #optional total I/O operations max (Since 1.7)
830 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
832 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
834 # @iops_size: #optional an I/O size in bytes (Since 1.7)
838 # Notes: This interface is only found in @BlockInfo.
840 { 'type': 'BlockDeviceInfo',
841 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
842 '*backing_file': 'str', 'backing_file_depth': 'int',
843 'encrypted': 'bool', 'encryption_key_missing': 'bool',
844 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
845 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
846 'image': 'ImageInfo',
847 '*bps_max': 'int', '*bps_rd_max': 'int',
848 '*bps_wr_max': 'int', '*iops_max': 'int',
849 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
850 '*iops_size': 'int' } }
853 # @BlockDeviceIoStatus:
855 # An enumeration of block device I/O status.
857 # @ok: The last I/O operation has succeeded
859 # @failed: The last I/O operation has failed
861 # @nospace: The last I/O operation has failed due to a no-space condition
865 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
868 # @BlockDeviceMapEntry:
870 # Entry in the metadata map of the device (returned by "qemu-img map")
872 # @start: Offset in the image of the first byte described by this entry
875 # @length: Length of the range described by this entry (in bytes)
877 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
878 # before reaching one for which the range is allocated. The value is
879 # in the range 0 to the depth of the image chain - 1.
881 # @zero: the sectors in this range read as zeros
883 # @data: reading the image will actually read data from a file (in particular,
884 # if @offset is present this means that the sectors are not simply
885 # preallocated, but contain actual data in raw format)
887 # @offset: if present, the image file stores the data for this range in
888 # raw format at the given offset.
892 { 'type': 'BlockDeviceMapEntry',
893 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
894 'data': 'bool', '*offset': 'int' } }
899 # Block dirty bitmap information.
901 # @count: number of dirty bytes according to the dirty bitmap
903 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
907 { 'type': 'BlockDirtyInfo',
908 'data': {'count': 'int', 'granularity': 'int'} }
913 # Block device information. This structure describes a virtual device and
914 # the backing device associated with it.
916 # @device: The device name associated with the virtual device.
918 # @type: This field is returned only for compatibility reasons, it should
919 # not be used (always returns 'unknown')
921 # @removable: True if the device supports removable media.
923 # @locked: True if the guest has locked this device from having its media
926 # @tray_open: #optional True if the device has a tray and it is open
927 # (only present if removable is true)
929 # @dirty: #optional dirty bitmap information (only present if the dirty
932 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
933 # supports it and the VM is configured to stop on errors
935 # @inserted: #optional @BlockDeviceInfo describing the device if media is
940 { 'type': 'BlockInfo',
941 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
942 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
943 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
944 '*dirty': 'BlockDirtyInfo' } }
949 # Get a list of BlockInfo for all virtual block devices.
951 # Returns: a list of @BlockInfo describing each virtual block device
955 { 'command': 'query-block', 'returns': ['BlockInfo'] }
960 # Statistics of a virtual block device or a block backing device.
962 # @rd_bytes: The number of bytes read by the device.
964 # @wr_bytes: The number of bytes written by the device.
966 # @rd_operations: The number of read operations performed by the device.
968 # @wr_operations: The number of write operations performed by the device.
970 # @flush_operations: The number of cache flush operations performed by the
971 # device (since 0.15.0)
973 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
976 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
978 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
980 # @wr_highest_offset: The offset after the greatest byte written to the
981 # device. The intended use of this information is for
982 # growable sparse files (like qcow2) that are used on top
983 # of a physical device.
987 { 'type': 'BlockDeviceStats',
988 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
989 'wr_operations': 'int', 'flush_operations': 'int',
990 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
991 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
996 # Statistics of a virtual block device or a block backing device.
998 # @device: #optional If the stats are for a virtual block device, the name
999 # corresponding to the virtual block device.
1001 # @stats: A @BlockDeviceStats for the device.
1003 # @parent: #optional This may point to the backing block device if this is a
1004 # a virtual block device. If it's a backing block, this will point
1005 # to the backing file is one is present.
1009 { 'type': 'BlockStats',
1010 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1011 '*parent': 'BlockStats'} }
1014 # @query-blockstats:
1016 # Query the @BlockStats for all virtual block devices.
1018 # Returns: A list of @BlockStats for each virtual block devices.
1022 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1027 # Information about a connected VNC client.
1029 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
1032 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1033 # 'ipv4' if the client is connected via IPv4 and TCP
1034 # 'unix' if the client is connected via a unix domain socket
1035 # 'unknown' otherwise
1037 # @service: The service name of the client's port. This may depends on the
1038 # host system's service database so symbolic names should not be
1041 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1042 # Name of the client.
1044 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1045 # used for authentication.
1049 { 'type': 'VncClientInfo',
1050 'data': {'host': 'str', 'family': 'str', 'service': 'str',
1051 '*x509_dname': 'str', '*sasl_username': 'str'} }
1056 # Information about the VNC session.
1058 # @enabled: true if the VNC server is enabled, false otherwise
1060 # @host: #optional The hostname the VNC server is bound to. This depends on
1061 # the name resolution on the host and may be an IP address.
1063 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1064 # 'ipv4' if the host is listening for IPv4 connections
1065 # 'unix' if the host is listening on a unix domain socket
1066 # 'unknown' otherwise
1068 # @service: #optional The service name of the server's port. This may depends
1069 # on the host system's service database so symbolic names should not
1072 # @auth: #optional the current authentication type used by the server
1073 # 'none' if no authentication is being used
1074 # 'vnc' if VNC authentication is being used
1075 # 'vencrypt+plain' if VEncrypt is used with plain text authentication
1076 # 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1077 # 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1078 # 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1079 # 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1080 # 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1081 # 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1082 # 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1083 # 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1085 # @clients: a list of @VncClientInfo of all currently connected clients
1089 { 'type': 'VncInfo',
1090 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1091 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1096 # Returns information about the current VNC server
1102 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1107 # Information about a SPICE client channel.
1109 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
1112 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1113 # 'ipv4' if the client is connected via IPv4 and TCP
1114 # 'unix' if the client is connected via a unix domain socket
1115 # 'unknown' otherwise
1117 # @port: The client's port number.
1119 # @connection-id: SPICE connection id number. All channels with the same id
1120 # belong to the same SPICE session.
1122 # @connection-type: SPICE channel type number. "1" is the main control
1123 # channel, filter for this one if you want to track spice
1126 # @channel-id: SPICE channel ID number. Usually "0", might be different when
1127 # multiple channels of the same type exist, such as multiple
1128 # display channels in a multihead setup
1130 # @tls: true if the channel is encrypted, false otherwise.
1134 { 'type': 'SpiceChannel',
1135 'data': {'host': 'str', 'family': 'str', 'port': 'str',
1136 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1140 # @SpiceQueryMouseMode
1142 # An enumeration of Spice mouse states.
1144 # @client: Mouse cursor position is determined by the client.
1146 # @server: Mouse cursor position is determined by the server.
1148 # @unknown: No information is available about mouse mode used by
1151 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1155 { 'enum': 'SpiceQueryMouseMode',
1156 'data': [ 'client', 'server', 'unknown' ] }
1161 # Information about the SPICE session.
1163 # @enabled: true if the SPICE server is enabled, false otherwise
1165 # @migrated: true if the last guest migration completed and spice
1166 # migration had completed as well. false otherwise.
1168 # @host: #optional The hostname the SPICE server is bound to. This depends on
1169 # the name resolution on the host and may be an IP address.
1171 # @port: #optional The SPICE server's port number.
1173 # @compiled-version: #optional SPICE server version.
1175 # @tls-port: #optional The SPICE server's TLS port number.
1177 # @auth: #optional the current authentication type used by the server
1178 # 'none' if no authentication is being used
1179 # 'spice' uses SASL or direct TLS authentication, depending on command
1182 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1183 # be determined by the client or the server, or unknown if spice
1184 # server doesn't provide this information.
1188 # @channels: a list of @SpiceChannel for each active spice channel
1192 { 'type': 'SpiceInfo',
1193 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1194 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1195 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1200 # Returns information about the current SPICE server
1202 # Returns: @SpiceInfo
1206 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1211 # Information about the guest balloon device.
1213 # @actual: the number of bytes the balloon currently contains
1218 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1223 # Return information about the balloon device.
1225 # Returns: @BalloonInfo on success
1226 # If the balloon driver is enabled but not functional because the KVM
1227 # kernel module cannot support it, KvmMissingCap
1228 # If no balloon device is present, DeviceNotActive
1232 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1237 # A PCI device memory region
1239 # @base: the starting address (guest physical)
1241 # @limit: the ending address (guest physical)
1245 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1250 # Information about a PCI device I/O region.
1252 # @bar: the index of the Base Address Register for this region
1254 # @type: 'io' if the region is a PIO region
1255 # 'memory' if the region is a MMIO region
1257 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1259 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1263 { 'type': 'PciMemoryRegion',
1264 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1265 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1270 # Information about a PCI Bridge device
1272 # @bus.number: primary bus interface number. This should be the number of the
1273 # bus the device resides on.
1275 # @bus.secondary: secondary bus interface number. This is the number of the
1276 # main bus for the bridge
1278 # @bus.subordinate: This is the highest number bus that resides below the
1281 # @bus.io_range: The PIO range for all devices on this bridge
1283 # @bus.memory_range: The MMIO range for all devices on this bridge
1285 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1288 # @devices: a list of @PciDeviceInfo for each device on this bridge
1292 { 'type': 'PciBridgeInfo',
1293 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1294 'io_range': 'PciMemoryRange',
1295 'memory_range': 'PciMemoryRange',
1296 'prefetchable_range': 'PciMemoryRange' },
1297 '*devices': ['PciDeviceInfo']} }
1302 # Information about a PCI device
1304 # @bus: the bus number of the device
1306 # @slot: the slot the device is located in
1308 # @function: the function of the slot used by the device
1310 # @class_info.desc: #optional a string description of the device's class
1312 # @class_info.class: the class code of the device
1314 # @id.device: the PCI device id
1316 # @id.vendor: the PCI vendor id
1318 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1320 # @qdev_id: the device name of the PCI device
1322 # @pci_bridge: if the device is a PCI bridge, the bridge information
1324 # @regions: a list of the PCI I/O regions associated with the device
1326 # Notes: the contents of @class_info.desc are not stable and should only be
1327 # treated as informational.
1331 { 'type': 'PciDeviceInfo',
1332 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1333 'class_info': {'*desc': 'str', 'class': 'int'},
1334 'id': {'device': 'int', 'vendor': 'int'},
1335 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1336 'regions': ['PciMemoryRegion']} }
1341 # Information about a PCI bus
1343 # @bus: the bus index
1345 # @devices: a list of devices on this bus
1349 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1354 # Return information about the PCI bus topology of the guest.
1356 # Returns: a list of @PciInfo for each PCI bus
1360 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1365 # An enumeration of possible behaviors for errors on I/O operations.
1366 # The exact meaning depends on whether the I/O was initiated by a guest
1369 # @report: for guest operations, report the error to the guest;
1370 # for jobs, cancel the job
1372 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1373 # or BLOCK_JOB_ERROR)
1375 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1377 # @stop: for guest operations, stop the virtual machine;
1378 # for jobs, pause the job
1382 { 'enum': 'BlockdevOnError',
1383 'data': ['report', 'ignore', 'enospc', 'stop'] }
1388 # An enumeration of possible behaviors for the initial synchronization
1389 # phase of storage mirroring.
1391 # @top: copies data in the topmost image to the destination
1393 # @full: copies data from all images to the destination
1395 # @none: only copy data written from now on
1399 { 'enum': 'MirrorSyncMode',
1400 'data': ['top', 'full', 'none'] }
1405 # Type of a block job.
1407 # @commit: block commit job type, see "block-commit"
1409 # @stream: block stream job type, see "block-stream"
1411 # @mirror: drive mirror job type, see "drive-mirror"
1413 # @backup: drive backup job type, see "drive-backup"
1417 { 'enum': 'BlockJobType',
1418 'data': ['commit', 'stream', 'mirror', 'backup'] }
1423 # Information about a long-running block device operation.
1425 # @type: the job type ('stream' for image streaming)
1427 # @device: the block device name
1429 # @len: the maximum progress value
1431 # @busy: false if the job is known to be in a quiescent state, with
1432 # no pending I/O. Since 1.3.
1434 # @paused: whether the job is paused or, if @busy is true, will
1435 # pause itself as soon as possible. Since 1.3.
1437 # @offset: the current progress value
1439 # @speed: the rate limit, bytes per second
1441 # @io-status: the status of the job (since 1.3)
1445 { 'type': 'BlockJobInfo',
1446 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1447 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1448 'io-status': 'BlockDeviceIoStatus'} }
1451 # @query-block-jobs:
1453 # Return information about long-running block device operations.
1455 # Returns: a list of @BlockJobInfo for each active block job
1459 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1464 # This command will cause the QEMU process to exit gracefully. While every
1465 # attempt is made to send the QMP response before terminating, this is not
1466 # guaranteed. When using this interface, a premature EOF would not be
1471 { 'command': 'quit' }
1476 # Stop all guest VCPU execution.
1480 # Notes: This function will succeed even if the guest is already in the stopped
1481 # state. In "inmigrate" state, it will ensure that the guest
1482 # remains paused once migration finishes, as if the -S option was
1483 # passed on the command line.
1485 { 'command': 'stop' }
1490 # Performs a hard reset of a guest.
1494 { 'command': 'system_reset' }
1497 # @system_powerdown:
1499 # Requests that a guest perform a powerdown operation.
1503 # Notes: A guest may or may not respond to this command. This command
1504 # returning does not indicate that a guest has accepted the request or
1505 # that it has shut down. Many guests will respond to this command by
1506 # prompting the user in some way.
1508 { 'command': 'system_powerdown' }
1513 # This command is a nop that is only provided for the purposes of compatibility.
1517 # Notes: Do not use this command.
1519 { 'command': 'cpu', 'data': {'index': 'int'} }
1524 # Adds CPU with specified ID
1526 # @id: ID of CPU to be created, valid values [0..max_cpus)
1528 # Returns: Nothing on success
1532 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1537 # Save a portion of guest memory to a file.
1539 # @val: the virtual address of the guest to start from
1541 # @size: the size of memory region to save
1543 # @filename: the file to save the memory to as binary data
1545 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1546 # virtual address (defaults to CPU 0)
1548 # Returns: Nothing on success
1552 # Notes: Errors were not reliably returned until 1.1
1554 { 'command': 'memsave',
1555 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1560 # Save a portion of guest physical memory to a file.
1562 # @val: the physical address of the guest to start from
1564 # @size: the size of memory region to save
1566 # @filename: the file to save the memory to as binary data
1568 # Returns: Nothing on success
1572 # Notes: Errors were not reliably returned until 1.1
1574 { 'command': 'pmemsave',
1575 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1580 # Resume guest VCPU execution.
1584 # Returns: If successful, nothing
1585 # If QEMU was started with an encrypted block device and a key has
1586 # not yet been set, DeviceEncrypted.
1588 # Notes: This command will succeed if the guest is currently running. It
1589 # will also succeed if the guest is in the "inmigrate" state; in
1590 # this case, the effect of the command is to make sure the guest
1591 # starts once migration finishes, removing the effect of the -S
1592 # command line option if it was passed.
1594 { 'command': 'cont' }
1599 # Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1605 { 'command': 'system_wakeup' }
1610 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1612 # Returns: If successful, nothing
1616 # Notes: Only x86 Virtual Machines support this command.
1618 { 'command': 'inject-nmi' }
1623 # Sets the link status of a virtual network adapter.
1625 # @name: the device name of the virtual network adapter
1627 # @up: true to set the link status to be up
1629 # Returns: Nothing on success
1630 # If @name is not a valid network device, DeviceNotFound
1634 # Notes: Not all network adapters support setting link status. This command
1635 # will succeed even if the network adapter does not support link status
1638 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1643 # This command sets the password of a block device that has not been open
1644 # with a password and requires one.
1646 # The two cases where this can happen are a block device is created through
1647 # QEMU's initial command line or a block device is changed through the legacy
1648 # @change interface.
1650 # In the event that the block device is created through the initial command
1651 # line, the VM will start in the stopped state regardless of whether '-S' is
1652 # used. The intention is for a management tool to query the block devices to
1653 # determine which ones are encrypted, set the passwords with this command, and
1654 # then start the guest with the @cont command.
1656 # @device: the name of the device to set the password on
1658 # @password: the password to use for the device
1660 # Returns: nothing on success
1661 # If @device is not a valid block device, DeviceNotFound
1662 # If @device is not encrypted, DeviceNotEncrypted
1664 # Notes: Not all block formats support encryption and some that do are not
1665 # able to validate that a password is correct. Disk corruption may
1666 # occur if an invalid password is specified.
1670 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1675 # Request the balloon driver to change its balloon size.
1677 # @value: the target size of the balloon in bytes
1679 # Returns: Nothing on success
1680 # If the balloon driver is enabled but not functional because the KVM
1681 # kernel module cannot support it, KvmMissingCap
1682 # If no balloon device is present, DeviceNotActive
1684 # Notes: This command just issues a request to the guest. When it returns,
1685 # the balloon size may not have changed. A guest can change the balloon
1686 # size independent of this command.
1690 { 'command': 'balloon', 'data': {'value': 'int'} }
1695 # Resize a block image while a guest is running.
1697 # @device: the name of the device to get the image resized
1699 # @size: new image size in bytes
1701 # Returns: nothing on success
1702 # If @device is not a valid block device, DeviceNotFound
1706 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1711 # An enumeration that tells QEMU how to set the backing file path in
1714 # @existing: QEMU should look for an existing image file.
1716 # @absolute-paths: QEMU should create a new image with absolute paths
1717 # for the backing file.
1721 { 'enum': 'NewImageMode',
1722 'data': [ 'existing', 'absolute-paths' ] }
1727 # @device: the name of the device to generate the snapshot from.
1729 # @snapshot-file: the target of the new image. A new file will be created.
1731 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1733 # @mode: #optional whether and how QEMU should create a new image, default is
1736 { 'type': 'BlockdevSnapshot',
1737 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1738 '*mode': 'NewImageMode' } }
1741 # @BlockdevSnapshotInternal
1743 # @device: the name of the device to generate the snapshot from
1745 # @name: the name of the internal snapshot to be created
1747 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1748 # exists, the operation will fail. Only some image formats support it,
1749 # for example, qcow2, rbd, and sheepdog.
1753 { 'type': 'BlockdevSnapshotInternal',
1754 'data': { 'device': 'str', 'name': 'str' } }
1759 # @device: the name of the device which should be copied.
1761 # @target: the target of the new image. If the file exists, or if it
1762 # is a device, the existing file/device will be used as the new
1763 # destination. If it does not exist, a new file will be created.
1765 # @format: #optional the format of the new destination, default is to
1766 # probe if @mode is 'existing', else the format of the source
1768 # @sync: what parts of the disk image should be copied to the destination
1769 # (all the disk, only the sectors allocated in the topmost image, or
1772 # @mode: #optional whether and how QEMU should create a new image, default is
1775 # @speed: #optional the maximum speed, in bytes per second
1777 # @on-source-error: #optional the action to take on an error on the source,
1778 # default 'report'. 'stop' and 'enospc' can only be used
1779 # if the block device supports io-status (see BlockInfo).
1781 # @on-target-error: #optional the action to take on an error on the target,
1782 # default 'report' (no limitations, since this applies to
1783 # a different block device than @device).
1785 # Note that @on-source-error and @on-target-error only affect background I/O.
1786 # If an error occurs during a guest write request, the device's rerror/werror
1787 # actions will be used.
1791 { 'type': 'DriveBackup',
1792 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1793 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1795 '*on-source-error': 'BlockdevOnError',
1796 '*on-target-error': 'BlockdevOnError' } }
1801 # This action can be used to test transaction failure.
1809 # @TransactionAction
1811 # A discriminated record of operations that can be performed with
1814 { 'union': 'TransactionAction',
1816 'blockdev-snapshot-sync': 'BlockdevSnapshot',
1817 'drive-backup': 'DriveBackup',
1819 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1825 # Executes a number of transactionable QMP commands atomically. If any
1826 # operation fails, then the entire set of actions will be abandoned and the
1827 # appropriate error returned.
1830 # @TransactionAction: information needed for the respective operation
1832 # Returns: nothing on success
1833 # Errors depend on the operations of the transaction
1835 # Note: The transaction aborts on the first failure. Therefore, there will be
1836 # information on only one failed operation returned in an error condition, and
1837 # subsequent actions will not have been attempted.
1841 { 'command': 'transaction',
1842 'data': { 'actions': [ 'TransactionAction' ] } }
1845 # @blockdev-snapshot-sync
1847 # Generates a synchronous snapshot of a block device.
1849 # For the arguments, see the documentation of BlockdevSnapshot.
1851 # Returns: nothing on success
1852 # If @device is not a valid block device, DeviceNotFound
1856 { 'command': 'blockdev-snapshot-sync',
1857 'data': 'BlockdevSnapshot' }
1860 # @blockdev-snapshot-internal-sync
1862 # Synchronously take an internal snapshot of a block device, when the format
1863 # of the image used supports it.
1865 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1867 # Returns: nothing on success
1868 # If @device is not a valid block device, DeviceNotFound
1869 # If any snapshot matching @name exists, or @name is empty,
1871 # If the format of the image used does not support it,
1872 # BlockFormatFeatureNotSupported
1876 { 'command': 'blockdev-snapshot-internal-sync',
1877 'data': 'BlockdevSnapshotInternal' }
1880 # @blockdev-snapshot-delete-internal-sync
1882 # Synchronously delete an internal snapshot of a block device, when the format
1883 # of the image used support it. The snapshot is identified by name or id or
1884 # both. One of the name or id is required. Return SnapshotInfo for the
1885 # successfully deleted snapshot.
1887 # @device: the name of the device to delete the snapshot from
1889 # @id: optional the snapshot's ID to be deleted
1891 # @name: optional the snapshot's name to be deleted
1893 # Returns: SnapshotInfo on success
1894 # If @device is not a valid block device, DeviceNotFound
1895 # If snapshot not found, GenericError
1896 # If the format of the image used does not support it,
1897 # BlockFormatFeatureNotSupported
1898 # If @id and @name are both not specified, GenericError
1902 { 'command': 'blockdev-snapshot-delete-internal-sync',
1903 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
1904 'returns': 'SnapshotInfo' }
1907 # @human-monitor-command:
1909 # Execute a command on the human monitor and return the output.
1911 # @command-line: the command to execute in the human monitor
1913 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1915 # Returns: the output of the command as a string
1919 # Notes: This command only exists as a stop-gap. It's use is highly
1920 # discouraged. The semantics of this command are not guaranteed.
1922 # Known limitations:
1924 # o This command is stateless, this means that commands that depend
1925 # on state information (such as getfd) might not work
1927 # o Commands that prompt the user for data (eg. 'cont' when the block
1928 # device is encrypted) don't currently work
1930 { 'command': 'human-monitor-command',
1931 'data': {'command-line': 'str', '*cpu-index': 'int'},
1937 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1938 # writes data between 'top' and 'base' into 'base'.
1940 # @device: the name of the device
1942 # @base: #optional The file name of the backing image to write data into.
1943 # If not specified, this is the deepest backing image
1945 # @top: The file name of the backing image within the image chain,
1946 # which contains the topmost data to be committed down.
1947 # Note, the active layer as 'top' is currently unsupported.
1949 # If top == base, that is an error.
1952 # @speed: #optional the maximum speed, in bytes per second
1954 # Returns: Nothing on success
1955 # If commit or stream is already active on this device, DeviceInUse
1956 # If @device does not exist, DeviceNotFound
1957 # If image commit is not supported by this device, NotSupported
1958 # If @base or @top is invalid, a generic error is returned
1959 # If @top is the active layer, or omitted, a generic error is returned
1960 # If @speed is invalid, InvalidParameter
1965 { 'command': 'block-commit',
1966 'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1972 # Start a point-in-time copy of a block device to a new destination. The
1973 # status of ongoing drive-backup operations can be checked with
1974 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1975 # The operation can be stopped before it has completed using the
1976 # block-job-cancel command.
1978 # For the arguments, see the documentation of DriveBackup.
1980 # Returns: nothing on success
1981 # If @device is not a valid block device, DeviceNotFound
1985 { 'command': 'drive-backup', 'data': 'DriveBackup' }
1990 # Start mirroring a block device's writes to a new destination.
1992 # @device: the name of the device whose writes should be mirrored.
1994 # @target: the target of the new image. If the file exists, or if it
1995 # is a device, the existing file/device will be used as the new
1996 # destination. If it does not exist, a new file will be created.
1998 # @format: #optional the format of the new destination, default is to
1999 # probe if @mode is 'existing', else the format of the source
2001 # @mode: #optional whether and how QEMU should create a new image, default is
2004 # @speed: #optional the maximum speed, in bytes per second
2006 # @sync: what parts of the disk image should be copied to the destination
2007 # (all the disk, only the sectors allocated in the topmost image, or
2010 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2011 # if the image format doesn't have clusters, 4K if the clusters
2012 # are smaller than that, else the cluster size. Must be a
2013 # power of 2 between 512 and 64M (since 1.4).
2015 # @buf-size: #optional maximum amount of data in flight from source to
2016 # target (since 1.4).
2018 # @on-source-error: #optional the action to take on an error on the source,
2019 # default 'report'. 'stop' and 'enospc' can only be used
2020 # if the block device supports io-status (see BlockInfo).
2022 # @on-target-error: #optional the action to take on an error on the target,
2023 # default 'report' (no limitations, since this applies to
2024 # a different block device than @device).
2026 # Returns: nothing on success
2027 # If @device is not a valid block device, DeviceNotFound
2031 { 'command': 'drive-mirror',
2032 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2033 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2034 '*speed': 'int', '*granularity': 'uint32',
2035 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2036 '*on-target-error': 'BlockdevOnError' } }
2041 # Cancel the current executing migration process.
2043 # Returns: nothing on success
2045 # Notes: This command succeeds even if there is no migration process running.
2049 { 'command': 'migrate_cancel' }
2052 # @migrate_set_downtime
2054 # Set maximum tolerated downtime for migration.
2056 # @value: maximum downtime in seconds
2058 # Returns: nothing on success
2062 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2065 # @migrate_set_speed
2067 # Set maximum speed for migration.
2069 # @value: maximum speed in bytes.
2071 # Returns: nothing on success
2073 # Notes: A value lesser than zero will be automatically round up to zero.
2077 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2080 # @migrate-set-cache-size
2082 # Set XBZRLE cache size
2084 # @value: cache size in bytes
2086 # The size will be rounded down to the nearest power of 2.
2087 # The cache size can be modified before and during ongoing migration
2089 # Returns: nothing on success
2093 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2096 # @query-migrate-cache-size
2098 # query XBZRLE cache size
2100 # Returns: XBZRLE cache size in bytes
2104 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2107 # @ObjectPropertyInfo:
2109 # @name: the name of the property
2111 # @type: the type of the property. This will typically come in one of four
2114 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2115 # These types are mapped to the appropriate JSON type.
2117 # 2) A legacy type in the form 'legacy<subtype>' where subtype is the
2118 # legacy qdev typename. These types are always treated as strings.
2120 # 3) A child type in the form 'child<subtype>' where subtype is a qdev
2121 # device type name. Child properties create the composition tree.
2123 # 4) A link type in the form 'link<subtype>' where subtype is a qdev
2124 # device type name. Link properties form the device model graph.
2128 { 'type': 'ObjectPropertyInfo',
2129 'data': { 'name': 'str', 'type': 'str' } }
2134 # This command will list any properties of a object given a path in the object
2137 # @path: the path within the object model. See @qom-get for a description of
2140 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2145 { 'command': 'qom-list',
2146 'data': { 'path': 'str' },
2147 'returns': [ 'ObjectPropertyInfo' ] }
2152 # This command will get a property from a object model path and return the
2155 # @path: The path within the object model. There are two forms of supported
2156 # paths--absolute and partial paths.
2158 # Absolute paths are derived from the root object and can follow child<>
2159 # or link<> properties. Since they can follow link<> properties, they
2160 # can be arbitrarily long. Absolute paths look like absolute filenames
2161 # and are prefixed with a leading slash.
2163 # Partial paths look like relative filenames. They do not begin
2164 # with a prefix. The matching rules for partial paths are subtle but
2165 # designed to make specifying objects easy. At each level of the
2166 # composition tree, the partial path is matched as an absolute path.
2167 # The first match is not returned. At least two matches are searched
2168 # for. A successful result is only returned if only one match is
2169 # found. If more than one match is found, a flag is return to
2170 # indicate that the match was ambiguous.
2172 # @property: The property name to read
2174 # Returns: The property value. The type depends on the property type. legacy<>
2175 # properties are returned as #str. child<> and link<> properties are
2176 # returns as #str pathnames. All integer property types (u8, u16, etc)
2177 # are returned as #int.
2181 { 'command': 'qom-get',
2182 'data': { 'path': 'str', 'property': 'str' },
2183 'returns': 'visitor',
2189 # This command will set a property from a object model path.
2191 # @path: see @qom-get for a description of this parameter
2193 # @property: the property name to set
2195 # @value: a value who's type is appropriate for the property type. See @qom-get
2196 # for a description of type mapping.
2200 { 'command': 'qom-set',
2201 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2207 # Sets the password of a remote display session.
2209 # @protocol: `vnc' to modify the VNC server password
2210 # `spice' to modify the Spice server password
2212 # @password: the new password
2214 # @connected: #optional how to handle existing clients when changing the
2215 # password. If nothing is specified, defaults to `keep'
2216 # `fail' to fail the command if clients are connected
2217 # `disconnect' to disconnect existing clients
2218 # `keep' to maintain existing clients
2220 # Returns: Nothing on success
2221 # If Spice is not enabled, DeviceNotFound
2225 { 'command': 'set_password',
2226 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2231 # Expire the password of a remote display server.
2233 # @protocol: the name of the remote display protocol `vnc' or `spice'
2235 # @time: when to expire the password.
2236 # `now' to expire the password immediately
2237 # `never' to cancel password expiration
2238 # `+INT' where INT is the number of seconds from now (integer)
2239 # `INT' where INT is the absolute time in seconds
2241 # Returns: Nothing on success
2242 # If @protocol is `spice' and Spice is not active, DeviceNotFound
2246 # Notes: Time is relative to the server and currently there is no way to
2247 # coordinate server time with client time. It is not recommended to
2248 # use the absolute time version of the @time parameter unless you're
2249 # sure you are on the same machine as the QEMU instance.
2251 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2256 # Ejects a device from a removable drive.
2258 # @device: The name of the device
2260 # @force: @optional If true, eject regardless of whether the drive is locked.
2261 # If not specified, the default value is false.
2263 # Returns: Nothing on success
2264 # If @device is not a valid block device, DeviceNotFound
2266 # Notes: Ejecting a device will no media results in success
2270 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2273 # @change-vnc-password:
2275 # Change the VNC server password.
2277 # @target: the new password to use with VNC authentication
2281 # Notes: An empty password in this command will set the password to the empty
2282 # string. Existing clients are unaffected by executing this command.
2284 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2289 # This command is multiple commands multiplexed together.
2291 # @device: This is normally the name of a block device but it may also be 'vnc'.
2292 # when it's 'vnc', then sub command depends on @target
2294 # @target: If @device is a block device, then this is the new filename.
2295 # If @device is 'vnc', then if the value 'password' selects the vnc
2296 # change password command. Otherwise, this specifies a new server URI
2297 # address to listen to for VNC connections.
2299 # @arg: If @device is a block device, then this is an optional format to open
2301 # If @device is 'vnc' and @target is 'password', this is the new VNC
2302 # password to set. If this argument is an empty string, then no future
2303 # logins will be allowed.
2305 # Returns: Nothing on success.
2306 # If @device is not a valid block device, DeviceNotFound
2307 # If the new block device is encrypted, DeviceEncrypted. Note that
2308 # if this error is returned, the device has been opened successfully
2309 # and an additional call to @block_passwd is required to set the
2310 # device's password. The behavior of reads and writes to the block
2311 # device between when these calls are executed is undefined.
2313 # Notes: It is strongly recommended that this interface is not used especially
2314 # for changing block devices.
2318 { 'command': 'change',
2319 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2322 # @block_set_io_throttle:
2324 # Change I/O throttle limits for a block drive.
2326 # @device: The name of the device
2328 # @bps: total throughput limit in bytes per second
2330 # @bps_rd: read throughput limit in bytes per second
2332 # @bps_wr: write throughput limit in bytes per second
2334 # @iops: total I/O operations per second
2336 # @ops_rd: read I/O operations per second
2338 # @iops_wr: write I/O operations per second
2340 # @bps_max: #optional total max in bytes (Since 1.7)
2342 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2344 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2346 # @iops_max: #optional total I/O operations max (Since 1.7)
2348 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2350 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2352 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2354 # Returns: Nothing on success
2355 # If @device is not a valid block device, DeviceNotFound
2359 { 'command': 'block_set_io_throttle',
2360 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2361 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2362 '*bps_max': 'int', '*bps_rd_max': 'int',
2363 '*bps_wr_max': 'int', '*iops_max': 'int',
2364 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2365 '*iops_size': 'int' } }
2370 # Copy data from a backing file into a block device.
2372 # The block streaming operation is performed in the background until the entire
2373 # backing file has been copied. This command returns immediately once streaming
2374 # has started. The status of ongoing block streaming operations can be checked
2375 # with query-block-jobs. The operation can be stopped before it has completed
2376 # using the block-job-cancel command.
2378 # If a base file is specified then sectors are not copied from that base file and
2379 # its backing chain. When streaming completes the image file will have the base
2380 # file as its backing file. This can be used to stream a subset of the backing
2381 # file chain instead of flattening the entire image.
2383 # On successful completion the image file is updated to drop the backing file
2384 # and the BLOCK_JOB_COMPLETED event is emitted.
2386 # @device: the device name
2388 # @base: #optional the common backing file name
2390 # @speed: #optional the maximum speed, in bytes per second
2392 # @on-error: #optional the action to take on an error (default report).
2393 # 'stop' and 'enospc' can only be used if the block device
2394 # supports io-status (see BlockInfo). Since 1.3.
2396 # Returns: Nothing on success
2397 # If @device does not exist, DeviceNotFound
2401 { 'command': 'block-stream',
2402 'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2403 '*on-error': 'BlockdevOnError' } }
2406 # @block-job-set-speed:
2408 # Set maximum speed for a background block operation.
2410 # This command can only be issued when there is an active block job.
2412 # Throttling can be disabled by setting the speed to 0.
2414 # @device: the device name
2416 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2419 # Returns: Nothing on success
2420 # If no background operation is active on this device, DeviceNotActive
2424 { 'command': 'block-job-set-speed',
2425 'data': { 'device': 'str', 'speed': 'int' } }
2428 # @block-job-cancel:
2430 # Stop an active background block operation.
2432 # This command returns immediately after marking the active background block
2433 # operation for cancellation. It is an error to call this command if no
2434 # operation is in progress.
2436 # The operation will cancel as soon as possible and then emit the
2437 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2438 # enumerated using query-block-jobs.
2440 # For streaming, the image file retains its backing file unless the streaming
2441 # operation happens to complete just as it is being cancelled. A new streaming
2442 # operation can be started at a later time to finish copying all data from the
2445 # @device: the device name
2447 # @force: #optional whether to allow cancellation of a paused job (default
2448 # false). Since 1.3.
2450 # Returns: Nothing on success
2451 # If no background operation is active on this device, DeviceNotActive
2455 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2460 # Pause an active background block operation.
2462 # This command returns immediately after marking the active background block
2463 # operation for pausing. It is an error to call this command if no
2464 # operation is in progress. Pausing an already paused job has no cumulative
2465 # effect; a single block-job-resume command will resume the job.
2467 # The operation will pause as soon as possible. No event is emitted when
2468 # the operation is actually paused. Cancelling a paused job automatically
2471 # @device: the device name
2473 # Returns: Nothing on success
2474 # If no background operation is active on this device, DeviceNotActive
2478 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2481 # @block-job-resume:
2483 # Resume an active background block operation.
2485 # This command returns immediately after resuming a paused background block
2486 # operation. It is an error to call this command if no operation is in
2487 # progress. Resuming an already running job is not an error.
2489 # This command also clears the error status of the job.
2491 # @device: the device name
2493 # Returns: Nothing on success
2494 # If no background operation is active on this device, DeviceNotActive
2498 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2501 # @block-job-complete:
2503 # Manually trigger completion of an active background block operation. This
2504 # is supported for drive mirroring, where it also switches the device to
2505 # write to the target path only. The ability to complete is signaled with
2506 # a BLOCK_JOB_READY event.
2508 # This command completes an active background block operation synchronously.
2509 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2510 # is not defined. Note that if an I/O error occurs during the processing of
2511 # this command: 1) the command itself will fail; 2) the error will be processed
2512 # according to the rerror/werror arguments that were specified when starting
2515 # A cancelled or paused job cannot be completed.
2517 # @device: the device name
2519 # Returns: Nothing on success
2520 # If no background operation is active on this device, DeviceNotActive
2524 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2529 # This structure describes a search result from @qom-list-types
2531 # @name: the type name found in the search
2535 # Notes: This command is experimental and may change syntax in future releases.
2537 { 'type': 'ObjectTypeInfo',
2538 'data': { 'name': 'str' } }
2543 # This command will return a list of types given search parameters
2545 # @implements: if specified, only return types that implement this type name
2547 # @abstract: if true, include abstract types in the results
2549 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2553 { 'command': 'qom-list-types',
2554 'data': { '*implements': 'str', '*abstract': 'bool' },
2555 'returns': [ 'ObjectTypeInfo' ] }
2558 # @DevicePropertyInfo:
2560 # Information about device properties.
2562 # @name: the name of the property
2563 # @type: the typename of the property
2567 { 'type': 'DevicePropertyInfo',
2568 'data': { 'name': 'str', 'type': 'str' } }
2571 # @device-list-properties:
2573 # List properties associated with a device.
2575 # @typename: the type name of a device
2577 # Returns: a list of DevicePropertyInfo describing a devices properties
2581 { 'command': 'device-list-properties',
2582 'data': { 'typename': 'str'},
2583 'returns': [ 'DevicePropertyInfo' ] }
2588 # Migrates the current running guest to another Virtual Machine.
2590 # @uri: the Uniform Resource Identifier of the destination VM
2592 # @blk: #optional do block migration (full disk copy)
2594 # @inc: #optional incremental disk copy migration
2596 # @detach: this argument exists only for compatibility reasons and
2597 # is ignored by QEMU
2599 # Returns: nothing on success
2603 { 'command': 'migrate',
2604 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2606 # @xen-save-devices-state:
2608 # Save the state of all devices to file. The RAM and the block devices
2609 # of the VM are not saved by this command.
2611 # @filename: the file to save the state of the devices to as binary
2612 # data. See xen-save-devices-state.txt for a description of the binary
2615 # Returns: Nothing on success
2619 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2622 # @xen-set-global-dirty-log
2624 # Enable or disable the global dirty log mode.
2626 # @enable: true to enable, false to disable.
2632 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2637 # Remove a device from a guest
2639 # @id: the name of the device
2641 # Returns: Nothing on success
2642 # If @id is not a valid device, DeviceNotFound
2644 # Notes: When this command completes, the device may not be removed from the
2645 # guest. Hot removal is an operation that requires guest cooperation.
2646 # This command merely requests that the guest begin the hot removal
2647 # process. Completion of the device removal process is signaled with a
2648 # DEVICE_DELETED event. Guest reset will automatically complete removal
2653 { 'command': 'device_del', 'data': {'id': 'str'} }
2656 # @dump-guest-memory
2658 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2659 # very long depending on the amount of guest memory. This command is only
2660 # supported on i386 and x86_64.
2662 # @paging: if true, do paging to get guest's memory mapping. This allows
2663 # using gdb to process the core file.
2665 # IMPORTANT: this option can make QEMU allocate several gigabytes
2666 # of RAM. This can happen for a large guest, or a
2667 # malicious guest pretending to be large.
2669 # Also, paging=true has the following limitations:
2671 # 1. The guest may be in a catastrophic state or can have corrupted
2672 # memory, which cannot be trusted
2673 # 2. The guest can be in real-mode even if paging is enabled. For
2674 # example, the guest uses ACPI to sleep, and ACPI sleep state
2677 # @protocol: the filename or file descriptor of the vmcore. The supported
2680 # 1. file: the protocol starts with "file:", and the following
2681 # string is the file's path.
2682 # 2. fd: the protocol starts with "fd:", and the following string
2685 # @begin: #optional if specified, the starting physical address.
2687 # @length: #optional if specified, the memory size, in bytes. If you don't
2688 # want to dump all guest's memory, please specify the start @begin
2691 # Returns: nothing on success
2695 { 'command': 'dump-guest-memory',
2696 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2697 '*length': 'int' } }
2702 # Add a network backend.
2704 # @type: the type of network backend. Current valid values are 'user', 'tap',
2705 # 'vde', 'socket', 'dump' and 'bridge'
2707 # @id: the name of the new network backend
2709 # @props: #optional a list of properties to be passed to the backend in
2710 # the format 'name=value', like 'ifname=tap0,script=no'
2712 # Notes: The semantics of @props is not well defined. Future commands will be
2713 # introduced that provide stronger typing for backend creation.
2717 # Returns: Nothing on success
2718 # If @type is not a valid network backend, DeviceNotFound
2720 { 'command': 'netdev_add',
2721 'data': {'type': 'str', 'id': 'str', '*props': '**'},
2727 # Remove a network backend.
2729 # @id: the name of the network backend to remove
2731 # Returns: Nothing on success
2732 # If @id is not a valid network backend, DeviceNotFound
2736 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2739 # @NetdevNoneOptions
2741 # Use it alone to have zero network devices.
2745 { 'type': 'NetdevNoneOptions',
2749 # @NetLegacyNicOptions
2751 # Create a new Network Interface Card.
2753 # @netdev: #optional id of -netdev to connect to
2755 # @macaddr: #optional MAC address
2757 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2759 # @addr: #optional PCI device address
2761 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2765 { 'type': 'NetLegacyNicOptions',
2771 '*vectors': 'uint32' } }
2776 # A fat type wrapping 'str', to be embedded in lists.
2785 # @NetdevUserOptions
2787 # Use the user mode network stack which requires no administrator privilege to
2790 # @hostname: #optional client hostname reported by the builtin DHCP server
2792 # @restrict: #optional isolate the guest from the host
2794 # @ip: #optional legacy parameter, use net= instead
2796 # @net: #optional IP address and optional netmask
2798 # @host: #optional guest-visible address of the host
2800 # @tftp: #optional root directory of the built-in TFTP server
2802 # @bootfile: #optional BOOTP filename, for use with tftp=
2804 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2807 # @dns: #optional guest-visible address of the virtual nameserver
2809 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2812 # @smb: #optional root directory of the built-in SMB server
2814 # @smbserver: #optional IP address of the built-in SMB server
2816 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2819 # @guestfwd: #optional forward guest TCP connections
2823 { 'type': 'NetdevUserOptions',
2826 '*restrict': 'bool',
2832 '*dhcpstart': 'str',
2834 '*dnssearch': ['String'],
2836 '*smbserver': 'str',
2837 '*hostfwd': ['String'],
2838 '*guestfwd': ['String'] } }
2843 # Connect the host TAP network interface name to the VLAN.
2845 # @ifname: #optional interface name
2847 # @fd: #optional file descriptor of an already opened tap
2849 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2852 # @script: #optional script to initialize the interface
2854 # @downscript: #optional script to shut down the interface
2856 # @helper: #optional command to execute to configure bridge
2858 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2860 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2862 # @vhost: #optional enable vhost-net network accelerator
2864 # @vhostfd: #optional file descriptor of an already opened vhost net device
2866 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2869 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2871 # @queues: #optional number of queues to be created for multiqueue capable tap
2875 { 'type': 'NetdevTapOptions',
2881 '*downscript': 'str',
2884 '*vnet_hdr': 'bool',
2888 '*vhostforce': 'bool',
2889 '*queues': 'uint32'} }
2892 # @NetdevSocketOptions
2894 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2895 # socket connection.
2897 # @fd: #optional file descriptor of an already opened socket
2899 # @listen: #optional port number, and optional hostname, to listen on
2901 # @connect: #optional port number, and optional hostname, to connect to
2903 # @mcast: #optional UDP multicast address and port number
2905 # @localaddr: #optional source address and port for multicast and udp packets
2907 # @udp: #optional UDP unicast address and port number
2911 { 'type': 'NetdevSocketOptions',
2917 '*localaddr': 'str',
2923 # Connect the VLAN to a vde switch running on the host.
2925 # @sock: #optional socket path
2927 # @port: #optional port number
2929 # @group: #optional group owner of socket
2931 # @mode: #optional permissions for socket
2935 { 'type': 'NetdevVdeOptions',
2940 '*mode': 'uint16' } }
2943 # @NetdevDumpOptions
2945 # Dump VLAN network traffic to a file.
2947 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2950 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2954 { 'type': 'NetdevDumpOptions',
2960 # @NetdevBridgeOptions
2962 # Connect a host TAP network interface to a host bridge device.
2964 # @br: #optional bridge name
2966 # @helper: #optional command to execute to configure bridge
2970 { 'type': 'NetdevBridgeOptions',
2973 '*helper': 'str' } }
2976 # @NetdevHubPortOptions
2978 # Connect two or more net clients through a software hub.
2980 # @hubid: hub identifier number
2984 { 'type': 'NetdevHubPortOptions',
2986 'hubid': 'int32' } }
2991 # A discriminated record of network device traits.
2995 { 'union': 'NetClientOptions',
2997 'none': 'NetdevNoneOptions',
2998 'nic': 'NetLegacyNicOptions',
2999 'user': 'NetdevUserOptions',
3000 'tap': 'NetdevTapOptions',
3001 'socket': 'NetdevSocketOptions',
3002 'vde': 'NetdevVdeOptions',
3003 'dump': 'NetdevDumpOptions',
3004 'bridge': 'NetdevBridgeOptions',
3005 'hubport': 'NetdevHubPortOptions' } }
3010 # Captures the configuration of a network device; legacy.
3012 # @vlan: #optional vlan number
3014 # @id: #optional identifier for monitor commands
3016 # @name: #optional identifier for monitor commands, ignored if @id is present
3018 # @opts: device type specific properties (legacy)
3022 { 'type': 'NetLegacy',
3027 'opts': 'NetClientOptions' } }
3032 # Captures the configuration of a network device.
3034 # @id: identifier for monitor commands.
3036 # @opts: device type specific properties
3043 'opts': 'NetClientOptions' } }
3046 # @InetSocketAddress
3048 # Captures a socket address or address range in the Internet namespace.
3050 # @host: host part of the address
3052 # @port: port part of the address, or lowest port if @to is present
3054 # @to: highest port to try
3056 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3059 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3064 { 'type': 'InetSocketAddress',
3073 # @UnixSocketAddress
3075 # Captures a socket address in the local ("Unix socket") namespace.
3077 # @path: filesystem path to use
3081 { 'type': 'UnixSocketAddress',
3088 # Captures the address of a socket, which could also be a named file descriptor
3092 { 'union': 'SocketAddress',
3094 'inet': 'InetSocketAddress',
3095 'unix': 'UnixSocketAddress',
3101 # Receive a file descriptor via SCM rights and assign it a name
3103 # @fdname: file descriptor name
3105 # Returns: Nothing on success
3109 # Notes: If @fdname already exists, the file descriptor assigned to
3110 # it will be closed and replaced by the received file
3112 # The 'closefd' command can be used to explicitly close the
3113 # file descriptor when it is no longer needed.
3115 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3120 # Close a file descriptor previously passed via SCM rights
3122 # @fdname: file descriptor name
3124 # Returns: Nothing on success
3128 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3133 # Information describing a machine.
3135 # @name: the name of the machine
3137 # @alias: #optional an alias for the machine name
3139 # @default: #optional whether the machine is default
3141 # @cpu-max: maximum number of CPUs supported by the machine type
3146 { 'type': 'MachineInfo',
3147 'data': { 'name': 'str', '*alias': 'str',
3148 '*is-default': 'bool', 'cpu-max': 'int' } }
3153 # Return a list of supported machines
3155 # Returns: a list of MachineInfo
3159 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3162 # @CpuDefinitionInfo:
3164 # Virtual CPU definition.
3166 # @name: the name of the CPU definition
3170 { 'type': 'CpuDefinitionInfo',
3171 'data': { 'name': 'str' } }
3174 # @query-cpu-definitions:
3176 # Return a list of supported virtual CPU definitions
3178 # Returns: a list of CpuDefInfo
3182 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3186 # Information about a file descriptor that was added to an fd set.
3188 # @fdset-id: The ID of the fd set that @fd was added to.
3190 # @fd: The file descriptor that was received via SCM rights and
3191 # added to the fd set.
3195 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3200 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3202 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3204 # @opaque: #optional A free-form string that can be used to describe the fd.
3206 # Returns: @AddfdInfo on success
3207 # If file descriptor was not received, FdNotSupplied
3208 # If @fdset-id is a negative value, InvalidParameterValue
3210 # Notes: The list of fd sets is shared by all monitor connections.
3212 # If @fdset-id is not specified, a new fd set will be created.
3216 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3217 'returns': 'AddfdInfo' }
3222 # Remove a file descriptor from an fd set.
3224 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3226 # @fd: #optional The file descriptor that is to be removed.
3228 # Returns: Nothing on success
3229 # If @fdset-id or @fd is not found, FdNotFound
3233 # Notes: The list of fd sets is shared by all monitor connections.
3235 # If @fd is not specified, all file descriptors in @fdset-id
3238 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3243 # Information about a file descriptor that belongs to an fd set.
3245 # @fd: The file descriptor value.
3247 # @opaque: #optional A free-form string that can be used to describe the fd.
3251 { 'type': 'FdsetFdInfo',
3252 'data': {'fd': 'int', '*opaque': 'str'} }
3257 # Information about an fd set.
3259 # @fdset-id: The ID of the fd set.
3261 # @fds: A list of file descriptors that belong to this fd set.
3265 { 'type': 'FdsetInfo',
3266 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3271 # Return information describing all fd sets.
3273 # Returns: A list of @FdsetInfo
3277 # Note: The list of fd sets is shared by all monitor connections.
3280 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3285 # Information describing the QEMU target.
3287 # @arch: the target architecture (eg "x86_64", "i386", etc)
3291 { 'type': 'TargetInfo',
3292 'data': { 'arch': 'str' } }
3297 # Return information about the target for this QEMU
3299 # Returns: TargetInfo
3303 { 'command': 'query-target', 'returns': 'TargetInfo' }
3308 # An enumeration of key name.
3310 # This is used by the send-key command.
3314 { 'enum': 'QKeyCode',
3315 'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3316 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3317 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3318 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3319 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3320 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3321 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3322 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3323 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3324 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3325 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3326 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3327 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3328 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3329 'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3334 # Represents a keyboard key.
3338 { 'union': 'KeyValue',
3341 'qcode': 'QKeyCode' } }
3346 # Send keys to guest.
3348 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3349 # simultaneously sent to the guest. A @KeyValue.number value is sent
3350 # directly to the guest, while @KeyValue.qcode must be a valid
3353 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3356 # Returns: Nothing on success
3357 # If key is unknown or redundant, InvalidParameter
3362 { 'command': 'send-key',
3363 'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3368 # Write a PPM of the VGA screen to a file.
3370 # @filename: the path of a new PPM file to store the image
3372 # Returns: Nothing on success
3376 { 'command': 'screendump', 'data': {'filename': 'str'} }
3379 # @nbd-server-start:
3381 # Start an NBD server listening on the given host and port. Block
3382 # devices can then be exported using @nbd-server-add. The NBD
3383 # server will present them as named exports; for example, another
3384 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3386 # @addr: Address on which to listen.
3388 # Returns: error if the server is already running.
3392 { 'command': 'nbd-server-start',
3393 'data': { 'addr': 'SocketAddress' } }
3398 # Export a device to QEMU's embedded NBD server.
3400 # @device: Block device to be exported
3402 # @writable: Whether clients should be able to write to the device via the
3403 # NBD connection (default false). #optional
3405 # Returns: error if the device is already marked for export.
3409 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3414 # Stop QEMU's embedded NBD server, and unregister all devices previously
3415 # added via @nbd-server-add.
3419 { 'command': 'nbd-server-stop' }
3424 # Configuration info for file chardevs.
3426 # @in: #optional The name of the input file
3427 # @out: The name of the output file
3431 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3437 # Configuration info for device and pipe chardevs.
3439 # @device: The name of the special file for the device,
3440 # i.e. /dev/ttyS0 on Unix or COM1: on Windows
3441 # @type: What kind of device this is.
3445 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3450 # Configuration info for (stream) socket chardevs.
3452 # @addr: socket address to listen on (server=true)
3453 # or connect to (server=false)
3454 # @server: #optional create server socket (default: true)
3455 # @wait: #optional wait for incoming connection on server
3456 # sockets (default: false).
3457 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3458 # @telnet: #optional enable telnet protocol on server
3459 # sockets (default: false)
3463 { 'type': 'ChardevSocket', 'data': { 'addr' : 'SocketAddress',
3466 '*nodelay' : 'bool',
3467 '*telnet' : 'bool' } }
3472 # Configuration info for datagram socket chardevs.
3474 # @remote: remote address
3475 # @local: #optional local address
3479 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3480 '*local' : 'SocketAddress' } }
3485 # Configuration info for mux chardevs.
3487 # @chardev: name of the base chardev.
3491 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3496 # Configuration info for stdio chardevs.
3498 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3499 # be delivered to qemu. Default: true in -nographic mode,
3504 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3507 # @ChardevSpiceChannel:
3509 # Configuration info for spice vm channel chardevs.
3511 # @type: kind of channel (for example vdagent).
3515 { 'type': 'ChardevSpiceChannel', 'data': { 'type' : 'str' } }
3518 # @ChardevSpicePort:
3520 # Configuration info for spice port chardevs.
3522 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3526 { 'type': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' } }
3531 # Configuration info for virtual console chardevs.
3533 # @width: console width, in pixels
3534 # @height: console height, in pixels
3535 # @cols: console width, in chars
3536 # @rows: console height, in chars
3540 { 'type': 'ChardevVC', 'data': { '*width' : 'int',
3548 # Configuration info for ring buffer chardevs.
3550 # @size: #optional ring buffer size, must be power of two, default is 65536
3554 { 'type': 'ChardevRingbuf', 'data': { '*size' : 'int' } }
3559 # Configuration info for the new chardev backend.
3563 { 'type': 'ChardevDummy', 'data': { } }
3565 { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
3566 'serial' : 'ChardevHostdev',
3567 'parallel': 'ChardevHostdev',
3568 'pipe' : 'ChardevHostdev',
3569 'socket' : 'ChardevSocket',
3570 'udp' : 'ChardevUdp',
3571 'pty' : 'ChardevDummy',
3572 'null' : 'ChardevDummy',
3573 'mux' : 'ChardevMux',
3574 'msmouse': 'ChardevDummy',
3575 'braille': 'ChardevDummy',
3576 'stdio' : 'ChardevStdio',
3577 'console': 'ChardevDummy',
3578 'spicevmc' : 'ChardevSpiceChannel',
3579 'spiceport' : 'ChardevSpicePort',
3581 'ringbuf': 'ChardevRingbuf',
3582 # next one is just for compatibility
3583 'memory' : 'ChardevRingbuf' } }
3588 # Return info about the chardev backend just created.
3590 # @pty: #optional name of the slave pseudoterminal device, present if
3591 # and only if a chardev of type 'pty' was created
3595 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3600 # Add a character device backend
3602 # @id: the chardev's ID, must be unique
3603 # @backend: backend type and parameters
3605 # Returns: ChardevReturn.
3609 { 'command': 'chardev-add', 'data': {'id' : 'str',
3610 'backend' : 'ChardevBackend' },
3611 'returns': 'ChardevReturn' }
3616 # Remove a character device backend
3618 # @id: the chardev's ID, must exist and not be in use
3620 # Returns: Nothing on success
3624 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3629 # An enumeration of TPM models
3631 # @tpm-tis: TPM TIS model
3635 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3638 # @query-tpm-models:
3640 # Return a list of supported TPM models
3642 # Returns: a list of TpmModel
3646 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3651 # An enumeration of TPM types
3653 # @passthrough: TPM passthrough type
3657 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3662 # Return a list of supported TPM types
3664 # Returns: a list of TpmType
3668 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3671 # @TPMPassthroughOptions:
3673 # Information about the TPM passthrough type
3675 # @path: #optional string describing the path used for accessing the TPM device
3677 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3678 # for cancellation of TPM commands while they are executing
3682 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3683 '*cancel-path' : 'str'} }
3688 # A union referencing different TPM backend types' configuration options
3690 # @passthrough: The configuration options for the TPM passthrough type
3694 { 'union': 'TpmTypeOptions',
3695 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3700 # Information about the TPM
3702 # @id: The Id of the TPM
3704 # @model: The TPM frontend model
3706 # @options: The TPM (backend) type configuration options
3710 { 'type': 'TPMInfo',
3711 'data': {'id': 'str',
3712 'model': 'TpmModel',
3713 'options': 'TpmTypeOptions' } }
3718 # Return information about the TPM device
3720 # Returns: @TPMInfo on success
3724 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3729 # Specify an ACPI table on the command line to load.
3731 # At most one of @file and @data can be specified. The list of files specified
3732 # by any one of them is loaded and concatenated in order. If both are omitted,
3735 # Other fields / optargs can be used to override fields of the generic ACPI
3736 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3737 # Description Table Header. If a header field is not overridden, then the
3738 # corresponding value from the concatenated blob is used (in case of @file), or
3739 # it is filled in with a hard-coded value (in case of @data).
3741 # String fields are copied into the matching ACPI member from lowest address
3742 # upwards, and silently truncated / NUL-padded to length.
3744 # @sig: #optional table signature / identifier (4 bytes)
3746 # @rev: #optional table revision number (dependent on signature, 1 byte)
3748 # @oem_id: #optional OEM identifier (6 bytes)
3750 # @oem_table_id: #optional OEM table identifier (8 bytes)
3752 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3754 # @asl_compiler_id: #optional identifier of the utility that created the table
3757 # @asl_compiler_rev: #optional revision number of the utility that created the
3760 # @file: #optional colon (:) separated list of pathnames to load and
3761 # concatenate as table data. The resultant binary blob is expected to
3762 # have an ACPI table header. At least one file is required. This field
3765 # @data: #optional colon (:) separated list of pathnames to load and
3766 # concatenate as table data. The resultant binary blob must not have an
3767 # ACPI table header. At least one file is required. This field excludes
3772 { 'type': 'AcpiTableOptions',
3777 '*oem_table_id': 'str',
3778 '*oem_rev': 'uint32',
3779 '*asl_compiler_id': 'str',
3780 '*asl_compiler_rev': 'uint32',
3785 # @CommandLineParameterType:
3787 # Possible types for an option parameter.
3789 # @string: accepts a character string
3791 # @boolean: accepts "on" or "off"
3793 # @number: accepts a number
3795 # @size: accepts a number followed by an optional suffix (K)ilo,
3796 # (M)ega, (G)iga, (T)era
3800 { 'enum': 'CommandLineParameterType',
3801 'data': ['string', 'boolean', 'number', 'size'] }
3804 # @CommandLineParameterInfo:
3806 # Details about a single parameter of a command line option.
3808 # @name: parameter name
3810 # @type: parameter @CommandLineParameterType
3812 # @help: #optional human readable text string, not suitable for parsing.
3816 { 'type': 'CommandLineParameterInfo',
3817 'data': { 'name': 'str',
3818 'type': 'CommandLineParameterType',
3822 # @CommandLineOptionInfo:
3824 # Details about a command line option, including its list of parameter details
3826 # @option: option name
3828 # @parameters: an array of @CommandLineParameterInfo
3832 { 'type': 'CommandLineOptionInfo',
3833 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3836 # @query-command-line-options:
3838 # Query command line option schema.
3840 # @option: #optional option name
3842 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3843 # @option). Returns an error if the given @option doesn't exist.
3847 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3848 'returns': ['CommandLineOptionInfo'] }
3853 # A X86 32-bit register
3857 { 'enum': 'X86CPURegister32',
3858 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3861 # @X86CPUFeatureWordInfo
3863 # Information about a X86 CPU feature word
3865 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3867 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3870 # @cpuid-register: Output register containing the feature bits
3872 # @features: value of output register, containing the feature bits
3876 { 'type': 'X86CPUFeatureWordInfo',
3877 'data': { 'cpuid-input-eax': 'int',
3878 '*cpuid-input-ecx': 'int',
3879 'cpuid-register': 'X86CPURegister32',
3880 'features': 'int' } }
3885 # Packets receiving state
3887 # @normal: filter assigned packets according to the mac-table
3889 # @none: don't receive any assigned packet
3891 # @all: receive all assigned packets
3895 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
3900 # Rx-filter information for a NIC.
3902 # @name: net client name
3904 # @promiscuous: whether promiscuous mode is enabled
3906 # @multicast: multicast receive state
3908 # @unicast: unicast receive state
3910 # @broadcast-allowed: whether to receive broadcast
3912 # @multicast-overflow: multicast table is overflowed or not
3914 # @unicast-overflow: unicast table is overflowed or not
3916 # @main-mac: the main macaddr string
3918 # @vlan-table: a list of active vlan id
3920 # @unicast-table: a list of unicast macaddr string
3922 # @multicast-table: a list of multicast macaddr string
3927 { 'type': 'RxFilterInfo',
3930 'promiscuous': 'bool',
3931 'multicast': 'RxState',
3932 'unicast': 'RxState',
3933 'broadcast-allowed': 'bool',
3934 'multicast-overflow': 'bool',
3935 'unicast-overflow': 'bool',
3937 'vlan-table': ['int'],
3938 'unicast-table': ['str'],
3939 'multicast-table': ['str'] }}
3944 # Return rx-filter information for all NICs (or for the given NIC).
3946 # @name: #optional net client name
3948 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
3949 # Returns an error if the given @name doesn't exist, or given
3950 # NIC doesn't support rx-filter querying, or given net client
3955 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
3956 'returns': ['RxFilterInfo'] }
3960 # @BlockdevDiscardOptions
3962 # Determines how to handle discard requests.
3964 # @ignore: Ignore the request
3965 # @unmap: Forward as an unmap request
3969 { 'enum': 'BlockdevDiscardOptions',
3970 'data': [ 'ignore', 'unmap' ] }
3973 # @BlockdevAioOptions
3975 # Selects the AIO backend to handle I/O requests
3977 # @threads: Use qemu's thread pool
3978 # @native: Use native AIO backend (only Linux and Windows)
3982 { 'enum': 'BlockdevAioOptions',
3983 'data': [ 'threads', 'native' ] }
3986 # @BlockdevCacheOptions
3988 # Includes cache-related options for block devices
3990 # @writeback: #optional enables writeback mode for any caches (default: true)
3991 # @direct: #optional enables use of O_DIRECT (bypass the host page cache;
3993 # @no-flush: #optional ignore any flush requests for the device (default:
3998 { 'type': 'BlockdevCacheOptions',
3999 'data': { '*writeback': 'bool',
4001 '*no-flush': 'bool' } }
4004 # @BlockdevOptionsBase
4006 # Options that are available for all block devices, independent of the block
4009 # @driver: block driver name
4010 # @id: #optional id by which the new block device can be referred to.
4011 # This is a required option on the top level of blockdev-add, and
4012 # currently not allowed on any other level.
4013 # @discard: #optional discard-related options (default: ignore)
4014 # @cache: #optional cache-related options
4015 # @aio: #optional AIO backend (default: threads)
4016 # @rerror: #optional how to handle read errors on the device
4018 # @werror: #optional how to handle write errors on the device
4020 # @read-only: #optional whether the block device should be read-only
4025 { 'type': 'BlockdevOptionsBase',
4026 'data': { 'driver': 'str',
4028 '*discard': 'BlockdevDiscardOptions',
4029 '*cache': 'BlockdevCacheOptions',
4030 '*aio': 'BlockdevAioOptions',
4031 '*rerror': 'BlockdevOnError',
4032 '*werror': 'BlockdevOnError',
4033 '*read-only': 'bool' } }
4036 # @BlockdevOptionsFile
4038 # Driver specific block device options for the file backend and similar
4041 # @filename: path to the image file
4045 { 'type': 'BlockdevOptionsFile',
4046 'data': { 'filename': 'str' } }
4049 # @BlockdevOptionsVVFAT
4051 # Driver specific block device options for the vvfat protocol.
4053 # @dir: directory to be exported as FAT image
4054 # @fat-type: #optional FAT type: 12, 16 or 32
4055 # @floppy: #optional whether to export a floppy image (true) or
4056 # partitioned hard disk (false; default)
4057 # @rw: #optional whether to allow write operations (default: false)
4061 { 'type': 'BlockdevOptionsVVFAT',
4062 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4066 # @BlockdevOptionsGenericFormat
4068 # Driver specific block device options for image format that have no option
4069 # besides their data source.
4071 # @file: reference to or definition of the data source block device
4075 { 'type': 'BlockdevOptionsGenericFormat',
4076 'data': { 'file': 'BlockdevRef' } }
4079 # @BlockdevOptionsGenericCOWFormat
4081 # Driver specific block device options for image format that have no option
4082 # besides their data source and an optional backing file.
4084 # @backing: #optional reference to or definition of the backing file block
4085 # device (if missing, taken from the image file content). It is
4086 # allowed to pass an empty string here in order to disable the
4087 # default backing file.
4091 { 'type': 'BlockdevOptionsGenericCOWFormat',
4092 'base': 'BlockdevOptionsGenericFormat',
4093 'data': { '*backing': 'BlockdevRef' } }
4096 # @BlockdevOptionsQcow2
4098 # Driver specific block device options for qcow2.
4100 # @lazy-refcounts: #optional whether to enable the lazy refcounts
4101 # feature (default is taken from the image file)
4103 # @pass-discard-request: #optional whether discard requests to the qcow2
4104 # device should be forwarded to the data source
4106 # @pass-discard-snapshot: #optional whether discard requests for the data source
4107 # should be issued when a snapshot operation (e.g.
4108 # deleting a snapshot) frees clusters in the qcow2 file
4110 # @pass-discard-other: #optional whether discard requests for the data source
4111 # should be issued on other occasions where a cluster
4116 { 'type': 'BlockdevOptionsQcow2',
4117 'base': 'BlockdevOptionsGenericCOWFormat',
4118 'data': { '*lazy-refcounts': 'bool',
4119 '*pass-discard-request': 'bool',
4120 '*pass-discard-snapshot': 'bool',
4121 '*pass-discard-other': 'bool' } }
4126 # Options for creating a block device.
4130 { 'union': 'BlockdevOptions',
4131 'base': 'BlockdevOptionsBase',
4132 'discriminator': 'driver',
4134 'file': 'BlockdevOptionsFile',
4135 'http': 'BlockdevOptionsFile',
4136 'https': 'BlockdevOptionsFile',
4137 'ftp': 'BlockdevOptionsFile',
4138 'ftps': 'BlockdevOptionsFile',
4139 'tftp': 'BlockdevOptionsFile',
4140 # TODO gluster: Wait for structured options
4141 # TODO iscsi: Wait for structured options
4142 # TODO nbd: Should take InetSocketAddress for 'host'?
4143 # TODO rbd: Wait for structured options
4144 # TODO sheepdog: Wait for structured options
4145 # TODO ssh: Should take InetSocketAddress for 'host'?
4146 'vvfat': 'BlockdevOptionsVVFAT',
4148 # TODO blkdebug: Wait for structured options
4149 # TODO blkverify: Wait for structured options
4151 'bochs': 'BlockdevOptionsGenericFormat',
4152 'cloop': 'BlockdevOptionsGenericFormat',
4153 'cow': 'BlockdevOptionsGenericCOWFormat',
4154 'dmg': 'BlockdevOptionsGenericFormat',
4155 'parallels': 'BlockdevOptionsGenericFormat',
4156 'qcow': 'BlockdevOptionsGenericCOWFormat',
4157 'qcow2': 'BlockdevOptionsQcow2',
4158 'qed': 'BlockdevOptionsGenericCOWFormat',
4159 'raw': 'BlockdevOptionsGenericFormat',
4160 'vdi': 'BlockdevOptionsGenericFormat',
4161 'vhdx': 'BlockdevOptionsGenericFormat',
4162 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4163 'vpc': 'BlockdevOptionsGenericFormat'
4169 # Reference to a block device.
4171 # @definition: defines a new block device inline
4172 # @reference: references the ID of an existing block device. An
4173 # empty string means that no block device should be
4178 { 'union': 'BlockdevRef',
4179 'discriminator': {},
4180 'data': { 'definition': 'BlockdevOptions',
4181 'reference': 'str' } }
4186 # Creates a new block device.
4188 # @options: block device options for the new device
4192 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }