mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
tpm-backend: store TPMIf interface, improve backend_init()
Store the TPM interface, the actual object may be different from TPMState. Keep a reference on the interface, and check the backend wasn't already initialized. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
67af320cd6
commit
8a89c9ac15
6 changed files with 18 additions and 11 deletions
|
@ -43,8 +43,8 @@ struct TPMBackend {
|
|||
Object parent;
|
||||
|
||||
/*< protected >*/
|
||||
TPMIf *tpmif;
|
||||
bool opened;
|
||||
TPMState *tpm_state;
|
||||
GThreadPool *thread_pool;
|
||||
bool had_startup_error;
|
||||
|
||||
|
@ -96,14 +96,14 @@ enum TpmType tpm_backend_get_type(TPMBackend *s);
|
|||
/**
|
||||
* tpm_backend_init:
|
||||
* @s: the backend to initialized
|
||||
* @state: TPMState
|
||||
* @tpmif: TPM interface
|
||||
* @datacb: callback for sending data to frontend
|
||||
*
|
||||
* Initialize the backend with the given variables.
|
||||
*
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
int tpm_backend_init(TPMBackend *s, TPMState *state);
|
||||
int tpm_backend_init(TPMBackend *s, TPMIf *tpmif);
|
||||
|
||||
/**
|
||||
* tpm_backend_startup_tpm:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue