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

[Xen-devel] [PATCH 4/5] kexec/xen: switch to use xc_kexec_get_range for get_xen_vmcoreinfo.



From: Don Slutz <Don@xxxxxxxxxxxxxxx>

Signed-off-by: Don Slutz <Don@xxxxxxxxxxxxxxx>
Signed-off-by: David Vrabel <david.vrabel@xxxxxxxxxx>
---
 kexec/crashdump-xen.c |   20 ++++++++++++++++++++
 kexec/crashdump.c     |    2 ++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/kexec/crashdump-xen.c b/kexec/crashdump-xen.c
index 13335a5..dfb86c8 100644
--- a/kexec/crashdump-xen.c
+++ b/kexec/crashdump-xen.c
@@ -164,6 +164,26 @@ unsigned long xen_architecture(struct crash_elf_info 
*elf_info)
 }
 
 #ifdef HAVE_LIBXENCTRL
+int get_xen_vmcoreinfo(uint64_t *addr, uint64_t *len)
+{
+       xc_interface *xc;
+       int ret = 0;
+
+       xc = xc_interface_open(NULL, NULL, 0);
+       if (!xc) {
+               fprintf(stderr, "failed to open xen control interface.\n");
+               return -1;
+       }
+
+       ret = xc_kexec_get_range(xc, KEXEC_RANGE_MA_VMCOREINFO, 0, len, addr);
+
+       xc_interface_close(xc);
+
+       if (ret < 0)
+               return -1;
+       return 0;
+}
+
 int xen_get_nr_phys_cpus(void)
 {
        xc_interface *xc;
diff --git a/kexec/crashdump.c b/kexec/crashdump.c
index cdd3ef6..b8441b7 100644
--- a/kexec/crashdump.c
+++ b/kexec/crashdump.c
@@ -141,7 +141,9 @@ int get_kernel_vmcoreinfo(uint64_t *addr, uint64_t *len)
        return get_vmcoreinfo("/sys/kernel/vmcoreinfo", addr, len);
 }
 
+#ifndef HAVE_LIBXENCTRL
 int get_xen_vmcoreinfo(uint64_t *addr, uint64_t *len)
 {
        return get_vmcoreinfo("/sys/hypervisor/vmcoreinfo", addr, len);
 }
+#endif
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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