2022-08-11 14:24:39 +02:00
|
|
|
# -*- Mode: Python -*-
|
|
|
|
# vim: filetype=python
|
|
|
|
#
|
|
|
|
|
|
|
|
##
|
|
|
|
# = Virtio devices
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# @VirtioInfo:
|
|
|
|
#
|
|
|
|
# Basic information about a given VirtIODevice
|
|
|
|
#
|
|
|
|
# @path: The VirtIODevice's canonical QOM path
|
|
|
|
#
|
|
|
|
# @name: Name of the VirtIODevice
|
|
|
|
#
|
|
|
|
# Since: 7.1
|
|
|
|
#
|
|
|
|
##
|
|
|
|
{ 'struct': 'VirtioInfo',
|
|
|
|
'data': { 'path': 'str',
|
|
|
|
'name': 'str' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @x-query-virtio:
|
|
|
|
#
|
|
|
|
# Returns a list of all realized VirtIODevices
|
|
|
|
#
|
|
|
|
# Features:
|
|
|
|
# @unstable: This command is meant for debugging.
|
|
|
|
#
|
|
|
|
# Returns: List of gathered VirtIODevices
|
|
|
|
#
|
|
|
|
# Since: 7.1
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> { "execute": "x-query-virtio" }
|
|
|
|
# <- { "return": [
|
|
|
|
# {
|
|
|
|
# "name": "virtio-input",
|
|
|
|
# "path": "/machine/peripheral-anon/device[4]/virtio-backend"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name": "virtio-crypto",
|
|
|
|
# "path": "/machine/peripheral/crypto0/virtio-backend"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name": "virtio-scsi",
|
|
|
|
# "path": "/machine/peripheral-anon/device[2]/virtio-backend"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name": "virtio-net",
|
|
|
|
# "path": "/machine/peripheral-anon/device[1]/virtio-backend"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name": "virtio-serial",
|
|
|
|
# "path": "/machine/peripheral-anon/device[0]/virtio-backend"
|
|
|
|
# }
|
|
|
|
# ]
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
{ 'command': 'x-query-virtio',
|
|
|
|
'returns': [ 'VirtioInfo' ],
|
|
|
|
'features': [ 'unstable' ] }
|
2022-08-11 14:24:40 +02:00
|
|
|
|
|
|
|
##
|
|
|
|
# @VhostStatus:
|
|
|
|
#
|
|
|
|
# Information about a vhost device. This information will only be
|
|
|
|
# displayed if the vhost device is active.
|
|
|
|
#
|
|
|
|
# @n-mem-sections: vhost_dev n_mem_sections
|
|
|
|
#
|
|
|
|
# @n-tmp-sections: vhost_dev n_tmp_sections
|
|
|
|
#
|
|
|
|
# @nvqs: vhost_dev nvqs (number of virtqueues being used)
|
|
|
|
#
|
|
|
|
# @vq-index: vhost_dev vq_index
|
|
|
|
#
|
|
|
|
# @features: vhost_dev features
|
|
|
|
#
|
|
|
|
# @acked-features: vhost_dev acked_features
|
|
|
|
#
|
|
|
|
# @backend-features: vhost_dev backend_features
|
|
|
|
#
|
|
|
|
# @protocol-features: vhost_dev protocol_features
|
|
|
|
#
|
|
|
|
# @max-queues: vhost_dev max_queues
|
|
|
|
#
|
|
|
|
# @backend-cap: vhost_dev backend_cap
|
|
|
|
#
|
|
|
|
# @log-enabled: vhost_dev log_enabled flag
|
|
|
|
#
|
|
|
|
# @log-size: vhost_dev log_size
|
|
|
|
#
|
|
|
|
# Since: 7.1
|
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
{ 'struct': 'VhostStatus',
|
|
|
|
'data': { 'n-mem-sections': 'int',
|
|
|
|
'n-tmp-sections': 'int',
|
|
|
|
'nvqs': 'uint32',
|
|
|
|
'vq-index': 'int',
|
|
|
|
'features': 'uint64',
|
|
|
|
'acked-features': 'uint64',
|
|
|
|
'backend-features': 'uint64',
|
|
|
|
'protocol-features': 'uint64',
|
|
|
|
'max-queues': 'uint64',
|
|
|
|
'backend-cap': 'uint64',
|
|
|
|
'log-enabled': 'bool',
|
|
|
|
'log-size': 'uint64' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @VirtioStatus:
|
|
|
|
#
|
|
|
|
# Full status of the virtio device with most VirtIODevice members.
|
|
|
|
# Also includes the full status of the corresponding vhost device
|
|
|
|
# if the vhost device is active.
|
|
|
|
#
|
|
|
|
# @name: VirtIODevice name
|
|
|
|
#
|
|
|
|
# @device-id: VirtIODevice ID
|
|
|
|
#
|
|
|
|
# @vhost-started: VirtIODevice vhost_started flag
|
|
|
|
#
|
|
|
|
# @guest-features: VirtIODevice guest_features
|
|
|
|
#
|
|
|
|
# @host-features: VirtIODevice host_features
|
|
|
|
#
|
|
|
|
# @backend-features: VirtIODevice backend_features
|
|
|
|
#
|
|
|
|
# @device-endian: VirtIODevice device_endian
|
|
|
|
#
|
|
|
|
# @num-vqs: VirtIODevice virtqueue count. This is the number of active
|
|
|
|
# virtqueues being used by the VirtIODevice.
|
|
|
|
#
|
|
|
|
# @status: VirtIODevice configuration status (VirtioDeviceStatus)
|
|
|
|
#
|
|
|
|
# @isr: VirtIODevice ISR
|
|
|
|
#
|
|
|
|
# @queue-sel: VirtIODevice queue_sel
|
|
|
|
#
|
|
|
|
# @vm-running: VirtIODevice vm_running flag
|
|
|
|
#
|
|
|
|
# @broken: VirtIODevice broken flag
|
|
|
|
#
|
|
|
|
# @disabled: VirtIODevice disabled flag
|
|
|
|
#
|
|
|
|
# @use-started: VirtIODevice use_started flag
|
|
|
|
#
|
|
|
|
# @started: VirtIODevice started flag
|
|
|
|
#
|
|
|
|
# @start-on-kick: VirtIODevice start_on_kick flag
|
|
|
|
#
|
|
|
|
# @disable-legacy-check: VirtIODevice disabled_legacy_check flag
|
|
|
|
#
|
|
|
|
# @bus-name: VirtIODevice bus_name
|
|
|
|
#
|
|
|
|
# @use-guest-notifier-mask: VirtIODevice use_guest_notifier_mask flag
|
|
|
|
#
|
|
|
|
# @vhost-dev: Corresponding vhost device info for a given VirtIODevice.
|
|
|
|
# Present if the given VirtIODevice has an active vhost
|
|
|
|
# device.
|
|
|
|
#
|
|
|
|
# Since: 7.1
|
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
{ 'struct': 'VirtioStatus',
|
|
|
|
'data': { 'name': 'str',
|
|
|
|
'device-id': 'uint16',
|
|
|
|
'vhost-started': 'bool',
|
|
|
|
'device-endian': 'str',
|
|
|
|
'guest-features': 'uint64',
|
|
|
|
'host-features': 'uint64',
|
|
|
|
'backend-features': 'uint64',
|
|
|
|
'num-vqs': 'int',
|
|
|
|
'status': 'uint8',
|
|
|
|
'isr': 'uint8',
|
|
|
|
'queue-sel': 'uint16',
|
|
|
|
'vm-running': 'bool',
|
|
|
|
'broken': 'bool',
|
|
|
|
'disabled': 'bool',
|
|
|
|
'use-started': 'bool',
|
|
|
|
'started': 'bool',
|
|
|
|
'start-on-kick': 'bool',
|
|
|
|
'disable-legacy-check': 'bool',
|
|
|
|
'bus-name': 'str',
|
|
|
|
'use-guest-notifier-mask': 'bool',
|
|
|
|
'*vhost-dev': 'VhostStatus' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @x-query-virtio-status:
|
|
|
|
#
|
|
|
|
# Poll for a comprehensive status of a given virtio device
|
|
|
|
#
|
|
|
|
# @path: Canonical QOM path of the VirtIODevice
|
|
|
|
#
|
|
|
|
# Features:
|
|
|
|
# @unstable: This command is meant for debugging.
|
|
|
|
#
|
|
|
|
# Returns: VirtioStatus of the virtio device
|
|
|
|
#
|
|
|
|
# Since: 7.1
|
|
|
|
#
|
|
|
|
# Examples:
|
|
|
|
#
|
|
|
|
# 1. Poll for the status of virtio-crypto (no vhost-crypto active)
|
|
|
|
#
|
|
|
|
# -> { "execute": "x-query-virtio-status",
|
|
|
|
# "arguments": { "path": "/machine/peripheral/crypto0/virtio-backend" }
|
|
|
|
# }
|
|
|
|
# <- { "return": {
|
|
|
|
# "device-endian": "little",
|
|
|
|
# "bus-name": "",
|
|
|
|
# "disable-legacy-check": false,
|
|
|
|
# "name": "virtio-crypto",
|
|
|
|
# "started": true,
|
|
|
|
# "device-id": 20,
|
|
|
|
# "backend-features": 0,
|
|
|
|
# "start-on-kick": false,
|
|
|
|
# "isr": 1,
|
|
|
|
# "broken": false,
|
|
|
|
# "status": 15,
|
|
|
|
# "num-vqs": 2,
|
|
|
|
# "guest-features": 5100273664,
|
|
|
|
# "host-features": 6325010432,
|
|
|
|
# "use-guest-notifier-mask": true,
|
|
|
|
# "vm-running": true,
|
|
|
|
# "queue-sel": 1,
|
|
|
|
# "disabled": false,
|
|
|
|
# "vhost-started": false,
|
|
|
|
# "use-started": true
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# 2. Poll for the status of virtio-net (vhost-net is active)
|
|
|
|
#
|
|
|
|
# -> { "execute": "x-query-virtio-status",
|
|
|
|
# "arguments": { "path": "/machine/peripheral-anon/device[1]/virtio-backend" }
|
|
|
|
# }
|
|
|
|
# <- { "return": {
|
|
|
|
# "device-endian": "little",
|
|
|
|
# "bus-name": "",
|
|
|
|
# "disabled-legacy-check": false,
|
|
|
|
# "name": "virtio-net",
|
|
|
|
# "started": true,
|
|
|
|
# "device-id": 1,
|
|
|
|
# "vhost-dev": {
|
|
|
|
# "n-tmp-sections": 4,
|
|
|
|
# "n-mem-sections": 4,
|
|
|
|
# "max-queues": 1,
|
|
|
|
# "backend-cap": 2,
|
|
|
|
# "log-size": 0,
|
|
|
|
# "backend-features": 0,
|
|
|
|
# "nvqs": 2,
|
|
|
|
# "protocol-features": 0,
|
|
|
|
# "vq-index": 0,
|
|
|
|
# "log-enabled": false,
|
|
|
|
# "acked-features": 5100306432,
|
|
|
|
# "features": 13908344832
|
|
|
|
# },
|
|
|
|
# "backend-features": 6337593319,
|
|
|
|
# "start-on-kick": false,
|
|
|
|
# "isr": 1,
|
|
|
|
# "broken": false,
|
|
|
|
# "status": 15,
|
|
|
|
# "num-vqs": 3,
|
|
|
|
# "guest-features": 5111807911,
|
|
|
|
# "host-features": 6337593319,
|
|
|
|
# "use-guest-notifier-mask": true,
|
|
|
|
# "vm-running": true,
|
|
|
|
# "queue-sel": 2,
|
|
|
|
# "disabled": false,
|
|
|
|
# "vhost-started": true,
|
|
|
|
# "use-started": true
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
{ 'command': 'x-query-virtio-status',
|
|
|
|
'data': { 'path': 'str' },
|
|
|
|
'returns': 'VirtioStatus',
|
|
|
|
'features': [ 'unstable' ] }
|