[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] vtpmmgr: Print error code to aid debugging



commit 15a59d6ef3acdd816578eecca7a9247fd38bdf99
Author:     Jason Andryuk <jandryuk@xxxxxxxxx>
AuthorDate: Thu May 6 09:59:12 2021 -0400
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri May 7 19:50:50 2021 +0100

    vtpmmgr: Print error code to aid debugging
    
    tpm_get_error_name returns "Unknown Error Code" when an error string
    is not defined.  In that case, we should print the Error Code so it can
    be looked up offline.  tpm_get_error_name returns a const string, so
    just have the two callers always print the error code so it is always
    available.
    
    Signed-off-by: Jason Andryuk <jandryuk@xxxxxxxxx>
    Reviewed-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
    Reviewed-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
 stubdom/vtpmmgr/tpm.c  | 2 +-
 stubdom/vtpmmgr/tpm2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/stubdom/vtpmmgr/tpm.c b/stubdom/vtpmmgr/tpm.c
index 779cddd64e..83b2bc16b2 100644
--- a/stubdom/vtpmmgr/tpm.c
+++ b/stubdom/vtpmmgr/tpm.c
@@ -109,7 +109,7 @@
                        UINT32 rsp_status; \
                        UNPACK_OUT(TPM_RSP_HEADER, &rsp_tag, &rsp_len, 
&rsp_status); \
                        if (rsp_status != TPM_SUCCESS) { \
-                               vtpmlogerror(VTPM_LOG_TPM, "Failed with return 
code %s\n", tpm_get_error_name(rsp_status)); \
+                               vtpmlogerror(VTPM_LOG_TPM, "Failed with return 
code %s (%x)\n", tpm_get_error_name(rsp_status), rsp_status); \
                                status = rsp_status; \
                                goto abort_egress; \
                        } \
diff --git a/stubdom/vtpmmgr/tpm2.c b/stubdom/vtpmmgr/tpm2.c
index c9f1016ab5..655e6d164c 100644
--- a/stubdom/vtpmmgr/tpm2.c
+++ b/stubdom/vtpmmgr/tpm2.c
@@ -126,7 +126,7 @@
     ptr = unpack_TPM_RSP_HEADER(ptr, \
           &(tag), &(paramSize), &(status));\
     if ((status) != TPM_SUCCESS){ \
-        vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s\n", 
tpm_get_error_name(status));\
+        vtpmlogerror(VTPM_LOG_TPM, "Failed with return code %s (%x)\n", 
tpm_get_error_name(status), (status));\
         goto abort_egress;\
     }\
 } while(0)
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.