ia64/xen-unstable

changeset 17399:61a3e041ea12

ioemu: drop duplicate memory reservation

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Sat Apr 05 22:21:42 2008 +0100 (2008-04-05)
parents 0551891920b2
children e8f058b99171
files tools/ioemu/vl.c
line diff
     1.1 --- a/tools/ioemu/vl.c	Sat Apr 05 22:21:01 2008 +0100
     1.2 +++ b/tools/ioemu/vl.c	Sat Apr 05 22:21:42 2008 +0100
     1.3 @@ -7018,26 +7018,12 @@ int unset_mm_mapping(int xc_handle, uint
     1.4                       xen_pfn_t *extent_start)
     1.5  {
     1.6      int err = 0;
     1.7 -    xc_dominfo_t info;
     1.8 -
     1.9 -    xc_domain_getinfo(xc_handle, domid, 1, &info);
    1.10 -    if ((info.nr_pages - nr_pages) <= 0) {
    1.11 -        fprintf(stderr, "unset_mm_mapping: error nr_pages\n");
    1.12 -        err = -1;
    1.13 -    }
    1.14  
    1.15      err = xc_domain_memory_decrease_reservation(xc_handle, domid,
    1.16                                                  nr_pages, 0, extent_start);
    1.17      if (err)
    1.18          fprintf(stderr, "Failed to decrease physmap\n");
    1.19  
    1.20 -
    1.21 -    if (xc_domain_setmaxmem(xc_handle, domid, (info.nr_pages - nr_pages) *
    1.22 -                            PAGE_SIZE/1024) != 0) {
    1.23 -        fprintf(logfile, "set maxmem returned error %d\n", errno);
    1.24 -        err = -1;
    1.25 -    }
    1.26 -
    1.27      return err;
    1.28  }
    1.29  
    1.30 @@ -7045,17 +7031,8 @@ int set_mm_mapping(int xc_handle, uint32
    1.31                     unsigned long nr_pages, unsigned int address_bits,
    1.32                     xen_pfn_t *extent_start)
    1.33  {
    1.34 -    xc_dominfo_t info;
    1.35      int err = 0;
    1.36  
    1.37 -    xc_domain_getinfo(xc_handle, domid, 1, &info);
    1.38 -
    1.39 -    if (xc_domain_setmaxmem(xc_handle, domid, info.max_memkb +
    1.40 -                            nr_pages * PAGE_SIZE/1024) != 0) {
    1.41 -        fprintf(logfile, "set maxmem returned error %d\n", errno);
    1.42 -        return -1;
    1.43 -    }
    1.44 -
    1.45      err = xc_domain_memory_populate_physmap(xc_handle, domid, nr_pages, 0,
    1.46                                              address_bits, extent_start);
    1.47      if (err) {