WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEN] kexec: use parse_size_and_unit() wh

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] kexec: use parse_size_and_unit() when parsing crashkernel
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Nov 2006 21:30:22 +0000
Delivery-date: Thu, 30 Nov 2006 13:30:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
# Node ID 2a17ff9b8ffc7e8d52092b57bd48ab42876fab2d
# Parent  b199227904405d628beaa575c638f935552e0d6d
[XEN] kexec: use parse_size_and_unit() when parsing crashkernel
command line parameter.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
---
 xen/common/kexec.c |   33 +++++++++++----------------------
 1 files changed, 11 insertions(+), 22 deletions(-)

diff -r b19922790440 -r 2a17ff9b8ffc xen/common/kexec.c
--- a/xen/common/kexec.c        Thu Nov 30 12:38:51 2006 +0000
+++ b/xen/common/kexec.c        Thu Nov 30 12:39:35 2006 +0000
@@ -138,32 +138,21 @@ __initcall(register_crashdump_trigger);
 
 void machine_kexec_reserved(xen_kexec_reserve_t *reservation)
 {
-    unsigned long val[2];
+    unsigned long start, size;
     char *str = opt_crashkernel;
-    int k = 0;
 
     memset(reservation, 0, sizeof(*reservation));
 
-    while (k < ARRAY_SIZE(val)) {
-        if (*str == '\0') {
-            break;
-        }
-        val[k] = simple_strtoul(str, &str, 0);
-        switch (toupper(*str)) {
-        case 'G': val[k] <<= 10;
-        case 'M': val[k] <<= 10;
-        case 'K': val[k] <<= 10;
-            str++;
-        }
-        if (*str == '@') {
-            str++;
-        }
-        k++;
-    }
-
-    if (k == ARRAY_SIZE(val)) {
-        reservation->size = val[0];
-        reservation->start = val[1];
+    size = parse_size_and_unit(str, &str);
+    if ( *str == '@' )
+        start = parse_size_and_unit(str+1, NULL);
+    else
+        start = 0;
+
+    if ( start && size )
+    {
+        reservation->start = start;
+        reservation->size = size;
     }
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] kexec: use parse_size_and_unit() when parsing crashkernel, Xen patchbot-unstable <=