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

[Xen-changelog] [xen master] libelf: improve errors in elf_xen_note_check()



commit e6564c634863680f6541e07ce2f77f17d45ce52e
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Mon Oct 28 11:30:35 2013 +0000
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Mon Oct 28 14:49:31 2013 +0000

    libelf: improve errors in elf_xen_note_check()
    
    I recently debugged an isolated failure to boot, with no information other
    than the logs.
    
    The "Will only load images built for the generic loader or Linux images"
    string was missing a newline, leading to the subsequent error being appended
    to this line, rather than having its own line with correctly identified
    function.
    
    Furthermore, error messages which state "param containing $FOO is not $BAR" 
is
    fairly useless for debugging without identifying which bad $FOO caused the
    failure.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    CC: Keir Fraser <keir@xxxxxxx>
    CC: Jan Beulich <JBeulich@xxxxxxxx>
    CC: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
    Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 xen/common/libelf/libelf-dominfo.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/common/libelf/libelf-dominfo.c 
b/xen/common/libelf/libelf-dominfo.c
index 25dd892..6120dd4 100644
--- a/xen/common/libelf/libelf-dominfo.c
+++ b/xen/common/libelf/libelf-dominfo.c
@@ -374,7 +374,9 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary 
*elf,
           strncmp(parms->guest_os, "linux", 5)) )
     {
         elf_err(elf, "%s: ERROR: Will only load images built for the generic "
-                "loader or Linux images", __FUNCTION__);
+                "loader or Linux images (Not '%.*s' and '%.*s')\n",
+                __FUNCTION__, (int)sizeof(parms->loader), parms->loader,
+                (int)sizeof(parms->guest_os), parms->guest_os);
         return -1;
     }
 
@@ -382,7 +384,8 @@ static elf_errorstatus elf_xen_note_check(struct elf_binary 
*elf,
          strncmp(parms->xen_ver, "xen-3.0", 7) )
     {
         elf_err(elf, "%s: ERROR: Xen will only load images built "
-                "for Xen v3.0\n", __FUNCTION__);
+                "for Xen v3.0 (Not '%.*s')\n", __FUNCTION__,
+                (int)sizeof(parms->xen_ver), parms->xen_ver);
         return -1;
     }
     return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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