diff options
author | David Vrabel <david.vrabel@citrix.com> | 2013-11-06 14:55:22 +0000 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2013-11-19 10:20:53 +0900 |
commit | c0b4a3f95dd80256cc6d7084436235e69b4933fb (patch) | |
tree | 225478b34f2a0d893fd99afd854495e45a37ba5c /kexec/crashdump-xen.c | |
parent | ccd6099112f38eab768d1ce481e9fe3000ba7fda (diff) |
kexec/xen: directly load images images into Xen
Xen 4.4 has an improvided kexec hypercall ABI that allows images to be
loaded and executed without any kernel involvement. Use the API
provided by libxc to load images when running in a Xen guest.
Support for loading images via the kexec_load syscall in non-upstream
("classic") Xen kernels is no longer supported.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/crashdump-xen.c')
-rw-r--r-- | kexec/crashdump-xen.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/kexec/crashdump-xen.c b/kexec/crashdump-xen.c index 79b68e0..60594f6 100644 --- a/kexec/crashdump-xen.c +++ b/kexec/crashdump-xen.c @@ -252,3 +252,37 @@ int xen_get_note(int cpu, uint64_t *addr, uint64_t *len) return 0; } + +#ifdef HAVE_LIBXENCTRL +int xen_get_crashkernel_region(uint64_t *start, uint64_t *end) +{ + uint64_t size; + xc_interface *xc; + int rc = -1; + + xc = xc_interface_open(NULL, NULL, 0); + if (!xc) { + fprintf(stderr, "failed to open xen control interface.\n"); + goto out; + } + + rc = xc_kexec_get_range(xc, KEXEC_RANGE_MA_CRASH, 0, &size, start); + if (rc < 0) { + fprintf(stderr, "failed to get crash region from hypervisor.\n"); + goto out_close; + } + + *end = *start + size - 1; + +out_close: + xc_interface_close(xc); + +out: + return rc; +} +#else +int xen_get_crashkernel_region(uint64_t *start, uint64_t *end) +{ + return -1; +} +#endif |