@@ -49,11 +49,15 @@ static int tpm_backend_worker_thread(gpointer data)
return 0;
}
-void tpm_backend_finish_sync(TPMBackend *s)
+bool tpm_backend_finish_sync(TPMBackend *s)
{
+ bool ret = s->cmd != NULL;
+
while (s->cmd) {
aio_poll(qemu_get_aio_context(), true);
}
+
+ return ret;
}
enum TpmType tpm_backend_get_type(TPMBackend *s)
@@ -200,8 +200,10 @@ size_t tpm_backend_get_buffer_size(TPMBackend *s);
*
* Finish the pending command synchronously (this will call aio_poll()
* on qemu main AIOContext until it ends)
+ *
+ * Returns true in case there was a pending command, false otherwise.
*/
-void tpm_backend_finish_sync(TPMBackend *s);
+bool tpm_backend_finish_sync(TPMBackend *s);
/**
* tpm_backend_query_tpm:
Return true in case we had to wait for an outstanding response to come back, false otherwise. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> --- backends/tpm.c | 6 +++++- include/sysemu/tpm_backend.h | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-)