diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2017-10-16 13:04:43 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2017-10-16 13:04:43 +0100 |
| commit | 78b62d37669230fbc4cb1e780cf33713dfd740ca (patch) | |
| tree | e78050a3935fec74e68cef75823a275e450cb520 /tpm.c | |
| parent | 40a1e8ac2e10155b5df13a2508ac080b00cd7e23 (diff) | |
| parent | 8dc67017220109fd5bc9d2bffa73674595f62e08 (diff) | |
| download | focaccia-qemu-78b62d37669230fbc4cb1e780cf33713dfd740ca.tar.gz focaccia-qemu-78b62d37669230fbc4cb1e780cf33713dfd740ca.zip | |
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2017-10-04-3' into staging
Merge tpm 2017/10/04 v3 # gpg: Signature made Fri 13 Oct 2017 12:37:07 BST # gpg: using RSA key 0x75AD65802A0B4211 # gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: B818 B9CA DF90 89C2 D5CE C66B 75AD 6580 2A0B 4211 * remotes/stefanberger/tags/pull-tpm-2017-10-04-3: specs: Describe the TPM support in QEMU tpm: Move tpm_cleanup() to right place tpm: Added support for TPM emulator tpm-passthrough: move reusable code to utils tpm-backend: Move realloc_buffer() implementation to tpm-tis model tpm-backend: Add new API to read backend TpmInfo tpm-backend: Made few interface methods optional tpm-backend: Initialize and free data members in it's own methods tpm-backend: Move thread handling inside TPMBackend tpm-backend: Remove unneeded member variable from backend class tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tpm.c')
| -rw-r--r-- | tpm.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/tpm.c b/tpm.c index 2d830d072a..3122227156 100644 --- a/tpm.c +++ b/tpm.c @@ -62,7 +62,7 @@ static void tpm_display_backend_drivers(void) continue; } fprintf(stderr, "%12s %s\n", - TpmType_str(i), be_drivers[i]->desc()); + TpmType_str(i), be_drivers[i]->desc); } fprintf(stderr, "\n"); } @@ -157,7 +157,7 @@ void tpm_cleanup(void) QLIST_FOREACH_SAFE(drv, &tpm_backends, list, next) { QLIST_REMOVE(drv, list); - tpm_backend_destroy(drv); + object_unref(OBJECT(drv)); } } @@ -172,7 +172,6 @@ int tpm_init(void) return -1; } - atexit(tpm_cleanup); return 0; } @@ -202,36 +201,6 @@ static const TPMDriverOps *tpm_driver_find_by_type(enum TpmType type) return be_drivers[type]; } -static TPMInfo *qmp_query_tpm_inst(TPMBackend *drv) -{ - TPMInfo *res = g_new0(TPMInfo, 1); - TPMPassthroughOptions *tpo; - - res->id = g_strdup(drv->id); - res->model = drv->fe_model; - res->options = g_new0(TpmTypeOptions, 1); - - switch (drv->ops->type) { - case TPM_TYPE_PASSTHROUGH: - res->options->type = TPM_TYPE_OPTIONS_KIND_PASSTHROUGH; - tpo = g_new0(TPMPassthroughOptions, 1); - res->options->u.passthrough.data = tpo; - if (drv->path) { - tpo->path = g_strdup(drv->path); - tpo->has_path = true; - } - if (drv->cancel_path) { - tpo->cancel_path = g_strdup(drv->cancel_path); - tpo->has_cancel_path = true; - } - break; - case TPM_TYPE__MAX: - break; - } - - return res; -} - /* * Walk the list of active TPM backends and collect information about them * following the schema description in qapi-schema.json. @@ -246,7 +215,7 @@ TPMInfoList *qmp_query_tpm(Error **errp) continue; } info = g_new0(TPMInfoList, 1); - info->value = qmp_query_tpm_inst(drv); + info->value = tpm_backend_query_tpm(drv); if (!cur_item) { head = cur_item = info; |