]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
[CA-46591] Prevents build_pre from overwriting xen_maxmem.
authorJonathan Knowles <jonathan.knowles@eu.citrix.com>
Wed, 26 Jan 2011 17:39:04 +0000 (17:39 +0000)
committerJonathan Knowles <jonathan.knowles@eu.citrix.com>
Wed, 26 Jan 2011 17:39:04 +0000 (17:39 +0000)
Signed-off-by: Jonathan Knowles <jonathan.knowles@eu.citrix.com>
Previously, during a VM.resume, both of the following functions would overwrite xen_maxmem:

  1. transfer_reservation_to_domain:
     xen_maxmex := reservation
  2. build_pre:
     xen_maxmem := static_max

However, only the first assignment was correct.

All domain creation operations trigger the transfer_reservation_to_domain function. Therefore it is safe to remove the second, faulty assignment.

ocaml/xenops/domain.ml

index 3c9b8c313e57a9fe7483b37b7019bce8b2ad74a0..fbc1c6d64ee0100ce2ccce763701a302e1262a56 100644 (file)
@@ -415,7 +415,6 @@ let build_pre ~xc ~xs ~vcpus ~xen_max_mib ~shadow_mib ~required_host_free_mib do
 
        Xc.domain_setvmxassist xc domid use_vmxassist;
        Xc.domain_max_vcpus xc domid vcpus;
-       Xc.domain_setmaxmem xc domid (Memory.kib_of_mib xen_max_mib);
        Xc.domain_set_memmap_limit xc domid (Memory.kib_of_mib xen_max_mib);
        Xc.shadow_allocation_set xc domid shadow_mib;
        create_channels ~xc domid