From: David Vrabel <david.vrabel@citrix.com>
To: xen-devel@lists.xen.org
Cc: Daniel Kiper <daniel.kiper@oracle.com>,
Simon Horman <horms@verge.net.au>,
kexec@lists.infradead.org, David Vrabel <david.vrabel@citrix.com>,
Don Slutz <Don@CloudSwitch.com>
Subject: [PATCH 4/5] kexec/xen: switch to use xc_kexec_get_range for get_xen_vmcoreinfo.
Date: Thu, 12 Sep 2013 21:00:41 +0100 [thread overview]
Message-ID: <1379016042-22510-5-git-send-email-david.vrabel@citrix.com> (raw)
In-Reply-To: <1379016042-22510-1-git-send-email-david.vrabel@citrix.com>
From: Don Slutz <Don@CloudSwitch.com>
Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
kexec/crashdump-xen.c | 25 +++++++++++++++++++++++++
kexec/crashdump.c | 5 -----
2 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/kexec/crashdump-xen.c b/kexec/crashdump-xen.c
index 4a5cd8a..b08220e 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;
@@ -206,6 +226,11 @@ int xen_get_nr_phys_cpus(void)
return cpu;
}
#else
+int get_xen_vmcoreinfo(uint64_t *addr, uint64_t *len)
+{
+ return -1;
+}
+
int xen_get_nr_phys_cpus(void)
{
return -1;
diff --git a/kexec/crashdump.c b/kexec/crashdump.c
index 8d88fdf..131e624 100644
--- a/kexec/crashdump.c
+++ b/kexec/crashdump.c
@@ -157,8 +157,3 @@ int get_kernel_vmcoreinfo(uint64_t *addr, uint64_t *len)
{
return get_vmcoreinfo("/sys/kernel/vmcoreinfo", addr, len);
}
-
-int get_xen_vmcoreinfo(uint64_t *addr, uint64_t *len)
-{
- return get_vmcoreinfo("/sys/hypervisor/vmcoreinfo", addr, len);
-}
--
1.7.2.5
next prev parent reply other threads:[~2013-09-12 20:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1379016042-22510-1-git-send-email-david.vrabel@citrix.com>
2013-09-12 20:00 ` [PATCH 1/5] purgatory: put variables altered by kexec in .data not .bss David Vrabel
2013-09-12 20:00 ` [PATCH 2/5] kexec/xen: require libxc from Xen 4.4 David Vrabel
2013-09-12 20:00 ` [PATCH 3/5] kexec/xen: use libxc to get location of crash notes David Vrabel
2013-09-12 20:00 ` David Vrabel [this message]
2013-09-12 20:00 ` [PATCH 5/5] kexec/xen: directly load images images into Xen David Vrabel
[not found] ` <1379016042-22510-2-git-send-email-david.vrabel@citrix.com>
2013-09-16 12:43 ` [PATCH 1/5] purgatory: put variables altered by kexec in .data not .bss Daniel Kiper
[not found] ` <20130916124302.GC14630@debian70-amd64.local.net-space.pl>
2013-09-16 12:48 ` David Vrabel
[not found] ` <5236FE07.2010405@citrix.com>
2013-09-17 1:33 ` Daniel Kiper
[not found] ` <20130917013309.GA301@debian70-amd64.local.net-space.pl>
2013-09-17 8:17 ` Tim Deegan
[not found] ` <20130917081704.GA25707@ocelot.phlegethon.org>
2013-09-17 9:59 ` David Vrabel
[not found] ` <52382808.7070902@citrix.com>
2013-09-17 10:02 ` David Vrabel
[not found] ` <1379016042-22510-4-git-send-email-david.vrabel@citrix.com>
2013-09-23 14:05 ` [PATCH 3/5] kexec/xen: use libxc to get location of crash notes Konrad Rzeszutek Wilk
[not found] <1365448014-12119-1-git-send-email-david.vrabel@citrix.com>
2013-04-08 19:06 ` [PATCH 4/5] kexec/xen: switch to use xc_kexec_get_range for get_xen_vmcoreinfo David Vrabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379016042-22510-5-git-send-email-david.vrabel@citrix.com \
--to=david.vrabel@citrix.com \
--cc=Don@CloudSwitch.com \
--cc=daniel.kiper@oracle.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).