diff options
author | Gonglei <arei.gonglei@huawei.com> | 2016-12-22 11:12:39 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2017-01-10 07:02:52 +0200 |
commit | 6138dbda5a4bfa6c724fd04b9225181d3a3c85a7 (patch) | |
tree | a730b7934ba7b92adbddea16d8dcb7969446b144 /backends/cryptodev.c | |
parent | 46fd17054548b15b3b8a5991492f5f0dc37957d4 (diff) |
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>
Diffstat (limited to 'backends/cryptodev.c')
-rw-r--r-- | backends/cryptodev.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/backends/cryptodev.c b/backends/cryptodev.c index 6a66c27d68..832f056266 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -73,8 +73,6 @@ void cryptodev_backend_cleanup( if (bc->cleanup) { bc->cleanup(backend, errp); } - - backend->ready = false; } int64_t cryptodev_backend_sym_create_session( @@ -189,11 +187,10 @@ cryptodev_backend_complete(UserCreatable *uc, Error **errp) goto out; } } - backend->ready = true; + return; out: - backend->ready = false; error_propagate(errp, local_err); } @@ -207,6 +204,16 @@ bool cryptodev_backend_is_used(CryptoDevBackend *backend) return backend->is_used; } +void cryptodev_backend_set_ready(CryptoDevBackend *backend, bool ready) +{ + backend->ready = ready; +} + +bool cryptodev_backend_is_ready(CryptoDevBackend *backend) +{ + return backend->ready; +} + static bool cryptodev_backend_can_be_deleted(UserCreatable *uc, Error **errp) { |