mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
cryptodev: Use CryptoDevBackendOpInfo for operation
Move queue_index, CryptoDevCompletionFunc and opaque into struct CryptoDevBackendOpInfo, then cryptodev_backend_crypto_operation() needs an argument CryptoDevBackendOpInfo *op_info only. And remove VirtIOCryptoReq from cryptodev. It's also possible to hide VirtIOCryptoReq into virtio-crypto.c in the next step. (In theory, VirtIOCryptoReq is a private structure used by virtio-crypto only) Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Message-Id: <20230301105847.253084-9-pizhenwei@bytedance.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
ef52091aeb
commit
2cb0692768
5 changed files with 25 additions and 44 deletions
|
@ -871,6 +871,9 @@ virtio_crypto_handle_request(VirtIOCryptoReq *request)
|
|||
opcode = ldl_le_p(&req.header.opcode);
|
||||
op_info->session_id = ldq_le_p(&req.header.session_id);
|
||||
op_info->op_code = opcode;
|
||||
op_info->queue_index = queue_index;
|
||||
op_info->cb = virtio_crypto_req_complete;
|
||||
op_info->opaque = request;
|
||||
|
||||
switch (opcode) {
|
||||
case VIRTIO_CRYPTO_CIPHER_ENCRYPT:
|
||||
|
@ -898,9 +901,7 @@ check_result:
|
|||
virtio_crypto_req_complete(request, -VIRTIO_CRYPTO_NOTSUPP);
|
||||
} else {
|
||||
ret = cryptodev_backend_crypto_operation(vcrypto->cryptodev,
|
||||
request, queue_index,
|
||||
virtio_crypto_req_complete,
|
||||
request);
|
||||
op_info);
|
||||
if (ret < 0) {
|
||||
virtio_crypto_req_complete(request, ret);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue