Skip to contentSkip to conversation

set maxmem bugfix

PATCH In review aq 2 participants 3 messages Jul 15, 2005

lore
Share & tools
lore

aq

author
#0 lore raw

PATCH 1/1 set maxmem bugfix

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.

$ diffstat maxmem.patch 
 xc_domain.c     |    2 +-
 xc_linux_save.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
tools/libxc/xc_domain.c +1 -1
diff -r 1d026c7023d2 tools/libxc/xc_domain.c
@@ -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;
tools/libxc/xc_linux_save.c +1 -1
diff -r 1d026c7023d2 tools/libxc/xc_linux_save.c
@@ -464,7 +464,7 @@
         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 ){

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 5 lines · aq

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.

The patch fixes a bug, but I doubt it fixes the 'xm balloon' problem. Did you test that before and after applying your patch?

-- Keir

author
#2 lore raw
Quoted 11 lines · Keir Fraser
Quoted 5 lines · aq

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.

The patch fixes a bug, but I doubt it fixes the 'xm balloon' problem. Did you test that before and after applying your patch?

actually no, i havent looked at the balloon problem yet. will do it soon.

regards,
aq