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 157550 Details for
Bug 245187
makedumpfile has a pretty limited method for determining kernel version
[?]
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 I'm proposing to fix the versioning issue
makedumpfile-kver.patch (text/plain), 2.83 KB, created by
Neil Horman
on 2007-06-21 15:36:18 UTC
(
hide
)
Description:
patch I'm proposing to fix the versioning issue
Filename:
MIME Type:
Creator:
Neil Horman
Created:
2007-06-21 15:36:18 UTC
Size:
2.83 KB
patch
obsolete
>--- kexec-tools-1.101/makedumpfile/makedumpfile.h.orig 2007-02-08 04:21:51.000000000 -0500 >+++ kexec-tools-1.101/makedumpfile/makedumpfile.h 2007-06-21 10:32:02.000000000 -0400 >@@ -272,15 +272,6 @@ do { \ > } while (0) > > /* >- * kernel version >- */ >-#define VERSION_2_6_15 (15) >-#define VERSION_2_6_16 (16) >-#define VERSION_2_6_17 (17) >-#define VERSION_2_6_18 (18) >-#define VERSION_2_6_19 (19) >- >-/* > * field name of config file > */ > #define STR_OSRELEASE "OSRELEASE=" >@@ -464,8 +455,20 @@ struct makedumpfile_data_header { > int64_t buf_size; > }; > >+/* >+ * Note the format of kernel_version is as follows >+ * 8 bits major version >+ * 8 bits minor version >+ * 16 bits release >+ * so version 2.6.18 would be encoded as 0x02060012 >+ * These macros will let us decode that easier >+ */ >+#define KVER_MAJ_SHIFT 24 >+#define KVER_MIN_SHIFT 16 >+#define KERNEL_VERSION(x,y,z) ( ((x) << KVER_MAJ_SHIFT) | ((y) << KVER_MIN_SHIFT) | (z)) >+ > struct DumpInfo { >- int kernel_version; /* version of first kernel */ >+ int32_t kernel_version; /* version of first kernel*/ > > /* > * General info: >--- kexec-tools-1.101/makedumpfile/makedumpfile.c.orig 2007-02-08 04:21:51.000000000 -0500 >+++ kexec-tools-1.101/makedumpfile/makedumpfile.c 2007-06-21 10:36:15.000000000 -0400 >@@ -19,7 +19,7 @@ > * 1. (ia64) DISCONTIGMEM support. > * 2. (i386) fill PT_LOAD headers with appropriate virtual addresses. > */ >- >+#include <stdlib.h> > #include "makedumpfile.h" > > struct symbol_table symbol_table; >@@ -137,22 +137,32 @@ readmem(struct DumpInfo *info, unsigned > return size; > } > >-int >+int32_t > get_kernel_version(char *release) > { >- if (!strncmp(release, "2.6.15", strlen("2.6.15"))) { >- return VERSION_2_6_15; >- } else if (!strncmp(release, "2.6.16", strlen("2.6.16"))) { >- return VERSION_2_6_16; >- } else if (!strncmp(release, "2.6.17", strlen("2.6.17"))) { >- return VERSION_2_6_17; >- } else if (!strncmp(release, "2.6.18", strlen("2.6.18"))) { >- return VERSION_2_6_18; >- } else if (!strncmp(release, "2.6.19", strlen("2.6.19"))) { >- return VERSION_2_6_19; >- } else { >+ int32_t version; >+ long maj, min, rel; >+ char *start, *end; >+ >+ start = release; >+ maj = strtol(start,&end,10); >+ if (maj == LONG_MAX) >+ return FALSE; >+ start = end + 1; >+ min = strtol(start,&end,10); >+ if (min == LONG_MAX) >+ return FALSE; >+ start = end + 1; >+ rel = strtol(start,&end,10); >+ if (rel == LONG_MAX) > return FALSE; >- } >+ >+ >+ version = ((maj) << KVER_MAJ_SHIFT); >+ version |= ((min) << KVER_MIN_SHIFT); >+ version |= rel; >+ >+ return version; > } > > int >@@ -1442,7 +1452,7 @@ get_structure_info(struct DumpInfo *info > OFFSET_INIT(page.flags, "page", "flags"); > OFFSET_INIT(page._count, "page", "_count"); > >- if (info->kernel_version == VERSION_2_6_15) >+ if (info->kernel_version == KERNEL_VERSION(2,6,15)) > OFFSET_INIT(page.mapping, "page", "mapping"); > else > OFFSET_INIT_NONAME(page.mapping, "page",
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 245187
: 157550