diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-11-06 19:39:00 +0100 |
---|---|---|
committer | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2017-12-14 23:39:13 -0500 |
commit | 8a89c9ac15981c2d15ce4ee6d6ad67da58824a04 (patch) | |
tree | 0934508cd312e375675a7977026be1d77dc346d3 /include/sysemu | |
parent | 67af320cd653a107c0bbdf0d2e6c51b24403c64d (diff) | |
download | qemu-8a89c9ac15981c2d15ce4ee6d6ad67da58824a04.zip qemu-8a89c9ac15981c2d15ce4ee6d6ad67da58824a04.tar.gz qemu-8a89c9ac15981c2d15ce4ee6d6ad67da58824a04.tar.bz2 |
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>
Diffstat (limited to 'include/sysemu')
-rw-r--r-- | include/sysemu/tpm.h | 2 | ||||
-rw-r--r-- | include/sysemu/tpm_backend.h | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/sysemu/tpm.h b/include/sysemu/tpm.h index 452cdb9..fb1719e 100644 --- a/include/sysemu/tpm.h +++ b/include/sysemu/tpm.h @@ -12,8 +12,8 @@ #ifndef QEMU_TPM_H #define QEMU_TPM_H -#include "qemu/option.h" #include "qom/object.h" +#include "qapi-types.h" typedef struct TPMState TPMState; diff --git a/include/sysemu/tpm_backend.h b/include/sysemu/tpm_backend.h index 03ea5a3..b5f21ed 100644 --- a/include/sysemu/tpm_backend.h +++ b/include/sysemu/tpm_backend.h @@ -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: |