aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu/cryptodev.h
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2016-12-22 11:12:38 +0800
committerMichael S. Tsirkin <mst@redhat.com>2017-01-10 07:02:52 +0200
commit46fd17054548b15b3b8a5991492f5f0dc37957d4 (patch)
tree7590dc9d3f7208e1976d6461f3373ef60c9709eb /include/sysemu/cryptodev.h
parentc159a4d1d0434fcf670f8684273bce0eca117a27 (diff)
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>
Diffstat (limited to 'include/sysemu/cryptodev.h')
-rw-r--r--include/sysemu/cryptodev.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/sysemu/cryptodev.h b/include/sysemu/cryptodev.h
index 84526c0d35..461389df85 100644
--- a/include/sysemu/cryptodev.h
+++ b/include/sysemu/cryptodev.h
@@ -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 */