From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-ppc@nongnu.org
Cc: marcandre.lureau@redhat.com,
Stefan Berger <stefanb@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, david@gibson.dropbear.id.au
Subject: [PATCH v5 2/5] tpm: Return bool from tpm_backend_finish_sync
Date: Thu, 12 Dec 2019 15:24:27 -0500 [thread overview]
Message-ID: <20191212202430.1079725-3-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <20191212202430.1079725-1-stefanb@linux.vnet.ibm.com>
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>
diff --git a/backends/tpm.c b/backends/tpm.c
index 375587e743..1f75883d8a 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -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)
diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h
index 9e7451fb52..c35fe85c62 100644
--- a/include/sysemu/tpm_backend.h
+++ b/include/sysemu/tpm_backend.h
@@ -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:
--
2.21.0
next prev parent reply other threads:[~2019-12-12 20:28 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-12 20:24 [PATCH v5 0/5] Add vTPM emulator support for ppc64 platform Stefan Berger
2019-12-12 20:24 ` [PATCH v5 1/5] tpm_spapr: Support TPM for ppc64 using CRQ based interface Stefan Berger
2019-12-12 20:33 ` Eric Blake
2019-12-12 20:34 ` Stefan Berger
2019-12-13 5:34 ` David Gibson
2019-12-13 13:03 ` Stefan Berger
2019-12-17 0:29 ` David Gibson
2019-12-17 19:44 ` Stefan Berger
2019-12-19 1:54 ` David Gibson
2019-12-19 1:59 ` Stefan Berger
2019-12-19 5:13 ` David Gibson
2019-12-19 5:14 ` David Gibson
2019-12-12 20:24 ` Stefan Berger [this message]
2019-12-12 20:24 ` [PATCH v5 3/5] tpm_spapr: Support suspend and resume Stefan Berger
2019-12-13 5:39 ` David Gibson
2019-12-13 12:46 ` Stefan Berger
2019-12-17 0:53 ` David Gibson
2019-12-12 20:24 ` [PATCH v5 4/5] hw/ppc/Kconfig: Enable TPM_SPAPR as part of PSERIES config Stefan Berger
2019-12-12 20:24 ` [PATCH v5 5/5] docs: tpm: Add example command line for ppc64 and tpm-spapr Stefan Berger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191212202430.1079725-3-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).