qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: qemu-ppc@nongnu.org
Cc: marcandre.lureau@redhat.com,
	Stefan Berger <stefanb@linux.ibm.com>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>,
	qemu-devel@nongnu.org, david@gibson.dropbear.id.au
Subject: [PATCH v4 2/8] tpm_backend: Implement check whether tpm backend is suspended
Date: Thu, 12 Dec 2019 13:07:38 -0500	[thread overview]
Message-ID: <20191212180744.1070446-3-stefanb@linux.vnet.ibm.com> (raw)
In-Reply-To: <20191212180744.1070446-1-stefanb@linux.vnet.ibm.com>

Some frontends need to know whether the backend is suspended.
Implement tpm_backend_is_suspended().

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>

diff --git a/backends/tpm.c b/backends/tpm.c
index 375587e743..424c9fd485 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -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);
diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h
index 9e7451fb52..f5d8051b45 100644
--- a/include/sysemu/tpm_backend.h
+++ b/include/sysemu/tpm_backend.h
@@ -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
-- 
2.21.0



  parent reply	other threads:[~2019-12-12 18:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 18:07 [PATCH v4 0/8] Add vTPM emulator supportfor ppc64 platform Stefan Berger
2019-12-12 18:07 ` [PATCH v4 1/8] tpm_spapr: Support TPM for ppc64 using CRQ based interface Stefan Berger
2019-12-12 18:07 ` Stefan Berger [this message]
2019-12-12 18:07 ` [PATCH v4 3/8] tpm_emulator: Implement callback for whether we are suspended Stefan Berger
2019-12-12 18:33   ` Stefan Berger
2019-12-12 20:10     ` Stefan Berger
2019-12-12 18:07 ` [PATCH v4 4/8] tpm_passthrough: " Stefan Berger
2019-12-12 18:07 ` [PATCH v4 5/8] tpm: Return bool from tpm_backend_finish_sync Stefan Berger
2019-12-12 18:07 ` [PATCH v4 6/8] tpm_spapr: Support suspend and resume Stefan Berger
2019-12-12 18:07 ` [PATCH v4 7/8] hw/ppc/Kconfig: Enable TPM_SPAPR as part of PSERIES config Stefan Berger
2019-12-12 18:07 ` [PATCH v4 8/8] 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=20191212180744.1070446-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 \
    --cc=stefanb@linux.ibm.com \
    /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).