mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
cryptodev: wrap the ready flag
The ready flag should be set by the children of cryptodev backend interface. Warp the setter/getter functions for it. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
46fd170545
commit
6138dbda5a
4 changed files with 36 additions and 6 deletions
|
@ -732,7 +732,7 @@ static void virtio_crypto_reset(VirtIODevice *vdev)
|
|||
VirtIOCrypto *vcrypto = VIRTIO_CRYPTO(vdev);
|
||||
/* multiqueue is disabled by default */
|
||||
vcrypto->curr_queues = 1;
|
||||
if (!vcrypto->cryptodev->ready) {
|
||||
if (!cryptodev_backend_is_ready(vcrypto->cryptodev)) {
|
||||
vcrypto->status &= ~VIRTIO_CRYPTO_S_HW_READY;
|
||||
} else {
|
||||
vcrypto->status |= VIRTIO_CRYPTO_S_HW_READY;
|
||||
|
@ -792,7 +792,7 @@ static void virtio_crypto_device_realize(DeviceState *dev, Error **errp)
|
|||
}
|
||||
|
||||
vcrypto->ctrl_vq = virtio_add_queue(vdev, 64, virtio_crypto_handle_ctrl);
|
||||
if (!vcrypto->cryptodev->ready) {
|
||||
if (!cryptodev_backend_is_ready(vcrypto->cryptodev)) {
|
||||
vcrypto->status &= ~VIRTIO_CRYPTO_S_HW_READY;
|
||||
} else {
|
||||
vcrypto->status |= VIRTIO_CRYPTO_S_HW_READY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue