diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-01-29 19:33:06 +0100 |
---|---|---|
committer | Stefan Berger <stefanb@linux.vnet.ibm.com> | 2018-01-29 14:22:43 -0500 |
commit | 6a8a23549a6ddb4af47b032db76badf131c5c2e6 (patch) | |
tree | 77ff1a758180aa07eb4239d7db6cf704278aa03f /backends/tpm.c | |
parent | c4fb8561bcec5f3ae3ae2d8a688d1e1aeb247a91 (diff) | |
download | qemu-6a8a23549a6ddb4af47b032db76badf131c5c2e6.zip |
tpm: report backend request error
Use an Error** for request to let the caller handle error reporting.
This will also allow to inform the frontend of a backend error.
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.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/backends/tpm.c b/backends/tpm.c index 143807aa37..d617ba7c52 100644 --- a/backends/tpm.c +++ b/backends/tpm.c @@ -27,7 +27,7 @@ static void tpm_backend_request_completed(void *opaque, int ret) TPMBackend *s = TPM_BACKEND(opaque); TPMIfClass *tic = TPM_IF_GET_CLASS(s->tpmif); - tic->request_completed(s->tpmif); + tic->request_completed(s->tpmif, ret); /* no need for atomic, as long the BQL is taken */ s->cmd = NULL; @@ -38,8 +38,13 @@ static int tpm_backend_worker_thread(gpointer data) { TPMBackend *s = TPM_BACKEND(data); TPMBackendClass *k = TPM_BACKEND_GET_CLASS(s); + Error *err = NULL; - k->handle_request(s, s->cmd); + k->handle_request(s, s->cmd, &err); + if (err) { + error_report_err(err); + return -1; + } return 0; } |