aboutsummaryrefslogtreecommitdiff
path: root/backends/tpm.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-11-06 19:39:03 +0100
committerStefan Berger <stefanb@linux.vnet.ibm.com>2017-12-14 23:39:14 -0500
commit0bd6c8a9cfa4fd5c25a32ed39f3b8cb786b75b58 (patch)
tree20ea8aff5352e6217a36ae78a3d571f970669a59 /backends/tpm.c
parent689990598a710519eba37e4eb4d8bdebac1aa562 (diff)
tpm-be: report error instead of front-end
Backend can give more accurate error description, and lift out the job from the frontend. 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/tpm.c')
-rw-r--r--backends/tpm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/backends/tpm.c b/backends/tpm.c
index 58f823d54c..7b108bd5d8 100644
--- a/backends/tpm.c
+++ b/backends/tpm.c
@@ -54,9 +54,10 @@ enum TpmType tpm_backend_get_type(TPMBackend *s)
return k->type;
}
-int tpm_backend_init(TPMBackend *s, TPMIf *tpmif)
+int tpm_backend_init(TPMBackend *s, TPMIf *tpmif, Error **errp)
{
if (s->tpmif) {
+ error_setg(errp, "TPM backend '%s' is already initialized", s->id);
return -1;
}