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

[Xen-changelog] Default unit for all Xen memory parameters is kilobytes.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID eb7486b93df5cd487fda79dc47a4c9633f45bc89
# Parent  071412a64fb9d863f5c0998bd8fda17faeee030b
Default unit for all Xen memory parameters is kilobytes.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 071412a64fb9 -r eb7486b93df5 docs/src/user.tex
--- a/docs/src/user.tex Fri Aug 19 09:05:04 2005
+++ b/docs/src/user.tex Fri Aug 19 09:16:56 2005
@@ -1763,7 +1763,7 @@
  physical address in the memory map will be ignored. This parameter
  may be specified with a B, K, M or G suffix, representing bytes,
  kilobytes, megabytes and gigabytes respectively. The
- default unit, if no suffix is specified, is bytes.
+ default unit, if no suffix is specified, is kilobytes.
 
 \item [dom0\_mem=xxx ] 
  Set the amount of memory to be allocated to domain0. In Xen 3.x the parameter
diff -r 071412a64fb9 -r eb7486b93df5 xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c       Fri Aug 19 09:05:04 2005
+++ b/xen/arch/x86/domain_build.c       Fri Aug 19 09:16:56 2005
@@ -22,16 +22,11 @@
 #include <asm/i387.h>
 #include <asm/shadow.h>
 
-/* opt_dom0_mem: memory allocated to domain 0. */
-static unsigned int opt_dom0_mem;
+static unsigned long dom0_nrpages;
 static void parse_dom0_mem(char *s)
 {
     unsigned long long bytes = parse_size_and_unit(s);
-    /* If no unit is specified we default to kB units, not bytes. */
-    if ( isdigit(s[strlen(s)-1]) )
-        opt_dom0_mem = (unsigned int)bytes;
-    else
-        opt_dom0_mem = (unsigned int)(bytes >> 10);
+    dom0_nrpages = bytes >> PAGE_SHIFT;
 }
 custom_param("dom0_mem", parse_dom0_mem);
 
@@ -139,7 +134,7 @@
 
     /* By default DOM0 is allocated all available memory. */
     d->max_pages = ~0U;
-    if ( (nr_pages = opt_dom0_mem >> (PAGE_SHIFT - 10)) == 0 )
+    if ( (nr_pages = dom0_nrpages) == 0 )
         nr_pages = avail_domheap_pages() +
             ((initrd_len + PAGE_SIZE - 1) >> PAGE_SHIFT) +
             ((image_len  + PAGE_SIZE - 1) >> PAGE_SHIFT);
diff -r 071412a64fb9 -r eb7486b93df5 xen/common/lib.c
--- a/xen/common/lib.c  Fri Aug 19 09:05:04 2005
+++ b/xen/common/lib.c  Fri Aug 19 09:16:56 2005
@@ -450,8 +450,10 @@
                ret <<= 10;
        case 'M': case 'm':
                ret <<= 10;
-       case 'K': case 'k':
+       case 'K': case 'k': default:
                ret <<= 10;
+       case 'B': case 'b':
+               break;
        }
 
        return ret;

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


 


Rackspace

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