2023-03-01 11:58:36 +01:00
|
|
|
# -*- Mode: Python -*-
|
|
|
|
# vim: filetype=python
|
|
|
|
#
|
|
|
|
# This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
# See the COPYING file in the top-level directory.
|
|
|
|
|
2023-04-25 08:42:23 +02:00
|
|
|
##
|
|
|
|
# = Cryptography devices
|
|
|
|
##
|
|
|
|
|
2023-03-01 11:58:38 +01:00
|
|
|
##
|
|
|
|
# @QCryptodevBackendAlgType:
|
|
|
|
#
|
|
|
|
# The supported algorithm types of a crypto device.
|
|
|
|
#
|
|
|
|
# @sym: symmetric encryption
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2023-03-01 11:58:38 +01:00
|
|
|
# @asym: asymmetric Encryption
|
|
|
|
#
|
|
|
|
# Since: 8.0
|
|
|
|
##
|
|
|
|
{ 'enum': 'QCryptodevBackendAlgType',
|
|
|
|
'prefix': 'QCRYPTODEV_BACKEND_ALG',
|
|
|
|
'data': ['sym', 'asym']}
|
|
|
|
|
2023-03-01 11:58:39 +01:00
|
|
|
##
|
|
|
|
# @QCryptodevBackendServiceType:
|
|
|
|
#
|
|
|
|
# The supported service types of a crypto device.
|
|
|
|
#
|
|
|
|
# Since: 8.0
|
|
|
|
##
|
|
|
|
{ 'enum': 'QCryptodevBackendServiceType',
|
|
|
|
'prefix': 'QCRYPTODEV_BACKEND_SERVICE',
|
|
|
|
'data': ['cipher', 'hash', 'mac', 'aead', 'akcipher']}
|
|
|
|
|
2023-03-01 11:58:36 +01:00
|
|
|
##
|
|
|
|
# @QCryptodevBackendType:
|
|
|
|
#
|
|
|
|
# The crypto device backend type
|
|
|
|
#
|
|
|
|
# @builtin: the QEMU builtin support
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2023-03-01 11:58:36 +01:00
|
|
|
# @vhost-user: vhost-user
|
2023-04-28 12:54:29 +02:00
|
|
|
#
|
2023-03-01 11:58:36 +01:00
|
|
|
# @lkcf: Linux kernel cryptographic framework
|
|
|
|
#
|
|
|
|
# Since: 8.0
|
|
|
|
##
|
|
|
|
{ 'enum': 'QCryptodevBackendType',
|
|
|
|
'prefix': 'QCRYPTODEV_BACKEND_TYPE',
|
|
|
|
'data': ['builtin', 'vhost-user', 'lkcf']}
|
cryptodev: Introduce 'query-cryptodev' QMP command
Now we have a QMP command to query crypto devices:
virsh qemu-monitor-command vm '{"execute": "query-cryptodev"}' | jq
{
"return": [
{
"service": [
"akcipher",
"mac",
"hash",
"cipher"
],
"id": "cryptodev1",
"client": [
{
"queue": 0,
"type": "builtin"
}
]
},
{
"service": [
"akcipher"
],
"id": "cryptodev0",
"client": [
{
"queue": 0,
"type": "lkcf"
}
]
}
],
"id": "libvirt-417"
}
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20230301105847.253084-6-pizhenwei@bytedance.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-03-01 11:58:40 +01:00
|
|
|
|
|
|
|
##
|
|
|
|
# @QCryptodevBackendClient:
|
|
|
|
#
|
|
|
|
# Information about a queue of crypto device.
|
|
|
|
#
|
|
|
|
# @queue: the queue index of the crypto device
|
|
|
|
#
|
|
|
|
# @type: the type of the crypto device
|
|
|
|
#
|
|
|
|
# Since: 8.0
|
|
|
|
##
|
|
|
|
{ 'struct': 'QCryptodevBackendClient',
|
|
|
|
'data': { 'queue': 'uint32',
|
|
|
|
'type': 'QCryptodevBackendType' } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @QCryptodevInfo:
|
|
|
|
#
|
|
|
|
# Information about a crypto device.
|
|
|
|
#
|
|
|
|
# @id: the id of the crypto device
|
|
|
|
#
|
|
|
|
# @service: supported service types of a crypto device
|
|
|
|
#
|
2023-04-20 21:55:41 +02:00
|
|
|
# @client: the additional information of the crypto device
|
cryptodev: Introduce 'query-cryptodev' QMP command
Now we have a QMP command to query crypto devices:
virsh qemu-monitor-command vm '{"execute": "query-cryptodev"}' | jq
{
"return": [
{
"service": [
"akcipher",
"mac",
"hash",
"cipher"
],
"id": "cryptodev1",
"client": [
{
"queue": 0,
"type": "builtin"
}
]
},
{
"service": [
"akcipher"
],
"id": "cryptodev0",
"client": [
{
"queue": 0,
"type": "lkcf"
}
]
}
],
"id": "libvirt-417"
}
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20230301105847.253084-6-pizhenwei@bytedance.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-03-01 11:58:40 +01:00
|
|
|
#
|
|
|
|
# Since: 8.0
|
|
|
|
##
|
|
|
|
{ 'struct': 'QCryptodevInfo',
|
|
|
|
'data': { 'id': 'str',
|
|
|
|
'service': ['QCryptodevBackendServiceType'],
|
|
|
|
'client': ['QCryptodevBackendClient'] } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @query-cryptodev:
|
|
|
|
#
|
|
|
|
# Returns information about current crypto devices.
|
|
|
|
#
|
|
|
|
# Returns: a list of @QCryptodevInfo
|
|
|
|
#
|
|
|
|
# Since: 8.0
|
|
|
|
##
|
|
|
|
{ 'command': 'query-cryptodev', 'returns': ['QCryptodevInfo']}
|