]> xenbits.xensource.com Git - xen.git/commitdiff
ioemu: drop duplicate memory reservation
authorKeir Fraser <keir.fraser@citrix.com>
Sat, 5 Apr 2008 21:21:42 +0000 (22:21 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Sat, 5 Apr 2008 21:21:42 +0000 (22:21 +0100)
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
tools/ioemu/vl.c

index 94ebb0e61a7eeea3755bcc08dd60d1c7c84b34b3..6b708c2d29e563471b738c484611d3fdf4c17d57 100644 (file)
@@ -7018,26 +7018,12 @@ int unset_mm_mapping(int xc_handle, uint32_t domid,
                      xen_pfn_t *extent_start)
 {
     int err = 0;
-    xc_dominfo_t info;
-
-    xc_domain_getinfo(xc_handle, domid, 1, &info);
-    if ((info.nr_pages - nr_pages) <= 0) {
-        fprintf(stderr, "unset_mm_mapping: error nr_pages\n");
-        err = -1;
-    }
 
     err = xc_domain_memory_decrease_reservation(xc_handle, domid,
                                                 nr_pages, 0, extent_start);
     if (err)
         fprintf(stderr, "Failed to decrease physmap\n");
 
-
-    if (xc_domain_setmaxmem(xc_handle, domid, (info.nr_pages - nr_pages) *
-                            PAGE_SIZE/1024) != 0) {
-        fprintf(logfile, "set maxmem returned error %d\n", errno);
-        err = -1;
-    }
-
     return err;
 }
 
@@ -7045,17 +7031,8 @@ int set_mm_mapping(int xc_handle, uint32_t domid,
                    unsigned long nr_pages, unsigned int address_bits,
                    xen_pfn_t *extent_start)
 {
-    xc_dominfo_t info;
     int err = 0;
 
-    xc_domain_getinfo(xc_handle, domid, 1, &info);
-
-    if (xc_domain_setmaxmem(xc_handle, domid, info.max_memkb +
-                            nr_pages * PAGE_SIZE/1024) != 0) {
-        fprintf(logfile, "set maxmem returned error %d\n", errno);
-        return -1;
-    }
-
     err = xc_domain_memory_populate_physmap(xc_handle, domid, nr_pages, 0,
                                             address_bits, extent_start);
     if (err) {