2014-06-05 19:45:30 +08:00
|
|
|
# -*- Mode: Python -*-
|
2017-01-13 22:41:23 +08:00
|
|
|
|
|
|
|
##
|
2017-08-25 03:14:08 +08:00
|
|
|
# = Block devices
|
2017-01-13 22:41:23 +08:00
|
|
|
##
|
2014-06-05 19:45:30 +08:00
|
|
|
|
|
|
|
{ 'include': 'block-core.json' }
|
|
|
|
|
2017-01-13 22:41:23 +08:00
|
|
|
##
|
2017-08-25 03:14:08 +08:00
|
|
|
# == Additional block stuff (VM related)
|
2017-01-13 22:41:23 +08:00
|
|
|
##
|
|
|
|
|
2014-06-05 19:45:32 +08:00
|
|
|
##
|
2015-09-25 22:03:30 +08:00
|
|
|
# @BiosAtaTranslation:
|
2014-06-05 19:45:32 +08: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-23 04:50:56 +08:00
|
|
|
##
|
2016-11-17 23:54:55 +08:00
|
|
|
# @FloppyDriveType:
|
2016-01-23 04:50:56 +08: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 19:45:32 +08:00
|
|
|
##
|
2016-11-17 23:54:55 +08:00
|
|
|
# @BlockdevSnapshotInternal:
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
2016-06-23 20:20:24 +08:00
|
|
|
# @device: the device name or node-name of a root node to generate the snapshot
|
|
|
|
# from
|
2014-06-05 19:45:32 +08: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 23:05:27 +08:00
|
|
|
{ 'struct': 'BlockdevSnapshotInternal',
|
2014-06-05 19:45:32 +08:00
|
|
|
'data': { 'device': 'str', 'name': 'str' } }
|
|
|
|
|
2018-03-01 01:47:57 +08:00
|
|
|
##
|
|
|
|
# @PRManagerInfo:
|
|
|
|
#
|
|
|
|
# Information about a persistent reservation manager
|
|
|
|
#
|
|
|
|
# @id: the identifier of the persistent reservation manager
|
|
|
|
#
|
|
|
|
# @connected: true if the persistent reservation manager is connected to
|
|
|
|
# the underlying storage or helper
|
|
|
|
#
|
|
|
|
# Since: 3.0
|
|
|
|
##
|
|
|
|
{ 'struct': 'PRManagerInfo',
|
|
|
|
'data': {'id': 'str', 'connected': 'bool'} }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @query-pr-managers:
|
|
|
|
#
|
|
|
|
# Returns a list of information about each persistent reservation manager.
|
|
|
|
#
|
|
|
|
# Returns: a list of @PRManagerInfo for each persistent reservation manager
|
|
|
|
#
|
|
|
|
# Since: 3.0
|
|
|
|
##
|
|
|
|
{ 'command': 'query-pr-managers', 'returns': ['PRManagerInfo'],
|
|
|
|
'allow-preconfig': true }
|
|
|
|
|
|
|
|
|
2014-06-05 19:45:32 +08:00
|
|
|
##
|
2016-11-17 23:54:55 +08:00
|
|
|
# @blockdev-snapshot-internal-sync:
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
2016-06-23 21:06:14 +08:00
|
|
|
# Synchronously take an internal snapshot of a block device, when the
|
|
|
|
# format of the image used supports it. If the name is an empty
|
|
|
|
# string, or a snapshot with name already exists, the operation will
|
|
|
|
# fail.
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
|
|
|
# For the arguments, see the documentation of BlockdevSnapshotInternal.
|
|
|
|
#
|
|
|
|
# Returns: nothing on success
|
2016-06-23 21:06:14 +08:00
|
|
|
#
|
2016-06-23 20:20:24 +08:00
|
|
|
# If @device is not a valid block device, GenericError
|
2016-06-23 21:06:14 +08:00
|
|
|
#
|
2014-06-05 19:45:32 +08:00
|
|
|
# If any snapshot matching @name exists, or @name is empty,
|
|
|
|
# GenericError
|
2016-06-23 21:06:14 +08:00
|
|
|
#
|
2014-06-05 19:45:32 +08:00
|
|
|
# If the format of the image used does not support it,
|
|
|
|
# BlockFormatFeatureNotSupported
|
|
|
|
#
|
2016-11-17 23:54:55 +08:00
|
|
|
# Since: 1.7
|
2016-06-23 21:06:14 +08:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> { "execute": "blockdev-snapshot-internal-sync",
|
|
|
|
# "arguments": { "device": "ide-hd0",
|
|
|
|
# "name": "snapshot0" }
|
|
|
|
# }
|
|
|
|
# <- { "return": {} }
|
|
|
|
#
|
2014-06-05 19:45:32 +08:00
|
|
|
##
|
|
|
|
{ 'command': 'blockdev-snapshot-internal-sync',
|
|
|
|
'data': 'BlockdevSnapshotInternal' }
|
|
|
|
|
|
|
|
##
|
2016-11-17 23:54:55 +08:00
|
|
|
# @blockdev-snapshot-delete-internal-sync:
|
2014-06-05 19:45:32 +08: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 20:20:24 +08:00
|
|
|
# @device: the device name or node-name of a root node to delete the snapshot
|
|
|
|
# from
|
2014-06-05 19:45:32 +08: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 20:20:24 +08:00
|
|
|
# If @device is not a valid block device, GenericError
|
2014-06-05 19:45:32 +08: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 23:54:55 +08:00
|
|
|
# Since: 1.7
|
2016-06-23 21:07:40 +08:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> { "execute": "blockdev-snapshot-delete-internal-sync",
|
|
|
|
# "arguments": { "device": "ide-hd0",
|
|
|
|
# "name": "snapshot0" }
|
|
|
|
# }
|
|
|
|
# <- { "return": {
|
|
|
|
# "id": "1",
|
|
|
|
# "name": "snapshot0",
|
|
|
|
# "vm-state-size": 0,
|
|
|
|
# "date-sec": 1000012,
|
|
|
|
# "date-nsec": 10,
|
|
|
|
# "vm-clock-sec": 100,
|
|
|
|
# "vm-clock-nsec": 20
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#
|
2014-06-05 19:45:32 +08:00
|
|
|
##
|
|
|
|
{ 'command': 'blockdev-snapshot-delete-internal-sync',
|
|
|
|
'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
|
|
|
|
'returns': 'SnapshotInfo' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @eject:
|
|
|
|
#
|
|
|
|
# Ejects a device from a removable drive.
|
|
|
|
#
|
2017-03-15 20:57:06 +08:00
|
|
|
# @device: Block device name (deprecated, use @id instead)
|
2016-09-20 19:38:46 +08:00
|
|
|
#
|
2017-03-15 20:57:06 +08:00
|
|
|
# @id: The name or QOM path of the guest device (since: 2.8)
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
2017-03-15 20:57:06 +08:00
|
|
|
# @force: If true, eject regardless of whether the drive is locked.
|
2014-06-05 19:45:32 +08:00
|
|
|
# If not specified, the default value is false.
|
|
|
|
#
|
|
|
|
# Returns: Nothing on success
|
2016-06-23 21:08:55 +08:00
|
|
|
#
|
2014-06-05 19:45:32 +08:00
|
|
|
# If @device is not a valid block device, DeviceNotFound
|
|
|
|
#
|
2016-06-23 21:08:55 +08:00
|
|
|
# Notes: Ejecting a device with no media results in success
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
|
|
|
# Since: 0.14.0
|
2016-06-23 21:08:55 +08:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
2017-05-24 01:44:20 +08:00
|
|
|
# -> { "execute": "eject", "arguments": { "id": "ide1-0-1" } }
|
2016-06-23 21:08:55 +08:00
|
|
|
# <- { "return": {} }
|
2014-06-05 19:45:32 +08:00
|
|
|
##
|
2016-09-20 19:38:46 +08:00
|
|
|
{ 'command': 'eject',
|
|
|
|
'data': { '*device': 'str',
|
|
|
|
'*id': 'str',
|
|
|
|
'*force': 'bool' } }
|
2014-06-05 19:45:32 +08: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-11 02:41:14 +08:00
|
|
|
# @tls-creds: (optional) ID of the TLS credentials object. Since 2.6
|
nbd: allow authorization with nbd-server-start QMP command
As with the previous patch to qemu-nbd, the nbd-server-start QMP command
also needs to be able to specify authorization when enabling TLS encryption.
First the client must create a QAuthZ object instance using the
'object-add' command:
{
'execute': 'object-add',
'arguments': {
'qom-type': 'authz-list',
'id': 'authz0',
'parameters': {
'policy': 'deny',
'rules': [
{
'match': '*CN=fred',
'policy': 'allow'
}
]
}
}
}
They can then reference this in the new 'tls-authz' parameter when
executing the 'nbd-server-start' command:
{
'execute': 'nbd-server-start',
'arguments': {
'addr': {
'type': 'inet',
'host': '127.0.0.1',
'port': '9000'
},
'tls-creds': 'tls0',
'tls-authz': 'authz0'
}
}
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20190227162035.18543-3-berrange@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2019-02-28 00:20:34 +08:00
|
|
|
# @tls-authz: ID of the QAuthZ authorization object used to validate
|
|
|
|
# the client's x509 distinguished name. This object is
|
|
|
|
# is only resolved at time of use, so can be deleted and
|
|
|
|
# recreated on the fly while the NBD server is active.
|
|
|
|
# If missing, it will default to denying access (since 4.0).
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
|
|
|
# Returns: error if the server is already running.
|
|
|
|
#
|
|
|
|
# Since: 1.3.0
|
|
|
|
##
|
|
|
|
{ 'command': 'nbd-server-start',
|
2017-04-26 15:36:39 +08:00
|
|
|
'data': { 'addr': 'SocketAddressLegacy',
|
nbd: allow authorization with nbd-server-start QMP command
As with the previous patch to qemu-nbd, the nbd-server-start QMP command
also needs to be able to specify authorization when enabling TLS encryption.
First the client must create a QAuthZ object instance using the
'object-add' command:
{
'execute': 'object-add',
'arguments': {
'qom-type': 'authz-list',
'id': 'authz0',
'parameters': {
'policy': 'deny',
'rules': [
{
'match': '*CN=fred',
'policy': 'allow'
}
]
}
}
}
They can then reference this in the new 'tls-authz' parameter when
executing the 'nbd-server-start' command:
{
'execute': 'nbd-server-start',
'arguments': {
'addr': {
'type': 'inet',
'host': '127.0.0.1',
'port': '9000'
},
'tls-creds': 'tls0',
'tls-authz': 'authz0'
}
}
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20190227162035.18543-3-berrange@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
2019-02-28 00:20:34 +08:00
|
|
|
'*tls-creds': 'str',
|
|
|
|
'*tls-authz': 'str'} }
|
2014-06-05 19:45:32 +08:00
|
|
|
|
|
|
|
##
|
|
|
|
# @nbd-server-add:
|
|
|
|
#
|
2016-07-06 20:15:51 +08:00
|
|
|
# Export a block node to QEMU's embedded NBD server.
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
2016-07-06 20:15:51 +08:00
|
|
|
# @device: The device name or node name of the node to be exported
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
2018-01-19 21:57:15 +08:00
|
|
|
# @name: Export name. If unspecified, the @device parameter is used as the
|
|
|
|
# export name. (Since 2.12)
|
|
|
|
#
|
2014-06-05 19:45:32 +08:00
|
|
|
# @writable: Whether clients should be able to write to the device via the
|
2017-03-15 20:57:06 +08:00
|
|
|
# NBD connection (default false).
|
nbd: Allow bitmap export during QMP nbd-server-add
With the experimental x-nbd-server-add-bitmap command, there was
a window of time where an NBD client could see the export but not
the associated dirty bitmap, which can cause a client that planned
on using the dirty bitmap to be forced to treat the entire image
as dirty as a safety fallback. Furthermore, if the QMP client
successfully exports a disk but then fails to add the bitmap, it
has to take on the burden of removing the export. Since we don't
allow changing the exposed dirty bitmap (whether to a different
bitmap, or removing advertisement of the bitmap), it is nicer to
make the bitmap tied to the export at the time the export is
created, with automatic failure to export if the bitmap is not
available.
The experimental command included an optional 'bitmap-export-name'
field for remapping the name exposed over NBD to be different from
the bitmap name stored on disk. However, my libvirt demo code
for implementing differential backups on top of persistent bitmaps
did not need to take advantage of that feature (it is instead
possible to create a new temporary bitmap with the desired name,
use block-dirty-bitmap-merge to merge one or more persistent
bitmaps into the temporary, then associate the temporary with the
NBD export, if control is needed over the exported bitmap name).
Hence, I'm not copying that part of the experiment over to the
stable addition. For more details on the libvirt demo, see
https://www.redhat.com/archives/libvir-list/2018-October/msg01254.html,
https://kvmforum2018.sched.com/event/FzuB/facilitating-incremental-backup-eric-blake-red-hat
This patch focuses on the user interface, and reduces (but does
not completely eliminate) the window where an NBD client can see
the export but not the dirty bitmap, with less work to clean up
after errors. Later patches will add further cleanups now that
this interface is declared stable via a single QMP command,
including removing the race window.
Update test 223 to use the new interface.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190111194720.15671-6-eblake@redhat.com>
2019-01-12 03:47:17 +08:00
|
|
|
|
|
|
|
# @bitmap: Also export the dirty bitmap reachable from @device, so the
|
|
|
|
# NBD client can use NBD_OPT_SET_META_CONTEXT with
|
|
|
|
# "qemu:dirty-bitmap:NAME" to inspect the bitmap. (since 4.0)
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
2018-01-19 21:57:15 +08:00
|
|
|
# Returns: error if the server is not running, or export with the same name
|
|
|
|
# already exists.
|
2014-06-05 19:45:32 +08:00
|
|
|
#
|
|
|
|
# Since: 1.3.0
|
|
|
|
##
|
2018-01-19 21:57:15 +08:00
|
|
|
{ 'command': 'nbd-server-add',
|
nbd: Allow bitmap export during QMP nbd-server-add
With the experimental x-nbd-server-add-bitmap command, there was
a window of time where an NBD client could see the export but not
the associated dirty bitmap, which can cause a client that planned
on using the dirty bitmap to be forced to treat the entire image
as dirty as a safety fallback. Furthermore, if the QMP client
successfully exports a disk but then fails to add the bitmap, it
has to take on the burden of removing the export. Since we don't
allow changing the exposed dirty bitmap (whether to a different
bitmap, or removing advertisement of the bitmap), it is nicer to
make the bitmap tied to the export at the time the export is
created, with automatic failure to export if the bitmap is not
available.
The experimental command included an optional 'bitmap-export-name'
field for remapping the name exposed over NBD to be different from
the bitmap name stored on disk. However, my libvirt demo code
for implementing differential backups on top of persistent bitmaps
did not need to take advantage of that feature (it is instead
possible to create a new temporary bitmap with the desired name,
use block-dirty-bitmap-merge to merge one or more persistent
bitmaps into the temporary, then associate the temporary with the
NBD export, if control is needed over the exported bitmap name).
Hence, I'm not copying that part of the experiment over to the
stable addition. For more details on the libvirt demo, see
https://www.redhat.com/archives/libvir-list/2018-October/msg01254.html,
https://kvmforum2018.sched.com/event/FzuB/facilitating-incremental-backup-eric-blake-red-hat
This patch focuses on the user interface, and reduces (but does
not completely eliminate) the window where an NBD client can see
the export but not the dirty bitmap, with less work to clean up
after errors. Later patches will add further cleanups now that
this interface is declared stable via a single QMP command,
including removing the race window.
Update test 223 to use the new interface.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20190111194720.15671-6-eblake@redhat.com>
2019-01-12 03:47:17 +08:00
|
|
|
'data': {'device': 'str', '*name': 'str', '*writable': 'bool',
|
|
|
|
'*bitmap': 'str' } }
|
2014-06-05 19:45:32 +08:00
|
|
|
|
2018-01-19 21:57:16 +08:00
|
|
|
##
|
|
|
|
# @NbdServerRemoveMode:
|
|
|
|
#
|
|
|
|
# Mode for removing an NBD export.
|
|
|
|
#
|
|
|
|
# @safe: Remove export if there are no existing connections, fail otherwise.
|
|
|
|
#
|
|
|
|
# @hard: Drop all connections immediately and remove export.
|
|
|
|
#
|
|
|
|
# Potential additional modes to be added in the future:
|
|
|
|
#
|
|
|
|
# hide: Just hide export from new clients, leave existing connections as is.
|
|
|
|
# Remove export after all clients are disconnected.
|
|
|
|
#
|
|
|
|
# soft: Hide export from new clients, answer with ESHUTDOWN for all further
|
|
|
|
# requests from existing clients.
|
|
|
|
#
|
|
|
|
# Since: 2.12
|
|
|
|
##
|
|
|
|
{'enum': 'NbdServerRemoveMode', 'data': ['safe', 'hard']}
|
|
|
|
|
|
|
|
##
|
|
|
|
# @nbd-server-remove:
|
|
|
|
#
|
|
|
|
# Remove NBD export by name.
|
|
|
|
#
|
|
|
|
# @name: Export name.
|
|
|
|
#
|
|
|
|
# @mode: Mode of command operation. See @NbdServerRemoveMode description.
|
|
|
|
# Default is 'safe'.
|
|
|
|
#
|
|
|
|
# Returns: error if
|
|
|
|
# - the server is not running
|
|
|
|
# - export is not found
|
|
|
|
# - mode is 'safe' and there are existing connections
|
|
|
|
#
|
|
|
|
# Since: 2.12
|
|
|
|
##
|
|
|
|
{ 'command': 'nbd-server-remove',
|
|
|
|
'data': {'name': 'str', '*mode': 'NbdServerRemoveMode'} }
|
|
|
|
|
2014-06-05 19:45:32 +08:00
|
|
|
##
|
|
|
|
# @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 14:43:44 +08:00
|
|
|
##
|
2016-11-17 23:54:55 +08:00
|
|
|
# @DEVICE_TRAY_MOVED:
|
2014-06-18 14:43:44 +08:00
|
|
|
#
|
|
|
|
# Emitted whenever the tray of a removable device is moved by the guest or by
|
|
|
|
# HMP/QMP commands
|
|
|
|
#
|
2016-09-30 00:30:53 +08: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-07 00:03:45 +08:00
|
|
|
# @id: The name or QOM path of the guest device (since 2.8)
|
2014-06-18 14:43:44 +08:00
|
|
|
#
|
|
|
|
# @tray-open: true if the tray has been opened or false if it has been closed
|
|
|
|
#
|
|
|
|
# Since: 1.1
|
2016-06-23 21:57:27 +08:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# <- { "event": "DEVICE_TRAY_MOVED",
|
|
|
|
# "data": { "device": "ide1-cd0",
|
|
|
|
# "id": "/machine/unattached/device[22]",
|
|
|
|
# "tray-open": true
|
|
|
|
# },
|
|
|
|
# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
|
|
|
|
#
|
2014-06-18 14:43:44 +08:00
|
|
|
##
|
|
|
|
{ 'event': 'DEVICE_TRAY_MOVED',
|
2016-09-30 00:30:53 +08:00
|
|
|
'data': { 'device': 'str', 'id': 'str', 'tray-open': 'bool' } }
|
2016-02-26 09:39:01 +08:00
|
|
|
|
2018-03-01 02:01:40 +08:00
|
|
|
##
|
|
|
|
# @PR_MANAGER_STATUS_CHANGED:
|
|
|
|
#
|
|
|
|
# Emitted whenever the connected status of a persistent reservation
|
|
|
|
# manager changes.
|
|
|
|
#
|
|
|
|
# @id: The id of the PR manager object
|
|
|
|
#
|
|
|
|
# @connected: true if the PR manager is connected to a backend
|
|
|
|
#
|
|
|
|
# Since: 3.0
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# <- { "event": "PR_MANAGER_STATUS_CHANGED",
|
|
|
|
# "data": { "id": "pr-helper0",
|
|
|
|
# "connected": true
|
|
|
|
# },
|
|
|
|
# "timestamp": { "seconds": 1519840375, "microseconds": 450486 } }
|
|
|
|
#
|
|
|
|
##
|
|
|
|
{ 'event': 'PR_MANAGER_STATUS_CHANGED',
|
|
|
|
'data': { 'id': 'str', 'connected': 'bool' } }
|
|
|
|
|
2016-02-26 09:39:01 +08:00
|
|
|
##
|
2016-11-17 23:54:55 +08:00
|
|
|
# @QuorumOpType:
|
2016-02-26 09:39:01 +08: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' ] }
|
2017-08-25 03:14:04 +08:00
|
|
|
|
|
|
|
##
|
|
|
|
# @QUORUM_FAILURE:
|
|
|
|
#
|
|
|
|
# Emitted by the Quorum block driver if it fails to establish a quorum
|
|
|
|
#
|
|
|
|
# @reference: device name if defined else node name
|
|
|
|
#
|
|
|
|
# @sector-num: number of the first sector of the failed read operation
|
|
|
|
#
|
|
|
|
# @sectors-count: failed read operation sector count
|
|
|
|
#
|
|
|
|
# Note: This event is rate-limited.
|
|
|
|
#
|
|
|
|
# Since: 2.0
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# <- { "event": "QUORUM_FAILURE",
|
|
|
|
# "data": { "reference": "usr1", "sector-num": 345435, "sectors-count": 5 },
|
|
|
|
# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
|
|
|
|
#
|
|
|
|
##
|
|
|
|
{ 'event': 'QUORUM_FAILURE',
|
|
|
|
'data': { 'reference': 'str', 'sector-num': 'int', 'sectors-count': 'int' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @QUORUM_REPORT_BAD:
|
|
|
|
#
|
|
|
|
# Emitted to report a corruption of a Quorum file
|
|
|
|
#
|
|
|
|
# @type: quorum operation type (Since 2.6)
|
|
|
|
#
|
|
|
|
# @error: error message. Only present on failure. This field
|
|
|
|
# contains a human-readable error message. There are no semantics other
|
|
|
|
# than that the block layer reported an error and clients should not
|
|
|
|
# try to interpret the error string.
|
|
|
|
#
|
|
|
|
# @node-name: the graph node name of the block driver state
|
|
|
|
#
|
|
|
|
# @sector-num: number of the first sector of the failed read operation
|
|
|
|
#
|
|
|
|
# @sectors-count: failed read operation sector count
|
|
|
|
#
|
|
|
|
# Note: This event is rate-limited.
|
|
|
|
#
|
|
|
|
# Since: 2.0
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# 1. Read operation
|
|
|
|
#
|
|
|
|
# { "event": "QUORUM_REPORT_BAD",
|
|
|
|
# "data": { "node-name": "node0", "sector-num": 345435, "sectors-count": 5,
|
|
|
|
# "type": "read" },
|
|
|
|
# "timestamp": { "seconds": 1344522075, "microseconds": 745528 } }
|
|
|
|
#
|
|
|
|
# 2. Flush operation
|
|
|
|
#
|
|
|
|
# { "event": "QUORUM_REPORT_BAD",
|
|
|
|
# "data": { "node-name": "node0", "sector-num": 0, "sectors-count": 2097120,
|
|
|
|
# "type": "flush", "error": "Broken pipe" },
|
|
|
|
# "timestamp": { "seconds": 1456406829, "microseconds": 291763 } }
|
|
|
|
#
|
|
|
|
##
|
|
|
|
{ 'event': 'QUORUM_REPORT_BAD',
|
|
|
|
'data': { 'type': 'QuorumOpType', '*error': 'str', 'node-name': 'str',
|
|
|
|
'sector-num': 'int', 'sectors-count': 'int' } }
|