2014-06-05 15:45:30 +04:00
|
|
|
# -*- Mode: Python -*-
|
2017-01-13 17:41:23 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# = QAPI block definitions
|
|
|
|
##
|
2014-06-05 15:45:30 +04:00
|
|
|
|
|
|
|
# QAPI block core definitions
|
|
|
|
{ 'include': 'block-core.json' }
|
|
|
|
|
2017-01-13 17:41:23 +03:00
|
|
|
##
|
|
|
|
# == QAPI block definitions (vm unrelated)
|
|
|
|
##
|
|
|
|
|
2014-06-05 15:45:32 +04:00
|
|
|
##
|
2015-09-25 17:03:30 +03:00
|
|
|
# @BiosAtaTranslation:
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
|
|
|
# Policy that BIOS should use to interpret cylinder/head/sector
|
|
|
|
# addresses. Note that Bochs BIOS and SeaBIOS will not actually
|
|
|
|
# translate logical CHS to physical; instead, they will use logical
|
|
|
|
# block addressing.
|
|
|
|
#
|
|
|
|
# @auto: If cylinder/heads/sizes are passed, choose between none and LBA
|
|
|
|
# depending on the size of the disk. If they are not passed,
|
|
|
|
# choose none if QEMU can guess that the disk had 16 or fewer
|
|
|
|
# heads, large if QEMU can guess that the disk had 131072 or
|
|
|
|
# fewer tracks across all heads (i.e. cylinders*heads<131072),
|
|
|
|
# otherwise LBA.
|
|
|
|
#
|
|
|
|
# @none: The physical disk geometry is equal to the logical geometry.
|
|
|
|
#
|
|
|
|
# @lba: Assume 63 sectors per track and one of 16, 32, 64, 128 or 255
|
|
|
|
# heads (if fewer than 255 are enough to cover the whole disk
|
|
|
|
# with 1024 cylinders/head). The number of cylinders/head is
|
|
|
|
# then computed based on the number of sectors and heads.
|
|
|
|
#
|
|
|
|
# @large: The number of cylinders per head is scaled down to 1024
|
|
|
|
# by correspondingly scaling up the number of heads.
|
|
|
|
#
|
|
|
|
# @rechs: Same as @large, but first convert a 16-head geometry to
|
|
|
|
# 15-head, by proportionally scaling up the number of
|
|
|
|
# cylinders/head.
|
|
|
|
#
|
|
|
|
# Since: 2.0
|
|
|
|
##
|
|
|
|
{ 'enum': 'BiosAtaTranslation',
|
|
|
|
'data': ['auto', 'none', 'lba', 'large', 'rechs']}
|
|
|
|
|
2016-01-22 23:50:56 +03:00
|
|
|
##
|
2016-11-17 18:54:55 +03:00
|
|
|
# @FloppyDriveType:
|
2016-01-22 23:50:56 +03:00
|
|
|
#
|
|
|
|
# Type of Floppy drive to be emulated by the Floppy Disk Controller.
|
|
|
|
#
|
|
|
|
# @144: 1.44MB 3.5" drive
|
|
|
|
# @288: 2.88MB 3.5" drive
|
|
|
|
# @120: 1.2MB 5.25" drive
|
|
|
|
# @none: No drive connected
|
|
|
|
# @auto: Automatically determined by inserted media at boot
|
|
|
|
#
|
|
|
|
# Since: 2.6
|
|
|
|
##
|
|
|
|
{ 'enum': 'FloppyDriveType',
|
|
|
|
'data': ['144', '288', '120', 'none', 'auto']}
|
|
|
|
|
2014-06-05 15:45:32 +04:00
|
|
|
##
|
2016-11-17 18:54:55 +03:00
|
|
|
# @BlockdevSnapshotInternal:
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
2016-06-23 15:20:24 +03:00
|
|
|
# @device: the device name or node-name of a root node to generate the snapshot
|
|
|
|
# from
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
|
|
|
# @name: the name of the internal snapshot to be created
|
|
|
|
#
|
|
|
|
# Notes: In transaction, if @name is empty, or any snapshot matching @name
|
|
|
|
# exists, the operation will fail. Only some image formats support it,
|
|
|
|
# for example, qcow2, rbd, and sheepdog.
|
|
|
|
#
|
|
|
|
# Since: 1.7
|
|
|
|
##
|
2015-05-04 18:05:27 +03:00
|
|
|
{ 'struct': 'BlockdevSnapshotInternal',
|
2014-06-05 15:45:32 +04:00
|
|
|
'data': { 'device': 'str', 'name': 'str' } }
|
|
|
|
|
|
|
|
##
|
2016-11-17 18:54:55 +03:00
|
|
|
# @blockdev-snapshot-internal-sync:
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
|
|
|
# Synchronously take an internal snapshot of a block device, when the format
|
|
|
|
# of the image used supports it.
|
|
|
|
#
|
|
|
|
# For the arguments, see the documentation of BlockdevSnapshotInternal.
|
|
|
|
#
|
|
|
|
# Returns: nothing on success
|
2016-06-23 15:20:24 +03:00
|
|
|
# If @device is not a valid block device, GenericError
|
2014-06-05 15:45:32 +04:00
|
|
|
# If any snapshot matching @name exists, or @name is empty,
|
|
|
|
# GenericError
|
|
|
|
# If the format of the image used does not support it,
|
|
|
|
# BlockFormatFeatureNotSupported
|
|
|
|
#
|
2016-11-17 18:54:55 +03:00
|
|
|
# Since: 1.7
|
2014-06-05 15:45:32 +04:00
|
|
|
##
|
|
|
|
{ 'command': 'blockdev-snapshot-internal-sync',
|
|
|
|
'data': 'BlockdevSnapshotInternal' }
|
|
|
|
|
|
|
|
##
|
2016-11-17 18:54:55 +03:00
|
|
|
# @blockdev-snapshot-delete-internal-sync:
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
|
|
|
# Synchronously delete an internal snapshot of a block device, when the format
|
|
|
|
# of the image used support it. The snapshot is identified by name or id or
|
|
|
|
# both. One of the name or id is required. Return SnapshotInfo for the
|
|
|
|
# successfully deleted snapshot.
|
|
|
|
#
|
2016-06-23 15:20:24 +03:00
|
|
|
# @device: the device name or node-name of a root node to delete the snapshot
|
|
|
|
# from
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
|
|
|
# @id: optional the snapshot's ID to be deleted
|
|
|
|
#
|
|
|
|
# @name: optional the snapshot's name to be deleted
|
|
|
|
#
|
|
|
|
# Returns: SnapshotInfo on success
|
2016-06-23 15:20:24 +03:00
|
|
|
# If @device is not a valid block device, GenericError
|
2014-06-05 15:45:32 +04:00
|
|
|
# If snapshot not found, GenericError
|
|
|
|
# If the format of the image used does not support it,
|
|
|
|
# BlockFormatFeatureNotSupported
|
|
|
|
# If @id and @name are both not specified, GenericError
|
|
|
|
#
|
2016-11-17 18:54:55 +03:00
|
|
|
# Since: 1.7
|
2014-06-05 15:45:32 +04:00
|
|
|
##
|
|
|
|
{ 'command': 'blockdev-snapshot-delete-internal-sync',
|
|
|
|
'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
|
|
|
|
'returns': 'SnapshotInfo' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @eject:
|
|
|
|
#
|
|
|
|
# Ejects a device from a removable drive.
|
|
|
|
#
|
2016-09-20 14:38:46 +03:00
|
|
|
# @device: #optional Block device name (deprecated, use @id instead)
|
|
|
|
#
|
|
|
|
# @id: #optional The name or QOM path of the guest device (since: 2.8)
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
|
|
|
# @force: @optional If true, eject regardless of whether the drive is locked.
|
|
|
|
# If not specified, the default value is false.
|
|
|
|
#
|
|
|
|
# Returns: Nothing on success
|
|
|
|
# If @device is not a valid block device, DeviceNotFound
|
|
|
|
#
|
|
|
|
# Notes: Ejecting a device will no media results in success
|
|
|
|
#
|
|
|
|
# Since: 0.14.0
|
|
|
|
##
|
2016-09-20 14:38:46 +03:00
|
|
|
{ 'command': 'eject',
|
|
|
|
'data': { '*device': 'str',
|
|
|
|
'*id': 'str',
|
|
|
|
'*force': 'bool' } }
|
2014-06-05 15:45:32 +04:00
|
|
|
|
|
|
|
##
|
|
|
|
# @nbd-server-start:
|
|
|
|
#
|
|
|
|
# Start an NBD server listening on the given host and port. Block
|
|
|
|
# devices can then be exported using @nbd-server-add. The NBD
|
|
|
|
# server will present them as named exports; for example, another
|
|
|
|
# QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
|
|
|
|
#
|
|
|
|
# @addr: Address on which to listen.
|
2016-02-10 21:41:14 +03:00
|
|
|
# @tls-creds: (optional) ID of the TLS credentials object. Since 2.6
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
|
|
|
# Returns: error if the server is already running.
|
|
|
|
#
|
|
|
|
# Since: 1.3.0
|
|
|
|
##
|
|
|
|
{ 'command': 'nbd-server-start',
|
2016-02-10 21:41:14 +03:00
|
|
|
'data': { 'addr': 'SocketAddress',
|
|
|
|
'*tls-creds': 'str'} }
|
2014-06-05 15:45:32 +04:00
|
|
|
|
|
|
|
##
|
|
|
|
# @nbd-server-add:
|
|
|
|
#
|
2016-07-06 15:15:51 +03:00
|
|
|
# Export a block node to QEMU's embedded NBD server.
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
2016-07-06 15:15:51 +03:00
|
|
|
# @device: The device name or node name of the node to be exported
|
2014-06-05 15:45:32 +04:00
|
|
|
#
|
|
|
|
# @writable: Whether clients should be able to write to the device via the
|
|
|
|
# NBD connection (default false). #optional
|
|
|
|
#
|
|
|
|
# Returns: error if the device is already marked for export.
|
|
|
|
#
|
|
|
|
# Since: 1.3.0
|
|
|
|
##
|
|
|
|
{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @nbd-server-stop:
|
|
|
|
#
|
|
|
|
# Stop QEMU's embedded NBD server, and unregister all devices previously
|
|
|
|
# added via @nbd-server-add.
|
|
|
|
#
|
|
|
|
# Since: 1.3.0
|
|
|
|
##
|
|
|
|
{ 'command': 'nbd-server-stop' }
|
|
|
|
|
2014-06-18 10:43:44 +04:00
|
|
|
##
|
2016-11-17 18:54:55 +03:00
|
|
|
# @DEVICE_TRAY_MOVED:
|
2014-06-18 10:43:44 +04:00
|
|
|
#
|
|
|
|
# Emitted whenever the tray of a removable device is moved by the guest or by
|
|
|
|
# HMP/QMP commands
|
|
|
|
#
|
2016-09-29 19:30:53 +03:00
|
|
|
# @device: Block device name. This is always present for compatibility
|
|
|
|
# reasons, but it can be empty ("") if the image does not
|
|
|
|
# have a device name associated.
|
|
|
|
#
|
2016-12-06 19:03:45 +03:00
|
|
|
# @id: The name or QOM path of the guest device (since 2.8)
|
2014-06-18 10:43:44 +04:00
|
|
|
#
|
|
|
|
# @tray-open: true if the tray has been opened or false if it has been closed
|
|
|
|
#
|
|
|
|
# Since: 1.1
|
|
|
|
##
|
|
|
|
{ 'event': 'DEVICE_TRAY_MOVED',
|
2016-09-29 19:30:53 +03:00
|
|
|
'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
|
2016-02-26 04:39:01 +03:00
|
|
|
|
|
|
|
##
|
2016-11-17 18:54:55 +03:00
|
|
|
# @QuorumOpType:
|
2016-02-26 04:39:01 +03:00
|
|
|
#
|
|
|
|
# An enumeration of the quorum operation types
|
|
|
|
#
|
|
|
|
# @read: read operation
|
|
|
|
#
|
|
|
|
# @write: write operation
|
|
|
|
#
|
|
|
|
# @flush: flush operation
|
|
|
|
#
|
|
|
|
# Since: 2.6
|
|
|
|
##
|
|
|
|
{ 'enum': 'QuorumOpType',
|
|
|
|
'data': [ 'read', 'write', 'flush' ] }
|