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

[Xen-changelog] Recently some people complain that they cannot set the maxmem for



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 50da9b240a1f331374758f92e50cee93fe2d4845
# Parent  79bb7dfb8fc1b56b3e121558f8541b426256f26f

Recently some people complain that they cannot set the maxmem for
domU. The problem is that some code wrongly treat dom.max_memkb as in
byte unit, instead of KB unit. This patch fixs the problem.

Signed-off-by: Nguyen Anh Quynh <aquynh@xxxxxxxxx>

diff -r 79bb7dfb8fc1 -r 50da9b240a1f tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Fri Jul 15 08:22:18 2005
+++ b/tools/libxc/xc_domain.c   Fri Jul 15 08:30:22 2005
@@ -107,7 +107,7 @@
 
         info->ssidref  = op.u.getdomaininfo.ssidref;
         info->nr_pages = op.u.getdomaininfo.tot_pages;
-        info->max_memkb = op.u.getdomaininfo.max_pages<<(PAGE_SHIFT);
+        info->max_memkb = op.u.getdomaininfo.max_pages << (PAGE_SHIFT - 10);
         info->shared_info_frame = op.u.getdomaininfo.shared_info_frame;
         info->cpu_time = op.u.getdomaininfo.cpu_time;
         info->vcpus = op.u.getdomaininfo.n_vcpu;
diff -r 79bb7dfb8fc1 -r 50da9b240a1f tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Fri Jul 15 08:22:18 2005
+++ b/tools/libxc/xc_linux_save.c       Fri Jul 15 08:30:22 2005
@@ -464,14 +464,14 @@
         goto out;
     }
     
-    nr_pfns = info.max_memkb >> PAGE_SHIFT; 
+    nr_pfns = info.max_memkb >> (PAGE_SHIFT - 10);
 
     /* cheesy sanity check */
-    if ( nr_pfns > 1024*1024 ){
+    if ( nr_pfns > 1024*1024 )
+    {
         ERR("Invalid state record -- pfn count out of range: %lu", nr_pfns);
         goto out;
     }
-
 
     /* Map the shared info frame */
     live_shinfo = xc_map_foreign_range(xc_handle, dom,

_______________________________________________
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®.