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>
This commit is contained in:
parent
93330cf542
commit
f59864ba3a
4 changed files with 60 additions and 55 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue