]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
[CA-43341] Amends squeezed so that just after transferring a reservation to a domain...
authorJonathan Knowles <jonathan.knowles@eu.citrix.com>
Thu, 28 Oct 2010 15:48:27 +0000 (16:48 +0100)
committerJonathan Knowles <jonathan.knowles@eu.citrix.com>
Thu, 28 Oct 2010 15:48:27 +0000 (16:48 +0100)
This fix prevents the subsequent domain build from failing due to an artificially low maxmem.

Signed-off-by: Jonathan Knowles <jonathan.knowles@eu.citrix.com>
Acked-by: Jonathan Ludlam <jonathan.ludlam@eu.citrix.com>
Acked-by: Dave Scott <dave.scott@eu.citrix.com>
ocaml/xenops/squeeze_xen.ml
ocaml/xenops/squeezed.ml

index aea8be25c3427a3ccf26b63e555c2706c20abecf..62a992223810017ced6b708b35224e4bc71c73cf 100644 (file)
@@ -74,12 +74,12 @@ module Domain = struct
   let set_maxmem_noexn (xc, xs) domid m = 
        let per_domain = get_per_domain (xc, xs) domid in
        if per_domain.maxmem <> m then begin
-      debug "Xc.domain_setmaxmem domid=%d max=%Ld" domid m;      
+               debug "Xc.domain_setmaxmem domid=%d max=%Ld (was=%Ld)" domid m per_domain.maxmem;
          try
                Xc.domain_setmaxmem xc domid m;
                per_domain.maxmem <- m
          with e ->
-               error "Xc.domain_setmaxmem domid=%d max=%Ld: %s" domid m (Printexc.to_string e)
+                 error "Xc.domain_setmaxmem domid=%d max=%Ld: (was=%Ld) %s" domid m per_domain.maxmem (Printexc.to_string e)
        end
 
   (** Read a particular domain's key, using the cache *)
index 2c2e53065a0b99e68bd8c6cd21a11a5998c20e3b..80092cfe6c23deee305fd967a5a32fb9ede0cfe6 100644 (file)
@@ -157,6 +157,9 @@ let transfer_reservation_to_domain args =
                let kib = xs.Xs.read (reservation_path _service session_id reservation_id) in
                (* This code is single-threaded, no need to make this transactional: *)
                xs.Xs.write (xs.Xs.getdomainpath domid ^ "/memory/initial-reservation") kib;
+                                                       maybe
+                                                               (fun maxmem -> Squeeze_xen.Domain.set_maxmem_noexn (xc, xs) domid maxmem)
+                                                               (try Some (Int64.of_string kib) with _ -> None);
                del_reservation xs _service session_id reservation_id;
                []
             )