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 # @ImageInfoSpecificVmdk:
230 # @create-type: The create type of VMDK image
232 # @cid: Content id of image
234 # @parent-cid: Parent VMDK image's cid
236 # @extents: List of extent files
240 { 'type': 'ImageInfoSpecificVmdk',
242 'create-type': 'str',
245 'extents': ['ImageInfo']
249 # @ImageInfoSpecific:
251 # A discriminated record of image format specific information structures.
256 { 'union': 'ImageInfoSpecific',
258 'qcow2': 'ImageInfoSpecificQCow2',
259 'vmdk': 'ImageInfoSpecificVmdk'
265 # Information about a QEMU image file
267 # @filename: name of the image file
269 # @format: format of the image file
271 # @virtual-size: maximum capacity in bytes of the image
273 # @actual-size: #optional actual size on disk in bytes of the image
275 # @dirty-flag: #optional true if image is not cleanly closed
277 # @cluster-size: #optional size of a cluster in bytes
279 # @encrypted: #optional true if the image is encrypted
281 # @compressed: #optional true if the image is compressed (Since 1.7)
283 # @backing-filename: #optional name of the backing file
285 # @full-backing-filename: #optional full path of the backing file
287 # @backing-filename-format: #optional the format of the backing file
289 # @snapshots: #optional list of VM snapshots
291 # @backing-image: #optional info of the backing image (since 1.6)
293 # @format-specific: #optional structure supplying additional format-specific
294 # information (since 1.7)
300 { 'type': 'ImageInfo',
301 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
302 '*actual-size': 'int', 'virtual-size': 'int',
303 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
304 '*backing-filename': 'str', '*full-backing-filename': 'str',
305 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
306 '*backing-image': 'ImageInfo',
307 '*format-specific': 'ImageInfoSpecific' } }
312 # Information about a QEMU image file check
314 # @filename: name of the image file checked
316 # @format: format of the image file checked
318 # @check-errors: number of unexpected errors occurred during check
320 # @image-end-offset: #optional offset (in bytes) where the image ends, this
321 # field is present if the driver for the image format
324 # @corruptions: #optional number of corruptions found during the check if any
326 # @leaks: #optional number of leaks found during the check if any
328 # @corruptions-fixed: #optional number of corruptions fixed during the check
331 # @leaks-fixed: #optional number of leaks fixed during the check if any
333 # @total-clusters: #optional total number of clusters, this field is present
334 # if the driver for the image format supports it
336 # @allocated-clusters: #optional total number of allocated clusters, this
337 # field is present if the driver for the image format
340 # @fragmented-clusters: #optional total number of fragmented clusters, this
341 # field is present if the driver for the image format
344 # @compressed-clusters: #optional total number of compressed clusters, this
345 # field is present if the driver for the image format
352 { 'type': 'ImageCheck',
353 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
354 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
355 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
356 '*total-clusters': 'int', '*allocated-clusters': 'int',
357 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
362 # Information about VCPU run state
364 # @running: true if all VCPUs are runnable, false if not runnable
366 # @singlestep: true if VCPUs are in single-step mode
368 # @status: the virtual machine @RunState
372 # Notes: @singlestep is enabled through the GDB stub
374 { 'type': 'StatusInfo',
375 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
380 # Query the run status of all VCPUs
382 # Returns: @StatusInfo reflecting all VCPUs
386 { 'command': 'query-status', 'returns': 'StatusInfo' }
391 # Guest UUID information.
393 # @UUID: the UUID of the guest
397 # Notes: If no UUID was specified for the guest, a null UUID is returned.
399 { 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
404 # Query the guest UUID information.
406 # Returns: The @UuidInfo for the guest
410 { 'command': 'query-uuid', 'returns': 'UuidInfo' }
415 # Information about a character device.
417 # @label: the label of the character device
419 # @filename: the filename of the character device
421 # Notes: @filename is encoded using the QEMU command line character device
422 # encoding. See the QEMU man page for details.
426 { 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
431 # Returns information about current character devices.
433 # Returns: a list of @ChardevInfo
437 { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
442 # An enumeration of data format.
444 # @utf8: Data is a UTF-8 string (RFC 3629)
446 # @base64: Data is Base64 encoded binary (RFC 3548)
450 { 'enum': 'DataFormat',
451 'data': [ 'utf8', 'base64' ] }
456 # Write to a ring buffer character device.
458 # @device: the ring buffer character device name
460 # @data: data to write
462 # @format: #optional data encoding (default 'utf8').
463 # - base64: data must be base64 encoded text. Its binary
464 # decoding gets written.
465 # Bug: invalid base64 is currently not rejected.
466 # Whitespace *is* invalid.
467 # - utf8: data's UTF-8 encoding is written
468 # - data itself is always Unicode regardless of format, like
471 # Returns: Nothing on success
475 { 'command': 'ringbuf-write',
476 'data': {'device': 'str', 'data': 'str',
477 '*format': 'DataFormat'} }
482 # Read from a ring buffer character device.
484 # @device: the ring buffer character device name
486 # @size: how many bytes to read at most
488 # @format: #optional data encoding (default 'utf8').
489 # - base64: the data read is returned in base64 encoding.
490 # - utf8: the data read is interpreted as UTF-8.
491 # Bug: can screw up when the buffer contains invalid UTF-8
492 # sequences, NUL characters, after the ring buffer lost
493 # data, and when reading stops because the size limit is
495 # - The return value is always Unicode regardless of format,
496 # like any other string.
498 # Returns: data read from the device
502 { 'command': 'ringbuf-read',
503 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
509 # Information about a QMP command
511 # @name: The command name
515 { 'type': 'CommandInfo', 'data': {'name': 'str'} }
520 # Return a list of supported QMP commands by this server
522 # Returns: A list of @CommandInfo for all supported commands
526 { 'command': 'query-commands', 'returns': ['CommandInfo'] }
531 # Information about a QMP event
533 # @name: The event name
537 { 'type': 'EventInfo', 'data': {'name': 'str'} }
542 # Return a list of supported QMP events by this server
544 # Returns: A list of @EventInfo for all supported events
548 { 'command': 'query-events', 'returns': ['EventInfo'] }
553 # Detailed migration status.
555 # @transferred: amount of bytes already transferred to the target VM
557 # @remaining: amount of bytes remaining to be transferred to the target VM
559 # @total: total amount of bytes involved in the migration process
561 # @duplicate: number of duplicate (zero) pages (since 1.2)
563 # @skipped: number of skipped zero pages (since 1.5)
565 # @normal : number of normal pages (since 1.2)
567 # @normal-bytes: number of normal bytes sent (since 1.2)
569 # @dirty-pages-rate: number of pages dirtied by second by the
572 # @mbps: throughput in megabits/sec. (since 1.6)
576 { 'type': 'MigrationStats',
577 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
578 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
579 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
580 'mbps' : 'number' } }
585 # Detailed XBZRLE migration cache statistics
587 # @cache-size: XBZRLE cache size
589 # @bytes: amount of bytes already transferred to the target VM
591 # @pages: amount of pages transferred to the target VM
593 # @cache-miss: number of cache miss
595 # @overflow: number of overflows
599 { 'type': 'XBZRLECacheStats',
600 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
601 'cache-miss': 'int', 'overflow': 'int' } }
606 # Information about current migration process.
608 # @status: #optional string describing the current migration status.
609 # As of 0.14.0 this can be 'active', 'completed', 'failed' or
610 # 'cancelled'. If this field is not returned, no migration process
613 # @ram: #optional @MigrationStats containing detailed migration
614 # status, only returned if status is 'active' or
615 # 'completed'. 'comppleted' (since 1.2)
617 # @disk: #optional @MigrationStats containing detailed disk migration
618 # status, only returned if status is 'active' and it is a block
621 # @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
622 # migration statistics, only returned if XBZRLE feature is on and
623 # status is 'active' or 'completed' (since 1.2)
625 # @total-time: #optional total amount of milliseconds since migration started.
626 # If migration has ended, it returns the total migration
629 # @downtime: #optional only present when migration finishes correctly
630 # total downtime in milliseconds for the guest.
633 # @expected-downtime: #optional only present while migration is active
634 # expected downtime in milliseconds for the guest in last walk
635 # of the dirty bitmap. (since 1.3)
637 # @setup-time: #optional amount of setup time in milliseconds _before_ the
638 # iterations begin but _after_ the QMP command is issued. This is designed
639 # to provide an accounting of any activities (such as RDMA pinning) which
640 # may be expensive, but do not actually occur during the iterative
641 # migration rounds themselves. (since 1.6)
645 { 'type': 'MigrationInfo',
646 'data': {'*status': 'str', '*ram': 'MigrationStats',
647 '*disk': 'MigrationStats',
648 '*xbzrle-cache': 'XBZRLECacheStats',
649 '*total-time': 'int',
650 '*expected-downtime': 'int',
652 '*setup-time': 'int'} }
657 # Returns information about current migration process.
659 # Returns: @MigrationInfo
663 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
666 # @MigrationCapability
668 # Migration capabilities enumeration
670 # @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
671 # This feature allows us to minimize migration traffic for certain work
672 # loads, by sending compressed difference of the pages
674 # @x-rdma-pin-all: Controls whether or not the entire VM memory footprint is
675 # mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
676 # Disabled by default. Experimental: may (or may not) be renamed after
677 # further testing is complete. (since 1.6)
679 # @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
680 # essentially saves 1MB of zeroes per block on the wire. Enabling requires
681 # source and target VM to support this feature. To enable it is sufficient
682 # to enable the capability on the source VM. The feature is disabled by
683 # default. (since 1.6)
685 # @auto-converge: If enabled, QEMU will automatically throttle down the guest
686 # to speed up convergence of RAM migration. (since 1.6)
690 { 'enum': 'MigrationCapability',
691 'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] }
694 # @MigrationCapabilityStatus
696 # Migration capability information
698 # @capability: capability enum
700 # @state: capability state bool
704 { 'type': 'MigrationCapabilityStatus',
705 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
708 # @migrate-set-capabilities
710 # Enable/Disable the following migration capabilities (like xbzrle)
712 # @capabilities: json array of capability modifications to make
716 { 'command': 'migrate-set-capabilities',
717 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
720 # @query-migrate-capabilities
722 # Returns information about the current migration capabilities status
724 # Returns: @MigrationCapabilitiesStatus
728 { 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
733 # Information about a mouse device.
735 # @name: the name of the mouse device
737 # @index: the index of the mouse device
739 # @current: true if this device is currently receiving mouse events
741 # @absolute: true if this device supports absolute coordinates as input
745 { 'type': 'MouseInfo',
746 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
747 'absolute': 'bool'} }
752 # Returns information about each active mouse device
754 # Returns: a list of @MouseInfo for each device
758 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
763 # Information about a virtual CPU
765 # @CPU: the index of the virtual CPU
767 # @current: this only exists for backwards compatible and should be ignored
769 # @halted: true if the virtual CPU is in the halt state. Halt usually refers
770 # to a processor specific low power mode.
772 # @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
774 # If the target is Sparc, this is the PC component of the
775 # instruction pointer.
777 # @nip: #optional If the target is PPC, the instruction pointer
779 # @npc: #optional If the target is Sparc, the NPC component of the instruction
782 # @PC: #optional If the target is MIPS, the instruction pointer
784 # @thread_id: ID of the underlying host thread
788 # Notes: @halted is a transient state that changes frequently. By the time the
789 # data is sent to the client, the guest may no longer be halted.
792 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
793 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
798 # Returns a list of information about each virtual CPU.
800 # Returns: a list of @CpuInfo for each virtual CPU
804 { 'command': 'query-cpus', 'returns': ['CpuInfo'] }
809 # Information about the backing device for a block device.
811 # @file: the filename of the backing device
813 # @ro: true if the backing device was open read-only
815 # @drv: the name of the block format used to open the backing device. As of
816 # 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
817 # 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
818 # 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
819 # 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
821 # @backing_file: #optional the name of the backing file (for copy-on-write)
823 # @backing_file_depth: number of files in the backing file chain (since: 1.2)
825 # @encrypted: true if the backing device is encrypted
827 # @encryption_key_missing: true if the backing device is encrypted but an
828 # valid encryption key is missing
830 # @bps: total throughput limit in bytes per second is specified
832 # @bps_rd: read throughput limit in bytes per second is specified
834 # @bps_wr: write throughput limit in bytes per second is specified
836 # @iops: total I/O operations per second is specified
838 # @iops_rd: read I/O operations per second is specified
840 # @iops_wr: write I/O operations per second is specified
842 # @image: the info of image used (since: 1.6)
844 # @bps_max: #optional total max in bytes (Since 1.7)
846 # @bps_rd_max: #optional read max in bytes (Since 1.7)
848 # @bps_wr_max: #optional write max in bytes (Since 1.7)
850 # @iops_max: #optional total I/O operations max (Since 1.7)
852 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
854 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
856 # @iops_size: #optional an I/O size in bytes (Since 1.7)
860 # Notes: This interface is only found in @BlockInfo.
862 { 'type': 'BlockDeviceInfo',
863 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
864 '*backing_file': 'str', 'backing_file_depth': 'int',
865 'encrypted': 'bool', 'encryption_key_missing': 'bool',
866 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
867 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
868 'image': 'ImageInfo',
869 '*bps_max': 'int', '*bps_rd_max': 'int',
870 '*bps_wr_max': 'int', '*iops_max': 'int',
871 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
872 '*iops_size': 'int' } }
875 # @BlockDeviceIoStatus:
877 # An enumeration of block device I/O status.
879 # @ok: The last I/O operation has succeeded
881 # @failed: The last I/O operation has failed
883 # @nospace: The last I/O operation has failed due to a no-space condition
887 { 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
890 # @BlockDeviceMapEntry:
892 # Entry in the metadata map of the device (returned by "qemu-img map")
894 # @start: Offset in the image of the first byte described by this entry
897 # @length: Length of the range described by this entry (in bytes)
899 # @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
900 # before reaching one for which the range is allocated. The value is
901 # in the range 0 to the depth of the image chain - 1.
903 # @zero: the sectors in this range read as zeros
905 # @data: reading the image will actually read data from a file (in particular,
906 # if @offset is present this means that the sectors are not simply
907 # preallocated, but contain actual data in raw format)
909 # @offset: if present, the image file stores the data for this range in
910 # raw format at the given offset.
914 { 'type': 'BlockDeviceMapEntry',
915 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
916 'data': 'bool', '*offset': 'int' } }
921 # Block dirty bitmap information.
923 # @count: number of dirty bytes according to the dirty bitmap
925 # @granularity: granularity of the dirty bitmap in bytes (since 1.4)
929 { 'type': 'BlockDirtyInfo',
930 'data': {'count': 'int', 'granularity': 'int'} }
935 # Block device information. This structure describes a virtual device and
936 # the backing device associated with it.
938 # @device: The device name associated with the virtual device.
940 # @type: This field is returned only for compatibility reasons, it should
941 # not be used (always returns 'unknown')
943 # @removable: True if the device supports removable media.
945 # @locked: True if the guest has locked this device from having its media
948 # @tray_open: #optional True if the device has a tray and it is open
949 # (only present if removable is true)
951 # @dirty: #optional dirty bitmap information (only present if the dirty
954 # @io-status: #optional @BlockDeviceIoStatus. Only present if the device
955 # supports it and the VM is configured to stop on errors
957 # @inserted: #optional @BlockDeviceInfo describing the device if media is
962 { 'type': 'BlockInfo',
963 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
964 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
965 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
966 '*dirty': 'BlockDirtyInfo' } }
971 # Get a list of BlockInfo for all virtual block devices.
973 # Returns: a list of @BlockInfo describing each virtual block device
977 { 'command': 'query-block', 'returns': ['BlockInfo'] }
982 # Statistics of a virtual block device or a block backing device.
984 # @rd_bytes: The number of bytes read by the device.
986 # @wr_bytes: The number of bytes written by the device.
988 # @rd_operations: The number of read operations performed by the device.
990 # @wr_operations: The number of write operations performed by the device.
992 # @flush_operations: The number of cache flush operations performed by the
993 # device (since 0.15.0)
995 # @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
998 # @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1000 # @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1002 # @wr_highest_offset: The offset after the greatest byte written to the
1003 # device. The intended use of this information is for
1004 # growable sparse files (like qcow2) that are used on top
1005 # of a physical device.
1009 { 'type': 'BlockDeviceStats',
1010 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1011 'wr_operations': 'int', 'flush_operations': 'int',
1012 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1013 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1018 # Statistics of a virtual block device or a block backing device.
1020 # @device: #optional If the stats are for a virtual block device, the name
1021 # corresponding to the virtual block device.
1023 # @stats: A @BlockDeviceStats for the device.
1025 # @parent: #optional This may point to the backing block device if this is a
1026 # a virtual block device. If it's a backing block, this will point
1027 # to the backing file is one is present.
1031 { 'type': 'BlockStats',
1032 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
1033 '*parent': 'BlockStats'} }
1036 # @query-blockstats:
1038 # Query the @BlockStats for all virtual block devices.
1040 # Returns: A list of @BlockStats for each virtual block devices.
1044 { 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1049 # Information about a connected VNC client.
1051 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
1054 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1055 # 'ipv4' if the client is connected via IPv4 and TCP
1056 # 'unix' if the client is connected via a unix domain socket
1057 # 'unknown' otherwise
1059 # @service: The service name of the client's port. This may depends on the
1060 # host system's service database so symbolic names should not be
1063 # @x509_dname: #optional If x509 authentication is in use, the Distinguished
1064 # Name of the client.
1066 # @sasl_username: #optional If SASL authentication is in use, the SASL username
1067 # used for authentication.
1071 { 'type': 'VncClientInfo',
1072 'data': {'host': 'str', 'family': 'str', 'service': 'str',
1073 '*x509_dname': 'str', '*sasl_username': 'str'} }
1078 # Information about the VNC session.
1080 # @enabled: true if the VNC server is enabled, false otherwise
1082 # @host: #optional The hostname the VNC server is bound to. This depends on
1083 # the name resolution on the host and may be an IP address.
1085 # @family: #optional 'ipv6' if the host is listening for IPv6 connections
1086 # 'ipv4' if the host is listening for IPv4 connections
1087 # 'unix' if the host is listening on a unix domain socket
1088 # 'unknown' otherwise
1090 # @service: #optional The service name of the server's port. This may depends
1091 # on the host system's service database so symbolic names should not
1094 # @auth: #optional the current authentication type used by the server
1095 # 'none' if no authentication is being used
1096 # 'vnc' if VNC authentication is being used
1097 # 'vencrypt+plain' if VEncrypt is used with plain text authentication
1098 # 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1099 # 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1100 # 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1101 # 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1102 # 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1103 # 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1104 # 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1105 # 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1107 # @clients: a list of @VncClientInfo of all currently connected clients
1111 { 'type': 'VncInfo',
1112 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1113 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1118 # Returns information about the current VNC server
1124 { 'command': 'query-vnc', 'returns': 'VncInfo' }
1129 # Information about a SPICE client channel.
1131 # @host: The host name of the client. QEMU tries to resolve this to a DNS name
1134 # @family: 'ipv6' if the client is connected via IPv6 and TCP
1135 # 'ipv4' if the client is connected via IPv4 and TCP
1136 # 'unix' if the client is connected via a unix domain socket
1137 # 'unknown' otherwise
1139 # @port: The client's port number.
1141 # @connection-id: SPICE connection id number. All channels with the same id
1142 # belong to the same SPICE session.
1144 # @connection-type: SPICE channel type number. "1" is the main control
1145 # channel, filter for this one if you want to track spice
1148 # @channel-id: SPICE channel ID number. Usually "0", might be different when
1149 # multiple channels of the same type exist, such as multiple
1150 # display channels in a multihead setup
1152 # @tls: true if the channel is encrypted, false otherwise.
1156 { 'type': 'SpiceChannel',
1157 'data': {'host': 'str', 'family': 'str', 'port': 'str',
1158 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1162 # @SpiceQueryMouseMode
1164 # An enumeration of Spice mouse states.
1166 # @client: Mouse cursor position is determined by the client.
1168 # @server: Mouse cursor position is determined by the server.
1170 # @unknown: No information is available about mouse mode used by
1173 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1177 { 'enum': 'SpiceQueryMouseMode',
1178 'data': [ 'client', 'server', 'unknown' ] }
1183 # Information about the SPICE session.
1185 # @enabled: true if the SPICE server is enabled, false otherwise
1187 # @migrated: true if the last guest migration completed and spice
1188 # migration had completed as well. false otherwise.
1190 # @host: #optional The hostname the SPICE server is bound to. This depends on
1191 # the name resolution on the host and may be an IP address.
1193 # @port: #optional The SPICE server's port number.
1195 # @compiled-version: #optional SPICE server version.
1197 # @tls-port: #optional The SPICE server's TLS port number.
1199 # @auth: #optional the current authentication type used by the server
1200 # 'none' if no authentication is being used
1201 # 'spice' uses SASL or direct TLS authentication, depending on command
1204 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1205 # be determined by the client or the server, or unknown if spice
1206 # server doesn't provide this information.
1210 # @channels: a list of @SpiceChannel for each active spice channel
1214 { 'type': 'SpiceInfo',
1215 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
1216 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
1217 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
1222 # Returns information about the current SPICE server
1224 # Returns: @SpiceInfo
1228 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
1233 # Information about the guest balloon device.
1235 # @actual: the number of bytes the balloon currently contains
1240 { 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
1245 # Return information about the balloon device.
1247 # Returns: @BalloonInfo on success
1248 # If the balloon driver is enabled but not functional because the KVM
1249 # kernel module cannot support it, KvmMissingCap
1250 # If no balloon device is present, DeviceNotActive
1254 { 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1259 # A PCI device memory region
1261 # @base: the starting address (guest physical)
1263 # @limit: the ending address (guest physical)
1267 { 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1272 # Information about a PCI device I/O region.
1274 # @bar: the index of the Base Address Register for this region
1276 # @type: 'io' if the region is a PIO region
1277 # 'memory' if the region is a MMIO region
1279 # @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1281 # @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1285 { 'type': 'PciMemoryRegion',
1286 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1287 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1292 # Information about a PCI Bridge device
1294 # @bus.number: primary bus interface number. This should be the number of the
1295 # bus the device resides on.
1297 # @bus.secondary: secondary bus interface number. This is the number of the
1298 # main bus for the bridge
1300 # @bus.subordinate: This is the highest number bus that resides below the
1303 # @bus.io_range: The PIO range for all devices on this bridge
1305 # @bus.memory_range: The MMIO range for all devices on this bridge
1307 # @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1310 # @devices: a list of @PciDeviceInfo for each device on this bridge
1314 { 'type': 'PciBridgeInfo',
1315 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1316 'io_range': 'PciMemoryRange',
1317 'memory_range': 'PciMemoryRange',
1318 'prefetchable_range': 'PciMemoryRange' },
1319 '*devices': ['PciDeviceInfo']} }
1324 # Information about a PCI device
1326 # @bus: the bus number of the device
1328 # @slot: the slot the device is located in
1330 # @function: the function of the slot used by the device
1332 # @class_info.desc: #optional a string description of the device's class
1334 # @class_info.class: the class code of the device
1336 # @id.device: the PCI device id
1338 # @id.vendor: the PCI vendor id
1340 # @irq: #optional if an IRQ is assigned to the device, the IRQ number
1342 # @qdev_id: the device name of the PCI device
1344 # @pci_bridge: if the device is a PCI bridge, the bridge information
1346 # @regions: a list of the PCI I/O regions associated with the device
1348 # Notes: the contents of @class_info.desc are not stable and should only be
1349 # treated as informational.
1353 { 'type': 'PciDeviceInfo',
1354 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1355 'class_info': {'*desc': 'str', 'class': 'int'},
1356 'id': {'device': 'int', 'vendor': 'int'},
1357 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1358 'regions': ['PciMemoryRegion']} }
1363 # Information about a PCI bus
1365 # @bus: the bus index
1367 # @devices: a list of devices on this bus
1371 { 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1376 # Return information about the PCI bus topology of the guest.
1378 # Returns: a list of @PciInfo for each PCI bus
1382 { 'command': 'query-pci', 'returns': ['PciInfo'] }
1387 # An enumeration of possible behaviors for errors on I/O operations.
1388 # The exact meaning depends on whether the I/O was initiated by a guest
1391 # @report: for guest operations, report the error to the guest;
1392 # for jobs, cancel the job
1394 # @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1395 # or BLOCK_JOB_ERROR)
1397 # @enospc: same as @stop on ENOSPC, same as @report otherwise.
1399 # @stop: for guest operations, stop the virtual machine;
1400 # for jobs, pause the job
1404 { 'enum': 'BlockdevOnError',
1405 'data': ['report', 'ignore', 'enospc', 'stop'] }
1410 # An enumeration of possible behaviors for the initial synchronization
1411 # phase of storage mirroring.
1413 # @top: copies data in the topmost image to the destination
1415 # @full: copies data from all images to the destination
1417 # @none: only copy data written from now on
1421 { 'enum': 'MirrorSyncMode',
1422 'data': ['top', 'full', 'none'] }
1427 # Type of a block job.
1429 # @commit: block commit job type, see "block-commit"
1431 # @stream: block stream job type, see "block-stream"
1433 # @mirror: drive mirror job type, see "drive-mirror"
1435 # @backup: drive backup job type, see "drive-backup"
1439 { 'enum': 'BlockJobType',
1440 'data': ['commit', 'stream', 'mirror', 'backup'] }
1445 # Information about a long-running block device operation.
1447 # @type: the job type ('stream' for image streaming)
1449 # @device: the block device name
1451 # @len: the maximum progress value
1453 # @busy: false if the job is known to be in a quiescent state, with
1454 # no pending I/O. Since 1.3.
1456 # @paused: whether the job is paused or, if @busy is true, will
1457 # pause itself as soon as possible. Since 1.3.
1459 # @offset: the current progress value
1461 # @speed: the rate limit, bytes per second
1463 # @io-status: the status of the job (since 1.3)
1467 { 'type': 'BlockJobInfo',
1468 'data': {'type': 'str', 'device': 'str', 'len': 'int',
1469 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1470 'io-status': 'BlockDeviceIoStatus'} }
1473 # @query-block-jobs:
1475 # Return information about long-running block device operations.
1477 # Returns: a list of @BlockJobInfo for each active block job
1481 { 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1486 # This command will cause the QEMU process to exit gracefully. While every
1487 # attempt is made to send the QMP response before terminating, this is not
1488 # guaranteed. When using this interface, a premature EOF would not be
1493 { 'command': 'quit' }
1498 # Stop all guest VCPU execution.
1502 # Notes: This function will succeed even if the guest is already in the stopped
1503 # state. In "inmigrate" state, it will ensure that the guest
1504 # remains paused once migration finishes, as if the -S option was
1505 # passed on the command line.
1507 { 'command': 'stop' }
1512 # Performs a hard reset of a guest.
1516 { 'command': 'system_reset' }
1519 # @system_powerdown:
1521 # Requests that a guest perform a powerdown operation.
1525 # Notes: A guest may or may not respond to this command. This command
1526 # returning does not indicate that a guest has accepted the request or
1527 # that it has shut down. Many guests will respond to this command by
1528 # prompting the user in some way.
1530 { 'command': 'system_powerdown' }
1535 # This command is a nop that is only provided for the purposes of compatibility.
1539 # Notes: Do not use this command.
1541 { 'command': 'cpu', 'data': {'index': 'int'} }
1546 # Adds CPU with specified ID
1548 # @id: ID of CPU to be created, valid values [0..max_cpus)
1550 # Returns: Nothing on success
1554 { 'command': 'cpu-add', 'data': {'id': 'int'} }
1559 # Save a portion of guest memory to a file.
1561 # @val: the virtual address of the guest to start from
1563 # @size: the size of memory region to save
1565 # @filename: the file to save the memory to as binary data
1567 # @cpu-index: #optional the index of the virtual CPU to use for translating the
1568 # virtual address (defaults to CPU 0)
1570 # Returns: Nothing on success
1574 # Notes: Errors were not reliably returned until 1.1
1576 { 'command': 'memsave',
1577 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
1582 # Save a portion of guest physical memory to a file.
1584 # @val: the physical address of the guest to start from
1586 # @size: the size of memory region to save
1588 # @filename: the file to save the memory to as binary data
1590 # Returns: Nothing on success
1594 # Notes: Errors were not reliably returned until 1.1
1596 { 'command': 'pmemsave',
1597 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
1602 # Resume guest VCPU execution.
1606 # Returns: If successful, nothing
1607 # If QEMU was started with an encrypted block device and a key has
1608 # not yet been set, DeviceEncrypted.
1610 # Notes: This command will succeed if the guest is currently running. It
1611 # will also succeed if the guest is in the "inmigrate" state; in
1612 # this case, the effect of the command is to make sure the guest
1613 # starts once migration finishes, removing the effect of the -S
1614 # command line option if it was passed.
1616 { 'command': 'cont' }
1621 # Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1627 { 'command': 'system_wakeup' }
1632 # Injects an Non-Maskable Interrupt into all guest's VCPUs.
1634 # Returns: If successful, nothing
1638 # Notes: Only x86 Virtual Machines support this command.
1640 { 'command': 'inject-nmi' }
1645 # Sets the link status of a virtual network adapter.
1647 # @name: the device name of the virtual network adapter
1649 # @up: true to set the link status to be up
1651 # Returns: Nothing on success
1652 # If @name is not a valid network device, DeviceNotFound
1656 # Notes: Not all network adapters support setting link status. This command
1657 # will succeed even if the network adapter does not support link status
1660 { 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
1665 # This command sets the password of a block device that has not been open
1666 # with a password and requires one.
1668 # The two cases where this can happen are a block device is created through
1669 # QEMU's initial command line or a block device is changed through the legacy
1670 # @change interface.
1672 # In the event that the block device is created through the initial command
1673 # line, the VM will start in the stopped state regardless of whether '-S' is
1674 # used. The intention is for a management tool to query the block devices to
1675 # determine which ones are encrypted, set the passwords with this command, and
1676 # then start the guest with the @cont command.
1678 # @device: the name of the device to set the password on
1680 # @password: the password to use for the device
1682 # Returns: nothing on success
1683 # If @device is not a valid block device, DeviceNotFound
1684 # If @device is not encrypted, DeviceNotEncrypted
1686 # Notes: Not all block formats support encryption and some that do are not
1687 # able to validate that a password is correct. Disk corruption may
1688 # occur if an invalid password is specified.
1692 { 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
1697 # Request the balloon driver to change its balloon size.
1699 # @value: the target size of the balloon in bytes
1701 # Returns: Nothing on success
1702 # If the balloon driver is enabled but not functional because the KVM
1703 # kernel module cannot support it, KvmMissingCap
1704 # If no balloon device is present, DeviceNotActive
1706 # Notes: This command just issues a request to the guest. When it returns,
1707 # the balloon size may not have changed. A guest can change the balloon
1708 # size independent of this command.
1712 { 'command': 'balloon', 'data': {'value': 'int'} }
1717 # Resize a block image while a guest is running.
1719 # @device: the name of the device to get the image resized
1721 # @size: new image size in bytes
1723 # Returns: nothing on success
1724 # If @device is not a valid block device, DeviceNotFound
1728 { 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
1733 # An enumeration that tells QEMU how to set the backing file path in
1736 # @existing: QEMU should look for an existing image file.
1738 # @absolute-paths: QEMU should create a new image with absolute paths
1739 # for the backing file. If there is no backing file available, the new
1740 # image will not be backed either.
1744 { 'enum': 'NewImageMode',
1745 'data': [ 'existing', 'absolute-paths' ] }
1750 # @device: the name of the device to generate the snapshot from.
1752 # @snapshot-file: the target of the new image. A new file will be created.
1754 # @format: #optional the format of the snapshot image, default is 'qcow2'.
1756 # @mode: #optional whether and how QEMU should create a new image, default is
1759 { 'type': 'BlockdevSnapshot',
1760 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1761 '*mode': 'NewImageMode' } }
1764 # @BlockdevSnapshotInternal
1766 # @device: the name of the device to generate the snapshot from
1768 # @name: the name of the internal snapshot to be created
1770 # Notes: In transaction, if @name is empty, or any snapshot matching @name
1771 # exists, the operation will fail. Only some image formats support it,
1772 # for example, qcow2, rbd, and sheepdog.
1776 { 'type': 'BlockdevSnapshotInternal',
1777 'data': { 'device': 'str', 'name': 'str' } }
1782 # @device: the name of the device which should be copied.
1784 # @target: the target of the new image. If the file exists, or if it
1785 # is a device, the existing file/device will be used as the new
1786 # destination. If it does not exist, a new file will be created.
1788 # @format: #optional the format of the new destination, default is to
1789 # probe if @mode is 'existing', else the format of the source
1791 # @sync: what parts of the disk image should be copied to the destination
1792 # (all the disk, only the sectors allocated in the topmost image, or
1795 # @mode: #optional whether and how QEMU should create a new image, default is
1798 # @speed: #optional the maximum speed, in bytes per second
1800 # @on-source-error: #optional the action to take on an error on the source,
1801 # default 'report'. 'stop' and 'enospc' can only be used
1802 # if the block device supports io-status (see BlockInfo).
1804 # @on-target-error: #optional the action to take on an error on the target,
1805 # default 'report' (no limitations, since this applies to
1806 # a different block device than @device).
1808 # Note that @on-source-error and @on-target-error only affect background I/O.
1809 # If an error occurs during a guest write request, the device's rerror/werror
1810 # actions will be used.
1814 { 'type': 'DriveBackup',
1815 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1816 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1818 '*on-source-error': 'BlockdevOnError',
1819 '*on-target-error': 'BlockdevOnError' } }
1824 # This action can be used to test transaction failure.
1832 # @TransactionAction
1834 # A discriminated record of operations that can be performed with
1837 { 'union': 'TransactionAction',
1839 'blockdev-snapshot-sync': 'BlockdevSnapshot',
1840 'drive-backup': 'DriveBackup',
1842 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
1848 # Executes a number of transactionable QMP commands atomically. If any
1849 # operation fails, then the entire set of actions will be abandoned and the
1850 # appropriate error returned.
1853 # @TransactionAction: information needed for the respective operation
1855 # Returns: nothing on success
1856 # Errors depend on the operations of the transaction
1858 # Note: The transaction aborts on the first failure. Therefore, there will be
1859 # information on only one failed operation returned in an error condition, and
1860 # subsequent actions will not have been attempted.
1864 { 'command': 'transaction',
1865 'data': { 'actions': [ 'TransactionAction' ] } }
1868 # @blockdev-snapshot-sync
1870 # Generates a synchronous snapshot of a block device.
1872 # For the arguments, see the documentation of BlockdevSnapshot.
1874 # Returns: nothing on success
1875 # If @device is not a valid block device, DeviceNotFound
1879 { 'command': 'blockdev-snapshot-sync',
1880 'data': 'BlockdevSnapshot' }
1883 # @blockdev-snapshot-internal-sync
1885 # Synchronously take an internal snapshot of a block device, when the format
1886 # of the image used supports it.
1888 # For the arguments, see the documentation of BlockdevSnapshotInternal.
1890 # Returns: nothing on success
1891 # If @device is not a valid block device, DeviceNotFound
1892 # If any snapshot matching @name exists, or @name is empty,
1894 # If the format of the image used does not support it,
1895 # BlockFormatFeatureNotSupported
1899 { 'command': 'blockdev-snapshot-internal-sync',
1900 'data': 'BlockdevSnapshotInternal' }
1903 # @blockdev-snapshot-delete-internal-sync
1905 # Synchronously delete an internal snapshot of a block device, when the format
1906 # of the image used support it. The snapshot is identified by name or id or
1907 # both. One of the name or id is required. Return SnapshotInfo for the
1908 # successfully deleted snapshot.
1910 # @device: the name of the device to delete the snapshot from
1912 # @id: optional the snapshot's ID to be deleted
1914 # @name: optional the snapshot's name to be deleted
1916 # Returns: SnapshotInfo on success
1917 # If @device is not a valid block device, DeviceNotFound
1918 # If snapshot not found, GenericError
1919 # If the format of the image used does not support it,
1920 # BlockFormatFeatureNotSupported
1921 # If @id and @name are both not specified, GenericError
1925 { 'command': 'blockdev-snapshot-delete-internal-sync',
1926 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
1927 'returns': 'SnapshotInfo' }
1930 # @human-monitor-command:
1932 # Execute a command on the human monitor and return the output.
1934 # @command-line: the command to execute in the human monitor
1936 # @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1938 # Returns: the output of the command as a string
1942 # Notes: This command only exists as a stop-gap. Its use is highly
1943 # discouraged. The semantics of this command are not guaranteed.
1945 # Known limitations:
1947 # o This command is stateless, this means that commands that depend
1948 # on state information (such as getfd) might not work
1950 # o Commands that prompt the user for data (eg. 'cont' when the block
1951 # device is encrypted) don't currently work
1953 { 'command': 'human-monitor-command',
1954 'data': {'command-line': 'str', '*cpu-index': 'int'},
1960 # Live commit of data from overlay image nodes into backing nodes - i.e.,
1961 # writes data between 'top' and 'base' into 'base'.
1963 # @device: the name of the device
1965 # @base: #optional The file name of the backing image to write data into.
1966 # If not specified, this is the deepest backing image
1968 # @top: The file name of the backing image within the image chain,
1969 # which contains the topmost data to be committed down.
1970 # Note, the active layer as 'top' is currently unsupported.
1972 # If top == base, that is an error.
1975 # @speed: #optional the maximum speed, in bytes per second
1977 # Returns: Nothing on success
1978 # If commit or stream is already active on this device, DeviceInUse
1979 # If @device does not exist, DeviceNotFound
1980 # If image commit is not supported by this device, NotSupported
1981 # If @base or @top is invalid, a generic error is returned
1982 # If @top is the active layer, or omitted, a generic error is returned
1983 # If @speed is invalid, InvalidParameter
1988 { 'command': 'block-commit',
1989 'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1995 # Start a point-in-time copy of a block device to a new destination. The
1996 # status of ongoing drive-backup operations can be checked with
1997 # query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
1998 # The operation can be stopped before it has completed using the
1999 # block-job-cancel command.
2001 # For the arguments, see the documentation of DriveBackup.
2003 # Returns: nothing on success
2004 # If @device is not a valid block device, DeviceNotFound
2008 { 'command': 'drive-backup', 'data': 'DriveBackup' }
2013 # Start mirroring a block device's writes to a new destination.
2015 # @device: the name of the device whose writes should be mirrored.
2017 # @target: the target of the new image. If the file exists, or if it
2018 # is a device, the existing file/device will be used as the new
2019 # destination. If it does not exist, a new file will be created.
2021 # @format: #optional the format of the new destination, default is to
2022 # probe if @mode is 'existing', else the format of the source
2024 # @mode: #optional whether and how QEMU should create a new image, default is
2027 # @speed: #optional the maximum speed, in bytes per second
2029 # @sync: what parts of the disk image should be copied to the destination
2030 # (all the disk, only the sectors allocated in the topmost image, or
2033 # @granularity: #optional granularity of the dirty bitmap, default is 64K
2034 # if the image format doesn't have clusters, 4K if the clusters
2035 # are smaller than that, else the cluster size. Must be a
2036 # power of 2 between 512 and 64M (since 1.4).
2038 # @buf-size: #optional maximum amount of data in flight from source to
2039 # target (since 1.4).
2041 # @on-source-error: #optional the action to take on an error on the source,
2042 # default 'report'. 'stop' and 'enospc' can only be used
2043 # if the block device supports io-status (see BlockInfo).
2045 # @on-target-error: #optional the action to take on an error on the target,
2046 # default 'report' (no limitations, since this applies to
2047 # a different block device than @device).
2049 # Returns: nothing on success
2050 # If @device is not a valid block device, DeviceNotFound
2054 { 'command': 'drive-mirror',
2055 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2056 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
2057 '*speed': 'int', '*granularity': 'uint32',
2058 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
2059 '*on-target-error': 'BlockdevOnError' } }
2064 # Cancel the current executing migration process.
2066 # Returns: nothing on success
2068 # Notes: This command succeeds even if there is no migration process running.
2072 { 'command': 'migrate_cancel' }
2075 # @migrate_set_downtime
2077 # Set maximum tolerated downtime for migration.
2079 # @value: maximum downtime in seconds
2081 # Returns: nothing on success
2085 { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
2088 # @migrate_set_speed
2090 # Set maximum speed for migration.
2092 # @value: maximum speed in bytes.
2094 # Returns: nothing on success
2096 # Notes: A value lesser than zero will be automatically round up to zero.
2100 { 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
2103 # @migrate-set-cache-size
2105 # Set XBZRLE cache size
2107 # @value: cache size in bytes
2109 # The size will be rounded down to the nearest power of 2.
2110 # The cache size can be modified before and during ongoing migration
2112 # Returns: nothing on success
2116 { 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2119 # @query-migrate-cache-size
2121 # query XBZRLE cache size
2123 # Returns: XBZRLE cache size in bytes
2127 { 'command': 'query-migrate-cache-size', 'returns': 'int' }
2130 # @ObjectPropertyInfo:
2132 # @name: the name of the property
2134 # @type: the type of the property. This will typically come in one of four
2137 # 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2138 # These types are mapped to the appropriate JSON type.
2140 # 2) A legacy type in the form 'legacy<subtype>' where subtype is the
2141 # legacy qdev typename. These types are always treated as strings.
2143 # 3) A child type in the form 'child<subtype>' where subtype is a qdev
2144 # device type name. Child properties create the composition tree.
2146 # 4) A link type in the form 'link<subtype>' where subtype is a qdev
2147 # device type name. Link properties form the device model graph.
2151 { 'type': 'ObjectPropertyInfo',
2152 'data': { 'name': 'str', 'type': 'str' } }
2157 # This command will list any properties of a object given a path in the object
2160 # @path: the path within the object model. See @qom-get for a description of
2163 # Returns: a list of @ObjectPropertyInfo that describe the properties of the
2168 { 'command': 'qom-list',
2169 'data': { 'path': 'str' },
2170 'returns': [ 'ObjectPropertyInfo' ] }
2175 # This command will get a property from a object model path and return the
2178 # @path: The path within the object model. There are two forms of supported
2179 # paths--absolute and partial paths.
2181 # Absolute paths are derived from the root object and can follow child<>
2182 # or link<> properties. Since they can follow link<> properties, they
2183 # can be arbitrarily long. Absolute paths look like absolute filenames
2184 # and are prefixed with a leading slash.
2186 # Partial paths look like relative filenames. They do not begin
2187 # with a prefix. The matching rules for partial paths are subtle but
2188 # designed to make specifying objects easy. At each level of the
2189 # composition tree, the partial path is matched as an absolute path.
2190 # The first match is not returned. At least two matches are searched
2191 # for. A successful result is only returned if only one match is
2192 # found. If more than one match is found, a flag is return to
2193 # indicate that the match was ambiguous.
2195 # @property: The property name to read
2197 # Returns: The property value. The type depends on the property type. legacy<>
2198 # properties are returned as #str. child<> and link<> properties are
2199 # returns as #str pathnames. All integer property types (u8, u16, etc)
2200 # are returned as #int.
2204 { 'command': 'qom-get',
2205 'data': { 'path': 'str', 'property': 'str' },
2206 'returns': 'visitor',
2212 # This command will set a property from a object model path.
2214 # @path: see @qom-get for a description of this parameter
2216 # @property: the property name to set
2218 # @value: a value who's type is appropriate for the property type. See @qom-get
2219 # for a description of type mapping.
2223 { 'command': 'qom-set',
2224 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2230 # Sets the password of a remote display session.
2232 # @protocol: `vnc' to modify the VNC server password
2233 # `spice' to modify the Spice server password
2235 # @password: the new password
2237 # @connected: #optional how to handle existing clients when changing the
2238 # password. If nothing is specified, defaults to `keep'
2239 # `fail' to fail the command if clients are connected
2240 # `disconnect' to disconnect existing clients
2241 # `keep' to maintain existing clients
2243 # Returns: Nothing on success
2244 # If Spice is not enabled, DeviceNotFound
2248 { 'command': 'set_password',
2249 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
2254 # Expire the password of a remote display server.
2256 # @protocol: the name of the remote display protocol `vnc' or `spice'
2258 # @time: when to expire the password.
2259 # `now' to expire the password immediately
2260 # `never' to cancel password expiration
2261 # `+INT' where INT is the number of seconds from now (integer)
2262 # `INT' where INT is the absolute time in seconds
2264 # Returns: Nothing on success
2265 # If @protocol is `spice' and Spice is not active, DeviceNotFound
2269 # Notes: Time is relative to the server and currently there is no way to
2270 # coordinate server time with client time. It is not recommended to
2271 # use the absolute time version of the @time parameter unless you're
2272 # sure you are on the same machine as the QEMU instance.
2274 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
2279 # Ejects a device from a removable drive.
2281 # @device: The name of the device
2283 # @force: @optional If true, eject regardless of whether the drive is locked.
2284 # If not specified, the default value is false.
2286 # Returns: Nothing on success
2287 # If @device is not a valid block device, DeviceNotFound
2289 # Notes: Ejecting a device will no media results in success
2293 { 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
2296 # @change-vnc-password:
2298 # Change the VNC server password.
2300 # @target: the new password to use with VNC authentication
2304 # Notes: An empty password in this command will set the password to the empty
2305 # string. Existing clients are unaffected by executing this command.
2307 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
2312 # This command is multiple commands multiplexed together.
2314 # @device: This is normally the name of a block device but it may also be 'vnc'.
2315 # when it's 'vnc', then sub command depends on @target
2317 # @target: If @device is a block device, then this is the new filename.
2318 # If @device is 'vnc', then if the value 'password' selects the vnc
2319 # change password command. Otherwise, this specifies a new server URI
2320 # address to listen to for VNC connections.
2322 # @arg: If @device is a block device, then this is an optional format to open
2324 # If @device is 'vnc' and @target is 'password', this is the new VNC
2325 # password to set. If this argument is an empty string, then no future
2326 # logins will be allowed.
2328 # Returns: Nothing on success.
2329 # If @device is not a valid block device, DeviceNotFound
2330 # If the new block device is encrypted, DeviceEncrypted. Note that
2331 # if this error is returned, the device has been opened successfully
2332 # and an additional call to @block_passwd is required to set the
2333 # device's password. The behavior of reads and writes to the block
2334 # device between when these calls are executed is undefined.
2336 # Notes: It is strongly recommended that this interface is not used especially
2337 # for changing block devices.
2341 { 'command': 'change',
2342 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
2345 # @block_set_io_throttle:
2347 # Change I/O throttle limits for a block drive.
2349 # @device: The name of the device
2351 # @bps: total throughput limit in bytes per second
2353 # @bps_rd: read throughput limit in bytes per second
2355 # @bps_wr: write throughput limit in bytes per second
2357 # @iops: total I/O operations per second
2359 # @ops_rd: read I/O operations per second
2361 # @iops_wr: write I/O operations per second
2363 # @bps_max: #optional total max in bytes (Since 1.7)
2365 # @bps_rd_max: #optional read max in bytes (Since 1.7)
2367 # @bps_wr_max: #optional write max in bytes (Since 1.7)
2369 # @iops_max: #optional total I/O operations max (Since 1.7)
2371 # @iops_rd_max: #optional read I/O operations max (Since 1.7)
2373 # @iops_wr_max: #optional write I/O operations max (Since 1.7)
2375 # @iops_size: #optional an I/O size in bytes (Since 1.7)
2377 # Returns: Nothing on success
2378 # If @device is not a valid block device, DeviceNotFound
2382 { 'command': 'block_set_io_throttle',
2383 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2384 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2385 '*bps_max': 'int', '*bps_rd_max': 'int',
2386 '*bps_wr_max': 'int', '*iops_max': 'int',
2387 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2388 '*iops_size': 'int' } }
2393 # Copy data from a backing file into a block device.
2395 # The block streaming operation is performed in the background until the entire
2396 # backing file has been copied. This command returns immediately once streaming
2397 # has started. The status of ongoing block streaming operations can be checked
2398 # with query-block-jobs. The operation can be stopped before it has completed
2399 # using the block-job-cancel command.
2401 # If a base file is specified then sectors are not copied from that base file and
2402 # its backing chain. When streaming completes the image file will have the base
2403 # file as its backing file. This can be used to stream a subset of the backing
2404 # file chain instead of flattening the entire image.
2406 # On successful completion the image file is updated to drop the backing file
2407 # and the BLOCK_JOB_COMPLETED event is emitted.
2409 # @device: the device name
2411 # @base: #optional the common backing file name
2413 # @speed: #optional the maximum speed, in bytes per second
2415 # @on-error: #optional the action to take on an error (default report).
2416 # 'stop' and 'enospc' can only be used if the block device
2417 # supports io-status (see BlockInfo). Since 1.3.
2419 # Returns: Nothing on success
2420 # If @device does not exist, DeviceNotFound
2424 { 'command': 'block-stream',
2425 'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2426 '*on-error': 'BlockdevOnError' } }
2429 # @block-job-set-speed:
2431 # Set maximum speed for a background block operation.
2433 # This command can only be issued when there is an active block job.
2435 # Throttling can be disabled by setting the speed to 0.
2437 # @device: the device name
2439 # @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2442 # Returns: Nothing on success
2443 # If no background operation is active on this device, DeviceNotActive
2447 { 'command': 'block-job-set-speed',
2448 'data': { 'device': 'str', 'speed': 'int' } }
2451 # @block-job-cancel:
2453 # Stop an active background block operation.
2455 # This command returns immediately after marking the active background block
2456 # operation for cancellation. It is an error to call this command if no
2457 # operation is in progress.
2459 # The operation will cancel as soon as possible and then emit the
2460 # BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2461 # enumerated using query-block-jobs.
2463 # For streaming, the image file retains its backing file unless the streaming
2464 # operation happens to complete just as it is being cancelled. A new streaming
2465 # operation can be started at a later time to finish copying all data from the
2468 # @device: the device name
2470 # @force: #optional whether to allow cancellation of a paused job (default
2471 # false). Since 1.3.
2473 # Returns: Nothing on success
2474 # If no background operation is active on this device, DeviceNotActive
2478 { 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2483 # Pause an active background block operation.
2485 # This command returns immediately after marking the active background block
2486 # operation for pausing. It is an error to call this command if no
2487 # operation is in progress. Pausing an already paused job has no cumulative
2488 # effect; a single block-job-resume command will resume the job.
2490 # The operation will pause as soon as possible. No event is emitted when
2491 # the operation is actually paused. Cancelling a paused job automatically
2494 # @device: the device name
2496 # Returns: Nothing on success
2497 # If no background operation is active on this device, DeviceNotActive
2501 { 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2504 # @block-job-resume:
2506 # Resume an active background block operation.
2508 # This command returns immediately after resuming a paused background block
2509 # operation. It is an error to call this command if no operation is in
2510 # progress. Resuming an already running job is not an error.
2512 # This command also clears the error status of the job.
2514 # @device: the device name
2516 # Returns: Nothing on success
2517 # If no background operation is active on this device, DeviceNotActive
2521 { 'command': 'block-job-resume', 'data': { 'device': 'str' } }
2524 # @block-job-complete:
2526 # Manually trigger completion of an active background block operation. This
2527 # is supported for drive mirroring, where it also switches the device to
2528 # write to the target path only. The ability to complete is signaled with
2529 # a BLOCK_JOB_READY event.
2531 # This command completes an active background block operation synchronously.
2532 # The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2533 # is not defined. Note that if an I/O error occurs during the processing of
2534 # this command: 1) the command itself will fail; 2) the error will be processed
2535 # according to the rerror/werror arguments that were specified when starting
2538 # A cancelled or paused job cannot be completed.
2540 # @device: the device name
2542 # Returns: Nothing on success
2543 # If no background operation is active on this device, DeviceNotActive
2547 { 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2552 # This structure describes a search result from @qom-list-types
2554 # @name: the type name found in the search
2558 # Notes: This command is experimental and may change syntax in future releases.
2560 { 'type': 'ObjectTypeInfo',
2561 'data': { 'name': 'str' } }
2566 # This command will return a list of types given search parameters
2568 # @implements: if specified, only return types that implement this type name
2570 # @abstract: if true, include abstract types in the results
2572 # Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2576 { 'command': 'qom-list-types',
2577 'data': { '*implements': 'str', '*abstract': 'bool' },
2578 'returns': [ 'ObjectTypeInfo' ] }
2581 # @DevicePropertyInfo:
2583 # Information about device properties.
2585 # @name: the name of the property
2586 # @type: the typename of the property
2590 { 'type': 'DevicePropertyInfo',
2591 'data': { 'name': 'str', 'type': 'str' } }
2594 # @device-list-properties:
2596 # List properties associated with a device.
2598 # @typename: the type name of a device
2600 # Returns: a list of DevicePropertyInfo describing a devices properties
2604 { 'command': 'device-list-properties',
2605 'data': { 'typename': 'str'},
2606 'returns': [ 'DevicePropertyInfo' ] }
2611 # Migrates the current running guest to another Virtual Machine.
2613 # @uri: the Uniform Resource Identifier of the destination VM
2615 # @blk: #optional do block migration (full disk copy)
2617 # @inc: #optional incremental disk copy migration
2619 # @detach: this argument exists only for compatibility reasons and
2620 # is ignored by QEMU
2622 # Returns: nothing on success
2626 { 'command': 'migrate',
2627 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
2629 # @xen-save-devices-state:
2631 # Save the state of all devices to file. The RAM and the block devices
2632 # of the VM are not saved by this command.
2634 # @filename: the file to save the state of the devices to as binary
2635 # data. See xen-save-devices-state.txt for a description of the binary
2638 # Returns: Nothing on success
2642 { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
2645 # @xen-set-global-dirty-log
2647 # Enable or disable the global dirty log mode.
2649 # @enable: true to enable, false to disable.
2655 { 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2660 # Remove a device from a guest
2662 # @id: the name of the device
2664 # Returns: Nothing on success
2665 # If @id is not a valid device, DeviceNotFound
2667 # Notes: When this command completes, the device may not be removed from the
2668 # guest. Hot removal is an operation that requires guest cooperation.
2669 # This command merely requests that the guest begin the hot removal
2670 # process. Completion of the device removal process is signaled with a
2671 # DEVICE_DELETED event. Guest reset will automatically complete removal
2676 { 'command': 'device_del', 'data': {'id': 'str'} }
2679 # @dump-guest-memory
2681 # Dump guest's memory to vmcore. It is a synchronous operation that can take
2682 # very long depending on the amount of guest memory. This command is only
2683 # supported on i386 and x86_64.
2685 # @paging: if true, do paging to get guest's memory mapping. This allows
2686 # using gdb to process the core file.
2688 # IMPORTANT: this option can make QEMU allocate several gigabytes
2689 # of RAM. This can happen for a large guest, or a
2690 # malicious guest pretending to be large.
2692 # Also, paging=true has the following limitations:
2694 # 1. The guest may be in a catastrophic state or can have corrupted
2695 # memory, which cannot be trusted
2696 # 2. The guest can be in real-mode even if paging is enabled. For
2697 # example, the guest uses ACPI to sleep, and ACPI sleep state
2700 # @protocol: the filename or file descriptor of the vmcore. The supported
2703 # 1. file: the protocol starts with "file:", and the following
2704 # string is the file's path.
2705 # 2. fd: the protocol starts with "fd:", and the following string
2708 # @begin: #optional if specified, the starting physical address.
2710 # @length: #optional if specified, the memory size, in bytes. If you don't
2711 # want to dump all guest's memory, please specify the start @begin
2714 # Returns: nothing on success
2718 { 'command': 'dump-guest-memory',
2719 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2720 '*length': 'int' } }
2725 # Add a network backend.
2727 # @type: the type of network backend. Current valid values are 'user', 'tap',
2728 # 'vde', 'socket', 'dump' and 'bridge'
2730 # @id: the name of the new network backend
2732 # @props: #optional a list of properties to be passed to the backend in
2733 # the format 'name=value', like 'ifname=tap0,script=no'
2735 # Notes: The semantics of @props is not well defined. Future commands will be
2736 # introduced that provide stronger typing for backend creation.
2740 # Returns: Nothing on success
2741 # If @type is not a valid network backend, DeviceNotFound
2743 { 'command': 'netdev_add',
2744 'data': {'type': 'str', 'id': 'str', '*props': '**'},
2750 # Remove a network backend.
2752 # @id: the name of the network backend to remove
2754 # Returns: Nothing on success
2755 # If @id is not a valid network backend, DeviceNotFound
2759 { 'command': 'netdev_del', 'data': {'id': 'str'} }
2762 # @NetdevNoneOptions
2764 # Use it alone to have zero network devices.
2768 { 'type': 'NetdevNoneOptions',
2772 # @NetLegacyNicOptions
2774 # Create a new Network Interface Card.
2776 # @netdev: #optional id of -netdev to connect to
2778 # @macaddr: #optional MAC address
2780 # @model: #optional device model (e1000, rtl8139, virtio etc.)
2782 # @addr: #optional PCI device address
2784 # @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2788 { 'type': 'NetLegacyNicOptions',
2794 '*vectors': 'uint32' } }
2799 # A fat type wrapping 'str', to be embedded in lists.
2808 # @NetdevUserOptions
2810 # Use the user mode network stack which requires no administrator privilege to
2813 # @hostname: #optional client hostname reported by the builtin DHCP server
2815 # @restrict: #optional isolate the guest from the host
2817 # @ip: #optional legacy parameter, use net= instead
2819 # @net: #optional IP address and optional netmask
2821 # @host: #optional guest-visible address of the host
2823 # @tftp: #optional root directory of the built-in TFTP server
2825 # @bootfile: #optional BOOTP filename, for use with tftp=
2827 # @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2830 # @dns: #optional guest-visible address of the virtual nameserver
2832 # @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2835 # @smb: #optional root directory of the built-in SMB server
2837 # @smbserver: #optional IP address of the built-in SMB server
2839 # @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2842 # @guestfwd: #optional forward guest TCP connections
2846 { 'type': 'NetdevUserOptions',
2849 '*restrict': 'bool',
2855 '*dhcpstart': 'str',
2857 '*dnssearch': ['String'],
2859 '*smbserver': 'str',
2860 '*hostfwd': ['String'],
2861 '*guestfwd': ['String'] } }
2866 # Connect the host TAP network interface name to the VLAN.
2868 # @ifname: #optional interface name
2870 # @fd: #optional file descriptor of an already opened tap
2872 # @fds: #optional multiple file descriptors of already opened multiqueue capable
2875 # @script: #optional script to initialize the interface
2877 # @downscript: #optional script to shut down the interface
2879 # @helper: #optional command to execute to configure bridge
2881 # @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2883 # @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2885 # @vhost: #optional enable vhost-net network accelerator
2887 # @vhostfd: #optional file descriptor of an already opened vhost net device
2889 # @vhostfds: #optional file descriptors of multiple already opened vhost net
2892 # @vhostforce: #optional vhost on for non-MSIX virtio guests
2894 # @queues: #optional number of queues to be created for multiqueue capable tap
2898 { 'type': 'NetdevTapOptions',
2904 '*downscript': 'str',
2907 '*vnet_hdr': 'bool',
2911 '*vhostforce': 'bool',
2912 '*queues': 'uint32'} }
2915 # @NetdevSocketOptions
2917 # Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2918 # socket connection.
2920 # @fd: #optional file descriptor of an already opened socket
2922 # @listen: #optional port number, and optional hostname, to listen on
2924 # @connect: #optional port number, and optional hostname, to connect to
2926 # @mcast: #optional UDP multicast address and port number
2928 # @localaddr: #optional source address and port for multicast and udp packets
2930 # @udp: #optional UDP unicast address and port number
2934 { 'type': 'NetdevSocketOptions',
2940 '*localaddr': 'str',
2946 # Connect the VLAN to a vde switch running on the host.
2948 # @sock: #optional socket path
2950 # @port: #optional port number
2952 # @group: #optional group owner of socket
2954 # @mode: #optional permissions for socket
2958 { 'type': 'NetdevVdeOptions',
2963 '*mode': 'uint16' } }
2966 # @NetdevDumpOptions
2968 # Dump VLAN network traffic to a file.
2970 # @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2973 # @file: #optional dump file path (default is qemu-vlan0.pcap)
2977 { 'type': 'NetdevDumpOptions',
2983 # @NetdevBridgeOptions
2985 # Connect a host TAP network interface to a host bridge device.
2987 # @br: #optional bridge name
2989 # @helper: #optional command to execute to configure bridge
2993 { 'type': 'NetdevBridgeOptions',
2996 '*helper': 'str' } }
2999 # @NetdevHubPortOptions
3001 # Connect two or more net clients through a software hub.
3003 # @hubid: hub identifier number
3007 { 'type': 'NetdevHubPortOptions',
3009 'hubid': 'int32' } }
3014 # A discriminated record of network device traits.
3018 { 'union': 'NetClientOptions',
3020 'none': 'NetdevNoneOptions',
3021 'nic': 'NetLegacyNicOptions',
3022 'user': 'NetdevUserOptions',
3023 'tap': 'NetdevTapOptions',
3024 'socket': 'NetdevSocketOptions',
3025 'vde': 'NetdevVdeOptions',
3026 'dump': 'NetdevDumpOptions',
3027 'bridge': 'NetdevBridgeOptions',
3028 'hubport': 'NetdevHubPortOptions' } }
3033 # Captures the configuration of a network device; legacy.
3035 # @vlan: #optional vlan number
3037 # @id: #optional identifier for monitor commands
3039 # @name: #optional identifier for monitor commands, ignored if @id is present
3041 # @opts: device type specific properties (legacy)
3045 { 'type': 'NetLegacy',
3050 'opts': 'NetClientOptions' } }
3055 # Captures the configuration of a network device.
3057 # @id: identifier for monitor commands.
3059 # @opts: device type specific properties
3066 'opts': 'NetClientOptions' } }
3069 # @InetSocketAddress
3071 # Captures a socket address or address range in the Internet namespace.
3073 # @host: host part of the address
3075 # @port: port part of the address, or lowest port if @to is present
3077 # @to: highest port to try
3079 # @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3082 # @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3087 { 'type': 'InetSocketAddress',
3096 # @UnixSocketAddress
3098 # Captures a socket address in the local ("Unix socket") namespace.
3100 # @path: filesystem path to use
3104 { 'type': 'UnixSocketAddress',
3111 # Captures the address of a socket, which could also be a named file descriptor
3115 { 'union': 'SocketAddress',
3117 'inet': 'InetSocketAddress',
3118 'unix': 'UnixSocketAddress',
3124 # Receive a file descriptor via SCM rights and assign it a name
3126 # @fdname: file descriptor name
3128 # Returns: Nothing on success
3132 # Notes: If @fdname already exists, the file descriptor assigned to
3133 # it will be closed and replaced by the received file
3135 # The 'closefd' command can be used to explicitly close the
3136 # file descriptor when it is no longer needed.
3138 { 'command': 'getfd', 'data': {'fdname': 'str'} }
3143 # Close a file descriptor previously passed via SCM rights
3145 # @fdname: file descriptor name
3147 # Returns: Nothing on success
3151 { 'command': 'closefd', 'data': {'fdname': 'str'} }
3156 # Information describing a machine.
3158 # @name: the name of the machine
3160 # @alias: #optional an alias for the machine name
3162 # @default: #optional whether the machine is default
3164 # @cpu-max: maximum number of CPUs supported by the machine type
3169 { 'type': 'MachineInfo',
3170 'data': { 'name': 'str', '*alias': 'str',
3171 '*is-default': 'bool', 'cpu-max': 'int' } }
3176 # Return a list of supported machines
3178 # Returns: a list of MachineInfo
3182 { 'command': 'query-machines', 'returns': ['MachineInfo'] }
3185 # @CpuDefinitionInfo:
3187 # Virtual CPU definition.
3189 # @name: the name of the CPU definition
3193 { 'type': 'CpuDefinitionInfo',
3194 'data': { 'name': 'str' } }
3197 # @query-cpu-definitions:
3199 # Return a list of supported virtual CPU definitions
3201 # Returns: a list of CpuDefInfo
3205 { 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
3209 # Information about a file descriptor that was added to an fd set.
3211 # @fdset-id: The ID of the fd set that @fd was added to.
3213 # @fd: The file descriptor that was received via SCM rights and
3214 # added to the fd set.
3218 { 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3223 # Add a file descriptor, that was passed via SCM rights, to an fd set.
3225 # @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3227 # @opaque: #optional A free-form string that can be used to describe the fd.
3229 # Returns: @AddfdInfo on success
3230 # If file descriptor was not received, FdNotSupplied
3231 # If @fdset-id is a negative value, InvalidParameterValue
3233 # Notes: The list of fd sets is shared by all monitor connections.
3235 # If @fdset-id is not specified, a new fd set will be created.
3239 { 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3240 'returns': 'AddfdInfo' }
3245 # Remove a file descriptor from an fd set.
3247 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
3249 # @fd: #optional The file descriptor that is to be removed.
3251 # Returns: Nothing on success
3252 # If @fdset-id or @fd is not found, FdNotFound
3256 # Notes: The list of fd sets is shared by all monitor connections.
3258 # If @fd is not specified, all file descriptors in @fdset-id
3261 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3266 # Information about a file descriptor that belongs to an fd set.
3268 # @fd: The file descriptor value.
3270 # @opaque: #optional A free-form string that can be used to describe the fd.
3274 { 'type': 'FdsetFdInfo',
3275 'data': {'fd': 'int', '*opaque': 'str'} }
3280 # Information about an fd set.
3282 # @fdset-id: The ID of the fd set.
3284 # @fds: A list of file descriptors that belong to this fd set.
3288 { 'type': 'FdsetInfo',
3289 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3294 # Return information describing all fd sets.
3296 # Returns: A list of @FdsetInfo
3300 # Note: The list of fd sets is shared by all monitor connections.
3303 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
3308 # Information describing the QEMU target.
3310 # @arch: the target architecture (eg "x86_64", "i386", etc)
3314 { 'type': 'TargetInfo',
3315 'data': { 'arch': 'str' } }
3320 # Return information about the target for this QEMU
3322 # Returns: TargetInfo
3326 { 'command': 'query-target', 'returns': 'TargetInfo' }
3331 # An enumeration of key name.
3333 # This is used by the send-key command.
3337 { 'enum': 'QKeyCode',
3338 'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3339 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3340 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3341 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3342 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3343 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3344 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3345 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3346 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3347 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3348 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3349 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3350 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3351 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3352 'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
3357 # Represents a keyboard key.
3361 { 'union': 'KeyValue',
3364 'qcode': 'QKeyCode' } }
3369 # Send keys to guest.
3371 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
3372 # simultaneously sent to the guest. A @KeyValue.number value is sent
3373 # directly to the guest, while @KeyValue.qcode must be a valid
3376 # @hold-time: #optional time to delay key up events, milliseconds. Defaults
3379 # Returns: Nothing on success
3380 # If key is unknown or redundant, InvalidParameter
3385 { 'command': 'send-key',
3386 'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
3391 # Write a PPM of the VGA screen to a file.
3393 # @filename: the path of a new PPM file to store the image
3395 # Returns: Nothing on success
3399 { 'command': 'screendump', 'data': {'filename': 'str'} }
3402 # @nbd-server-start:
3404 # Start an NBD server listening on the given host and port. Block
3405 # devices can then be exported using @nbd-server-add. The NBD
3406 # server will present them as named exports; for example, another
3407 # QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3409 # @addr: Address on which to listen.
3411 # Returns: error if the server is already running.
3415 { 'command': 'nbd-server-start',
3416 'data': { 'addr': 'SocketAddress' } }
3421 # Export a device to QEMU's embedded NBD server.
3423 # @device: Block device to be exported
3425 # @writable: Whether clients should be able to write to the device via the
3426 # NBD connection (default false). #optional
3428 # Returns: error if the device is already marked for export.
3432 { 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3437 # Stop QEMU's embedded NBD server, and unregister all devices previously
3438 # added via @nbd-server-add.
3442 { 'command': 'nbd-server-stop' }
3447 # Configuration info for file chardevs.
3449 # @in: #optional The name of the input file
3450 # @out: The name of the output file
3454 { 'type': 'ChardevFile', 'data': { '*in' : 'str',
3460 # Configuration info for device and pipe chardevs.
3462 # @device: The name of the special file for the device,
3463 # i.e. /dev/ttyS0 on Unix or COM1: on Windows
3464 # @type: What kind of device this is.
3468 { 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
3473 # Configuration info for (stream) socket chardevs.
3475 # @addr: socket address to listen on (server=true)
3476 # or connect to (server=false)
3477 # @server: #optional create server socket (default: true)
3478 # @wait: #optional wait for incoming connection on server
3479 # sockets (default: false).
3480 # @nodelay: #optional set TCP_NODELAY socket option (default: false)
3481 # @telnet: #optional enable telnet protocol on server
3482 # sockets (default: false)
3486 { 'type': 'ChardevSocket', 'data': { 'addr' : 'SocketAddress',
3489 '*nodelay' : 'bool',
3490 '*telnet' : 'bool' } }
3495 # Configuration info for datagram socket chardevs.
3497 # @remote: remote address
3498 # @local: #optional local address
3502 { 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3503 '*local' : 'SocketAddress' } }
3508 # Configuration info for mux chardevs.
3510 # @chardev: name of the base chardev.
3514 { 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3519 # Configuration info for stdio chardevs.
3521 # @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3522 # be delivered to qemu. Default: true in -nographic mode,
3527 { 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3530 # @ChardevSpiceChannel:
3532 # Configuration info for spice vm channel chardevs.
3534 # @type: kind of channel (for example vdagent).
3538 { 'type': 'ChardevSpiceChannel', 'data': { 'type' : 'str' } }
3541 # @ChardevSpicePort:
3543 # Configuration info for spice port chardevs.
3545 # @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3549 { 'type': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' } }
3554 # Configuration info for virtual console chardevs.
3556 # @width: console width, in pixels
3557 # @height: console height, in pixels
3558 # @cols: console width, in chars
3559 # @rows: console height, in chars
3563 { 'type': 'ChardevVC', 'data': { '*width' : 'int',
3571 # Configuration info for ring buffer chardevs.
3573 # @size: #optional ring buffer size, must be power of two, default is 65536
3577 { 'type': 'ChardevRingbuf', 'data': { '*size' : 'int' } }
3582 # Configuration info for the new chardev backend.
3586 { 'type': 'ChardevDummy', 'data': { } }
3588 { 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
3589 'serial' : 'ChardevHostdev',
3590 'parallel': 'ChardevHostdev',
3591 'pipe' : 'ChardevHostdev',
3592 'socket' : 'ChardevSocket',
3593 'udp' : 'ChardevUdp',
3594 'pty' : 'ChardevDummy',
3595 'null' : 'ChardevDummy',
3596 'mux' : 'ChardevMux',
3597 'msmouse': 'ChardevDummy',
3598 'braille': 'ChardevDummy',
3599 'stdio' : 'ChardevStdio',
3600 'console': 'ChardevDummy',
3601 'spicevmc' : 'ChardevSpiceChannel',
3602 'spiceport' : 'ChardevSpicePort',
3604 'ringbuf': 'ChardevRingbuf',
3605 # next one is just for compatibility
3606 'memory' : 'ChardevRingbuf' } }
3611 # Return info about the chardev backend just created.
3613 # @pty: #optional name of the slave pseudoterminal device, present if
3614 # and only if a chardev of type 'pty' was created
3618 { 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
3623 # Add a character device backend
3625 # @id: the chardev's ID, must be unique
3626 # @backend: backend type and parameters
3628 # Returns: ChardevReturn.
3632 { 'command': 'chardev-add', 'data': {'id' : 'str',
3633 'backend' : 'ChardevBackend' },
3634 'returns': 'ChardevReturn' }
3639 # Remove a character device backend
3641 # @id: the chardev's ID, must exist and not be in use
3643 # Returns: Nothing on success
3647 { 'command': 'chardev-remove', 'data': {'id': 'str'} }
3652 # An enumeration of TPM models
3654 # @tpm-tis: TPM TIS model
3658 { 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3661 # @query-tpm-models:
3663 # Return a list of supported TPM models
3665 # Returns: a list of TpmModel
3669 { 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3674 # An enumeration of TPM types
3676 # @passthrough: TPM passthrough type
3680 { 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3685 # Return a list of supported TPM types
3687 # Returns: a list of TpmType
3691 { 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3694 # @TPMPassthroughOptions:
3696 # Information about the TPM passthrough type
3698 # @path: #optional string describing the path used for accessing the TPM device
3700 # @cancel-path: #optional string showing the TPM's sysfs cancel file
3701 # for cancellation of TPM commands while they are executing
3705 { 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3706 '*cancel-path' : 'str'} }
3711 # A union referencing different TPM backend types' configuration options
3713 # @passthrough: The configuration options for the TPM passthrough type
3717 { 'union': 'TpmTypeOptions',
3718 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
3723 # Information about the TPM
3725 # @id: The Id of the TPM
3727 # @model: The TPM frontend model
3729 # @options: The TPM (backend) type configuration options
3733 { 'type': 'TPMInfo',
3734 'data': {'id': 'str',
3735 'model': 'TpmModel',
3736 'options': 'TpmTypeOptions' } }
3741 # Return information about the TPM device
3743 # Returns: @TPMInfo on success
3747 { 'command': 'query-tpm', 'returns': ['TPMInfo'] }
3752 # Specify an ACPI table on the command line to load.
3754 # At most one of @file and @data can be specified. The list of files specified
3755 # by any one of them is loaded and concatenated in order. If both are omitted,
3758 # Other fields / optargs can be used to override fields of the generic ACPI
3759 # table header; refer to the ACPI specification 5.0, section 5.2.6 System
3760 # Description Table Header. If a header field is not overridden, then the
3761 # corresponding value from the concatenated blob is used (in case of @file), or
3762 # it is filled in with a hard-coded value (in case of @data).
3764 # String fields are copied into the matching ACPI member from lowest address
3765 # upwards, and silently truncated / NUL-padded to length.
3767 # @sig: #optional table signature / identifier (4 bytes)
3769 # @rev: #optional table revision number (dependent on signature, 1 byte)
3771 # @oem_id: #optional OEM identifier (6 bytes)
3773 # @oem_table_id: #optional OEM table identifier (8 bytes)
3775 # @oem_rev: #optional OEM-supplied revision number (4 bytes)
3777 # @asl_compiler_id: #optional identifier of the utility that created the table
3780 # @asl_compiler_rev: #optional revision number of the utility that created the
3783 # @file: #optional colon (:) separated list of pathnames to load and
3784 # concatenate as table data. The resultant binary blob is expected to
3785 # have an ACPI table header. At least one file is required. This field
3788 # @data: #optional colon (:) separated list of pathnames to load and
3789 # concatenate as table data. The resultant binary blob must not have an
3790 # ACPI table header. At least one file is required. This field excludes
3795 { 'type': 'AcpiTableOptions',
3800 '*oem_table_id': 'str',
3801 '*oem_rev': 'uint32',
3802 '*asl_compiler_id': 'str',
3803 '*asl_compiler_rev': 'uint32',
3808 # @CommandLineParameterType:
3810 # Possible types for an option parameter.
3812 # @string: accepts a character string
3814 # @boolean: accepts "on" or "off"
3816 # @number: accepts a number
3818 # @size: accepts a number followed by an optional suffix (K)ilo,
3819 # (M)ega, (G)iga, (T)era
3823 { 'enum': 'CommandLineParameterType',
3824 'data': ['string', 'boolean', 'number', 'size'] }
3827 # @CommandLineParameterInfo:
3829 # Details about a single parameter of a command line option.
3831 # @name: parameter name
3833 # @type: parameter @CommandLineParameterType
3835 # @help: #optional human readable text string, not suitable for parsing.
3839 { 'type': 'CommandLineParameterInfo',
3840 'data': { 'name': 'str',
3841 'type': 'CommandLineParameterType',
3845 # @CommandLineOptionInfo:
3847 # Details about a command line option, including its list of parameter details
3849 # @option: option name
3851 # @parameters: an array of @CommandLineParameterInfo
3855 { 'type': 'CommandLineOptionInfo',
3856 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3859 # @query-command-line-options:
3861 # Query command line option schema.
3863 # @option: #optional option name
3865 # Returns: list of @CommandLineOptionInfo for all options (or for the given
3866 # @option). Returns an error if the given @option doesn't exist.
3870 {'command': 'query-command-line-options', 'data': { '*option': 'str' },
3871 'returns': ['CommandLineOptionInfo'] }
3876 # A X86 32-bit register
3880 { 'enum': 'X86CPURegister32',
3881 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
3884 # @X86CPUFeatureWordInfo
3886 # Information about a X86 CPU feature word
3888 # @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
3890 # @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
3893 # @cpuid-register: Output register containing the feature bits
3895 # @features: value of output register, containing the feature bits
3899 { 'type': 'X86CPUFeatureWordInfo',
3900 'data': { 'cpuid-input-eax': 'int',
3901 '*cpuid-input-ecx': 'int',
3902 'cpuid-register': 'X86CPURegister32',
3903 'features': 'int' } }
3908 # Packets receiving state
3910 # @normal: filter assigned packets according to the mac-table
3912 # @none: don't receive any assigned packet
3914 # @all: receive all assigned packets
3918 { 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
3923 # Rx-filter information for a NIC.
3925 # @name: net client name
3927 # @promiscuous: whether promiscuous mode is enabled
3929 # @multicast: multicast receive state
3931 # @unicast: unicast receive state
3933 # @broadcast-allowed: whether to receive broadcast
3935 # @multicast-overflow: multicast table is overflowed or not
3937 # @unicast-overflow: unicast table is overflowed or not
3939 # @main-mac: the main macaddr string
3941 # @vlan-table: a list of active vlan id
3943 # @unicast-table: a list of unicast macaddr string
3945 # @multicast-table: a list of multicast macaddr string
3950 { 'type': 'RxFilterInfo',
3953 'promiscuous': 'bool',
3954 'multicast': 'RxState',
3955 'unicast': 'RxState',
3956 'broadcast-allowed': 'bool',
3957 'multicast-overflow': 'bool',
3958 'unicast-overflow': 'bool',
3960 'vlan-table': ['int'],
3961 'unicast-table': ['str'],
3962 'multicast-table': ['str'] }}
3967 # Return rx-filter information for all NICs (or for the given NIC).
3969 # @name: #optional net client name
3971 # Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
3972 # Returns an error if the given @name doesn't exist, or given
3973 # NIC doesn't support rx-filter querying, or given net client
3978 { 'command': 'query-rx-filter', 'data': { '*name': 'str' },
3979 'returns': ['RxFilterInfo'] }
3983 # @BlockdevDiscardOptions
3985 # Determines how to handle discard requests.
3987 # @ignore: Ignore the request
3988 # @unmap: Forward as an unmap request
3992 { 'enum': 'BlockdevDiscardOptions',
3993 'data': [ 'ignore', 'unmap' ] }
3996 # @BlockdevAioOptions
3998 # Selects the AIO backend to handle I/O requests
4000 # @threads: Use qemu's thread pool
4001 # @native: Use native AIO backend (only Linux and Windows)
4005 { 'enum': 'BlockdevAioOptions',
4006 'data': [ 'threads', 'native' ] }
4009 # @BlockdevCacheOptions
4011 # Includes cache-related options for block devices
4013 # @writeback: #optional enables writeback mode for any caches (default: true)
4014 # @direct: #optional enables use of O_DIRECT (bypass the host page cache;
4016 # @no-flush: #optional ignore any flush requests for the device (default:
4021 { 'type': 'BlockdevCacheOptions',
4022 'data': { '*writeback': 'bool',
4024 '*no-flush': 'bool' } }
4027 # @BlockdevOptionsBase
4029 # Options that are available for all block devices, independent of the block
4032 # @driver: block driver name
4033 # @id: #optional id by which the new block device can be referred to.
4034 # This is a required option on the top level of blockdev-add, and
4035 # currently not allowed on any other level.
4036 # @discard: #optional discard-related options (default: ignore)
4037 # @cache: #optional cache-related options
4038 # @aio: #optional AIO backend (default: threads)
4039 # @rerror: #optional how to handle read errors on the device
4041 # @werror: #optional how to handle write errors on the device
4043 # @read-only: #optional whether the block device should be read-only
4048 { 'type': 'BlockdevOptionsBase',
4049 'data': { 'driver': 'str',
4051 '*discard': 'BlockdevDiscardOptions',
4052 '*cache': 'BlockdevCacheOptions',
4053 '*aio': 'BlockdevAioOptions',
4054 '*rerror': 'BlockdevOnError',
4055 '*werror': 'BlockdevOnError',
4056 '*read-only': 'bool' } }
4059 # @BlockdevOptionsFile
4061 # Driver specific block device options for the file backend and similar
4064 # @filename: path to the image file
4068 { 'type': 'BlockdevOptionsFile',
4069 'data': { 'filename': 'str' } }
4072 # @BlockdevOptionsVVFAT
4074 # Driver specific block device options for the vvfat protocol.
4076 # @dir: directory to be exported as FAT image
4077 # @fat-type: #optional FAT type: 12, 16 or 32
4078 # @floppy: #optional whether to export a floppy image (true) or
4079 # partitioned hard disk (false; default)
4080 # @rw: #optional whether to allow write operations (default: false)
4084 { 'type': 'BlockdevOptionsVVFAT',
4085 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4089 # @BlockdevOptionsGenericFormat
4091 # Driver specific block device options for image format that have no option
4092 # besides their data source.
4094 # @file: reference to or definition of the data source block device
4098 { 'type': 'BlockdevOptionsGenericFormat',
4099 'data': { 'file': 'BlockdevRef' } }
4102 # @BlockdevOptionsGenericCOWFormat
4104 # Driver specific block device options for image format that have no option
4105 # besides their data source and an optional backing file.
4107 # @backing: #optional reference to or definition of the backing file block
4108 # device (if missing, taken from the image file content). It is
4109 # allowed to pass an empty string here in order to disable the
4110 # default backing file.
4114 { 'type': 'BlockdevOptionsGenericCOWFormat',
4115 'base': 'BlockdevOptionsGenericFormat',
4116 'data': { '*backing': 'BlockdevRef' } }
4119 # @BlockdevOptionsQcow2
4121 # Driver specific block device options for qcow2.
4123 # @lazy-refcounts: #optional whether to enable the lazy refcounts
4124 # feature (default is taken from the image file)
4126 # @pass-discard-request: #optional whether discard requests to the qcow2
4127 # device should be forwarded to the data source
4129 # @pass-discard-snapshot: #optional whether discard requests for the data source
4130 # should be issued when a snapshot operation (e.g.
4131 # deleting a snapshot) frees clusters in the qcow2 file
4133 # @pass-discard-other: #optional whether discard requests for the data source
4134 # should be issued on other occasions where a cluster
4139 { 'type': 'BlockdevOptionsQcow2',
4140 'base': 'BlockdevOptionsGenericCOWFormat',
4141 'data': { '*lazy-refcounts': 'bool',
4142 '*pass-discard-request': 'bool',
4143 '*pass-discard-snapshot': 'bool',
4144 '*pass-discard-other': 'bool' } }
4149 # Options for creating a block device.
4153 { 'union': 'BlockdevOptions',
4154 'base': 'BlockdevOptionsBase',
4155 'discriminator': 'driver',
4157 'file': 'BlockdevOptionsFile',
4158 'http': 'BlockdevOptionsFile',
4159 'https': 'BlockdevOptionsFile',
4160 'ftp': 'BlockdevOptionsFile',
4161 'ftps': 'BlockdevOptionsFile',
4162 'tftp': 'BlockdevOptionsFile',
4163 # TODO gluster: Wait for structured options
4164 # TODO iscsi: Wait for structured options
4165 # TODO nbd: Should take InetSocketAddress for 'host'?
4166 # TODO rbd: Wait for structured options
4167 # TODO sheepdog: Wait for structured options
4168 # TODO ssh: Should take InetSocketAddress for 'host'?
4169 'vvfat': 'BlockdevOptionsVVFAT',
4171 # TODO blkdebug: Wait for structured options
4172 # TODO blkverify: Wait for structured options
4174 'bochs': 'BlockdevOptionsGenericFormat',
4175 'cloop': 'BlockdevOptionsGenericFormat',
4176 'cow': 'BlockdevOptionsGenericCOWFormat',
4177 'dmg': 'BlockdevOptionsGenericFormat',
4178 'parallels': 'BlockdevOptionsGenericFormat',
4179 'qcow': 'BlockdevOptionsGenericCOWFormat',
4180 'qcow2': 'BlockdevOptionsQcow2',
4181 'qed': 'BlockdevOptionsGenericCOWFormat',
4182 'raw': 'BlockdevOptionsGenericFormat',
4183 'vdi': 'BlockdevOptionsGenericFormat',
4184 'vhdx': 'BlockdevOptionsGenericFormat',
4185 'vmdk': 'BlockdevOptionsGenericCOWFormat',
4186 'vpc': 'BlockdevOptionsGenericFormat'
4192 # Reference to a block device.
4194 # @definition: defines a new block device inline
4195 # @reference: references the ID of an existing block device. An
4196 # empty string means that no block device should be
4201 { 'union': 'BlockdevRef',
4202 'discriminator': {},
4203 'data': { 'definition': 'BlockdevOptions',
4204 'reference': 'str' } }
4209 # Creates a new block device.
4211 # @options: block device options for the new device
4215 { 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }