aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-11-06 19:39:07 +0100
committerStefan Berger <stefanb@linux.vnet.ibm.com>2017-12-14 23:39:14 -0500
commitebca2df783a5a742bb93784524336d8cbb9e662b (patch)
tree1d24852006ffcfecbb618118e0a3be96477a1dc8 /backends
parent69c07db04625cb243db6e8a0ac0a8e3973dd961a (diff)
tpm-be: update optional function pointers
QEMU code doesn't generally have assert() for mandatory callbacks/function pointers, probably because the crash is pretty obvious. Document the methods instead of going into the code. Make get_tpm_options() mandatory to implement (since all backend implementation have it). 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 'backends')
-rw-r--r--backends/tpm.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/backends/tpm.c b/backends/tpm.c
index 7e636fbc7a..7777467c44 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -33,7 +33,6 @@ static void tpm_backend_worker_thread(gpointer data, gpointer user_data)
TPMBackend *s = TPM_BACKEND(user_data);
TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
- assert(k->handle_request != NULL);
k->handle_request(s, (TPMBackendCmd *)data);
qemu_bh_schedule(s->bh);
@@ -114,8 +113,6 @@ void tpm_backend_cancel_cmd(TPMBackend *s)
{
TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
- assert(k->cancel_cmd);
-
k->cancel_cmd(s);
}
@@ -139,8 +136,6 @@ TPMVersion tpm_backend_get_tpm_version(TPMBackend *s)
{
TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s);
- assert(k->get_tpm_version);
-
return k->get_tpm_version(s);
}
@@ -152,9 +147,7 @@ TPMInfo *tpm_backend_query_tpm(TPMBackend *s)
info->id = g_strdup(s->id);
info->model = tic->model;
- if (k->get_tpm_options) {
- info->options = k->get_tpm_options(s);
- }
+ info->options = k->get_tpm_options(s);
return info;
}