@@ -163,6 +163,13 @@ size_t tpm_backend_get_buffer_size(TPMBackend *s)
return k->get_buffer_size(s);
}
+bool tpm_backend_is_suspended(TPMBackend *s)
+{
+ TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
+
+ return k->is_suspended(s);
+}
+
TPMInfo *tpm_backend_query_tpm(TPMBackend *s)
{
TPMInfo *info = g_new0(TPMInfo, 1);
@@ -84,6 +84,8 @@ struct TPMBackendClass {
TpmTypeOptions *(*get_tpm_options)(TPMBackend *t);
void (*handle_request)(TPMBackend *s, TPMBackendCmd *cmd, Error **errp);
+
+ bool (*is_suspended)(TPMBackend *t);
};
/**
@@ -213,6 +215,16 @@ void tpm_backend_finish_sync(TPMBackend *s);
*/
TPMInfo *tpm_backend_query_tpm(TPMBackend *s);
+/**
+ * tpm_backend_is_suspended:
+ * @s: the backend to call into
+ *
+ * Whether the backend is suspended
+ *
+ * Returns true in case the backend is suspended
+ */
+bool tpm_backend_is_suspended(TPMBackend *s);
+
TPMBackend *qemu_find_tpm_be(const char *id);
#endif
Some frontends need to know whether the backend is suspended. Implement tpm_backend_is_suspended(). Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>