[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 2/8] tpm_backend: Implement check whether tpm backend is suspe
From: |
Stefan Berger |
Subject: |
[PATCH v4 2/8] tpm_backend: Implement check whether tpm backend is suspended |
Date: |
Thu, 12 Dec 2019 13:07:38 -0500 |
Some frontends need to know whether the backend is suspended.
Implement tpm_backend_is_suspended().
Signed-off-by: Stefan Berger <address@hidden>
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
- [PATCH v4 0/8] Add vTPM emulator supportfor ppc64 platform, Stefan Berger, 2019/12/12
- [PATCH v4 2/8] tpm_backend: Implement check whether tpm backend is suspended,
Stefan Berger <=
- [PATCH v4 6/8] tpm_spapr: Support suspend and resume, Stefan Berger, 2019/12/12
- [PATCH v4 7/8] hw/ppc/Kconfig: Enable TPM_SPAPR as part of PSERIES config, Stefan Berger, 2019/12/12
- [PATCH v4 8/8] docs: tpm: Add example command line for ppc64 and tpm-spapr, Stefan Berger, 2019/12/12
- [PATCH v4 1/8] tpm_spapr: Support TPM for ppc64 using CRQ based interface, Stefan Berger, 2019/12/12
- [PATCH v4 5/8] tpm: Return bool from tpm_backend_finish_sync, Stefan Berger, 2019/12/12
- [PATCH v4 3/8] tpm_emulator: Implement callback for whether we are suspended, Stefan Berger, 2019/12/12
- [PATCH v4 4/8] tpm_passthrough: Implement callback for whether we are suspended, Stefan Berger, 2019/12/12