diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-01-23 09:42:12 +0000 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-01-23 09:42:12 +0000 |
commit | 079ff2d32c3db5a45cdbc8fb05be279544bdc111 (patch) | |
tree | 8670aba405b6fd42651dcf6f17f42164945f2e62 /xen/arch/x86/domain_build.c | |
parent | 7b8c36701d267971f189b435362bce8ff2266e79 (diff) | |
download | xen-079ff2d32c3db5a45cdbc8fb05be279544bdc111.tar.gz xen-079ff2d32c3db5a45cdbc8fb05be279544bdc111.tar.bz2 xen-079ff2d32c3db5a45cdbc8fb05be279544bdc111.zip |
libelf-loader: introduce elf_load_image
Implement a new function, called elf_load_image, to perform the
actually copy of the elf image and clearing the padding. The function
is implemented as memcpy and memset when the library is built as part
of the tools, but it is implemented as raw_copy_to_guest and
raw_clear_guest when built as part of Xen, so that it can be safely
called with an HVM style dom0.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/domain_build.c')
-rw-r--r-- | xen/arch/x86/domain_build.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 1b3818fc7f..b3c5d4cc72 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -903,7 +903,12 @@ int __init construct_dom0( /* Copy the OS image and free temporary buffer. */ elf.dest = (void*)vkern_start; - elf_load_binary(&elf); + rc = elf_load_binary(&elf); + if ( rc < 0 ) + { + printk("Failed to load the kernel binary\n"); + return rc; + } bootstrap_map(NULL); if ( UNSET_ADDR != parms.virt_hypercall ) |