mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
cryptodev: introduce a new is_used property
This property is used to Tag the cryptodev backend is used by virtio-crypto or not. Making cryptodev can't be hot unplugged when it's in use. Cleanup resources when cryptodev is finalized. 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
c159a4d1d0
commit
46fd170545
3 changed files with 44 additions and 0 deletions
|
@ -202,6 +202,8 @@ struct CryptoDevBackend {
|
|||
Object parent_obj;
|
||||
|
||||
bool ready;
|
||||
/* Tag the cryptodev backend is used by virtio-crypto or not */
|
||||
bool is_used;
|
||||
CryptoDevBackendConf conf;
|
||||
};
|
||||
|
||||
|
@ -295,4 +297,25 @@ int cryptodev_backend_crypto_operation(
|
|||
void *opaque,
|
||||
uint32_t queue_index, Error **errp);
|
||||
|
||||
/**
|
||||
* cryptodev_backend_set_used:
|
||||
* @backend: the cryptodev backend object
|
||||
* @used: ture or false
|
||||
*
|
||||
* Set the cryptodev backend is used by virtio-crypto or not
|
||||
*/
|
||||
void cryptodev_backend_set_used(CryptoDevBackend *backend, bool used);
|
||||
|
||||
/**
|
||||
* cryptodev_backend_is_used:
|
||||
* @backend: the cryptodev backend object
|
||||
*
|
||||
* Return the status that the cryptodev backend is used
|
||||
* by virtio-crypto or not
|
||||
*
|
||||
* Returns: true on used, or false on not used
|
||||
*/
|
||||
bool cryptodev_backend_is_used(CryptoDevBackend *backend);
|
||||
|
||||
|
||||
#endif /* CRYPTODEV_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue