ia64/xen-unstable

changeset 5787:50da9b240a1f

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@gmail.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jul 15 08:30:22 2005 +0000 (2005-07-15)
parents 79bb7dfb8fc1
children ce4b630067bb
files tools/libxc/xc_domain.c tools/libxc/xc_linux_save.c
line diff
     1.1 --- a/tools/libxc/xc_domain.c	Fri Jul 15 08:22:18 2005 +0000
     1.2 +++ b/tools/libxc/xc_domain.c	Fri Jul 15 08:30:22 2005 +0000
     1.3 @@ -107,7 +107,7 @@ int xc_domain_getinfo(int xc_handle,
     1.4  
     1.5          info->ssidref  = op.u.getdomaininfo.ssidref;
     1.6          info->nr_pages = op.u.getdomaininfo.tot_pages;
     1.7 -        info->max_memkb = op.u.getdomaininfo.max_pages<<(PAGE_SHIFT);
     1.8 +        info->max_memkb = op.u.getdomaininfo.max_pages << (PAGE_SHIFT - 10);
     1.9          info->shared_info_frame = op.u.getdomaininfo.shared_info_frame;
    1.10          info->cpu_time = op.u.getdomaininfo.cpu_time;
    1.11          info->vcpus = op.u.getdomaininfo.n_vcpu;
     2.1 --- a/tools/libxc/xc_linux_save.c	Fri Jul 15 08:22:18 2005 +0000
     2.2 +++ b/tools/libxc/xc_linux_save.c	Fri Jul 15 08:30:22 2005 +0000
     2.3 @@ -464,15 +464,15 @@ int xc_linux_save(int xc_handle, int io_
     2.4          goto out;
     2.5      }
     2.6      
     2.7 -    nr_pfns = info.max_memkb >> PAGE_SHIFT; 
     2.8 +    nr_pfns = info.max_memkb >> (PAGE_SHIFT - 10);
     2.9  
    2.10      /* cheesy sanity check */
    2.11 -    if ( nr_pfns > 1024*1024 ){
    2.12 +    if ( nr_pfns > 1024*1024 )
    2.13 +    {
    2.14          ERR("Invalid state record -- pfn count out of range: %lu", nr_pfns);
    2.15          goto out;
    2.16      }
    2.17  
    2.18 -
    2.19      /* Map the shared info frame */
    2.20      live_shinfo = xc_map_foreign_range(xc_handle, dom,
    2.21                                          PAGE_SIZE, PROT_READ,