Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 156504 Details for
Bug 243118
kexec-tools package needs update to work with xen
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch to enable xen crashdumps
kexec-xen.patch (text/plain), 3.04 KB, created by
Neil Horman
on 2007-06-07 20:26:55 UTC
(
hide
)
Description:
patch to enable xen crashdumps
Filename:
MIME Type:
Creator:
Neil Horman
Created:
2007-06-07 20:26:55 UTC
Size:
3.04 KB
patch
obsolete
>--- kexec-tools-1.101/kexec/crashdump-xen.c.xen 2007-06-07 15:39:56.000000000 -0400 >+++ kexec-tools-1.101/kexec/crashdump-xen.c 2007-06-07 15:49:21.000000000 -0400 >@@ -0,0 +1,126 @@ >+#define _GNU_SOURCE >+#include <stdio.h> >+#include <stdarg.h> >+#include <string.h> >+#include <stdlib.h> >+#include <elf.h> >+#include <errno.h> >+#include <limits.h> >+#include <sys/types.h> >+#include <sys/stat.h> >+#include <unistd.h> >+#include <fcntl.h> >+#include "kexec.h" >+#include "crashdump.h" >+ >+#ifdef HAVE_XENCTRL_H >+#include <xenctrl.h> >+#endif >+ >+struct crash_note_info { >+ unsigned long base; >+ unsigned long length; >+}; >+ >+int xen_phys_cpus = 0; >+struct crash_note_info *xen_phys_notes; >+ >+int xen_present(void) >+{ >+ struct stat buf; >+ >+ return stat("/proc/xen", &buf) == 0; >+} >+ >+unsigned long xen_architecture(struct crash_elf_info *elf_info) >+{ >+ unsigned long machine = elf_info->machine; >+#ifdef HAVE_XENCTRL_H >+ int xc, rc; >+ xen_capabilities_info_t capabilities; >+ >+ if (!xen_present()) >+ goto out; >+ >+ memset(capabilities, '0', XEN_CAPABILITIES_INFO_LEN); >+ >+ xc = xc_interface_open(); >+ if ( xc == -1 ) { >+ fprintf(stderr, "failed to open xen control interface.\n"); >+ goto out; >+ } >+ >+ rc = xc_version(xc, XENVER_capabilities, &capabilities[0]); >+ if ( rc == -1 ) { >+ fprintf(stderr, "failed to make Xen version hypercall.\n"); >+ goto out_close; >+ } >+ >+ if (strstr(capabilities, "xen-3.0-x86_64")) >+ machine = EM_X86_64; >+ else if (strstr(capabilities, "xen-3.0-x86_32")) >+ machine = EM_386; >+ >+ out_close: >+ xc_interface_close(xc); >+ >+ out: >+#endif >+ return machine; >+} >+ >+static int xen_crash_note_callback(void *data, int nr, >+ char *str, >+ unsigned long base, >+ unsigned long length) >+{ >+ struct crash_note_info *note = xen_phys_notes + nr; >+ >+ note->base = base; >+ note->length = length; >+ >+ return 0; >+} >+ >+/* >+ * NASTY XEN HACK TO GET THINGS BUILDING >+ */ >+#define kexec_iomem_for_each_line(x,y,z) 0 >+ >+int xen_get_nr_phys_cpus(void) >+{ >+ char *match = "Crash note\n"; >+ int cpus, n; >+ >+ if (xen_phys_cpus) >+ return xen_phys_cpus; >+ >+ if ((cpus = kexec_iomem_for_each_line(match, NULL, NULL))) { >+ n = sizeof(struct crash_note_info) * cpus; >+ xen_phys_notes = malloc(n); >+ if (!xen_phys_notes) { >+ fprintf(stderr, "failed to allocate xen_phys_notes.\n"); >+ return -1; >+ } >+ memset(xen_phys_notes, 0, n); >+ kexec_iomem_for_each_line(match, xen_crash_note_callback, NULL); >+ xen_phys_cpus = cpus; >+ } >+ >+ return cpus; >+} >+ >+int xen_get_note(int cpu, uint64_t *addr, uint64_t *len) >+{ >+ struct crash_note_info *note; >+ >+ if (xen_phys_cpus <= 0) >+ return -1; >+ >+ note = xen_phys_notes + cpu; >+ >+ *addr = note->base; >+ *len = note->length; >+ >+ return 0; >+} >--- kexec-tools-1.101/kexec/Makefile.xen 2007-06-07 15:39:11.000000000 -0400 >+++ kexec-tools-1.101/kexec/Makefile 2007-06-07 15:39:38.000000000 -0400 >@@ -17,6 +17,7 @@ > KEXEC_C_SRCS+= kexec/kexec-elf-rel.c > KEXEC_C_SRCS+= kexec/kexec-elf-boot.c > KEXEC_C_SRCS+= kexec/crashdump.c >+KEXEC_C_SRCS+= kexec/crashdump-xen.c > KEXEC_C_SRCS+= $(PURGATORY_HEX_C) > KEXEC_S_SRCS:= > include kexec/arch/$(ARCH)/Makefile
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 243118
:
156504
|
156565
|
156570
|
157006
|
157015