aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu
diff options
context:
space:
mode:
authorAmarnath Valluri <amarnath.valluri@intel.com>2017-09-29 14:10:17 +0300
committerStefan Berger <stefanb@linux.vnet.ibm.com>2017-10-13 07:34:33 -0400
commitf59864ba3aedd26aef7c84545cc1e565caccebf7 (patch)
tree983a625007c81afa85697b95fc7b9a33ce73e2a1 /include/sysemu
parent93330cf542b920b6ea5fea8120a08b76bb353113 (diff)
tpm-backend: Add new API to read backend TpmInfo
TPM configuration options are backend implementation details and shall not be part of base TPMBackend object, and these shall not be accessed directly outside of the class, hence added a new interface method, get_tpm_options() to TPMDriverOps., which shall be implemented by the derived classes to return configured tpm options. A new tpm backend api - tpm_backend_query_tpm() which uses _get_tpm_options() to prepare TpmInfo. Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Diffstat (limited to 'include/sysemu')
-rw-r--r--include/sysemu/tpm_backend.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h
index 9ea707253a..e96c1918cc 100644
--- a/include/sysemu/tpm_backend.h
+++ b/include/sysemu/tpm_backend.h
@@ -49,10 +49,9 @@ struct TPMBackend {
TPMRecvDataCB *recv_data_callback;
bool had_startup_error;
+ /* <public> */
char *id;
enum TpmModel fe_model;
- char *path;
- char *cancel_path;
QLIST_ENTRY(TPMBackend) list;
};
@@ -96,6 +95,8 @@ struct TPMDriverOps {
int (*reset_tpm_established_flag)(TPMBackend *t, uint8_t locty);
TPMVersion (*get_tpm_version)(TPMBackend *t);
+
+ TpmTypeOptions *(*get_tpm_options)(TPMBackend *t);
};
@@ -214,6 +215,16 @@ void tpm_backend_open(TPMBackend *s, Error **errp);
*/
TPMVersion tpm_backend_get_tpm_version(TPMBackend *s);
+/**
+ * tpm_backend_query_tpm:
+ * @s: the backend
+ *
+ * Query backend tpm info
+ *
+ * Returns newly allocated TPMInfo
+ */
+TPMInfo *tpm_backend_query_tpm(TPMBackend *s);
+
TPMBackend *qemu_find_tpm(const char *id);
const TPMDriverOps *tpm_get_backend_driver(const char *type);