From: Jonathan Knowles Date: Thu, 28 Oct 2010 15:48:27 +0000 (+0100) Subject: [CA-43341] Amends squeezed so that just after transferring a reservation to a domain... X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=93874478215d4a13f4280684cb17a7f8e3024c22;p=xcp%2Fxen-api.git [CA-43341] Amends squeezed so that just after transferring a reservation to a domain, it calls Xc.domain_setmaxmem with . This fix prevents the subsequent domain build from failing due to an artificially low maxmem. Signed-off-by: Jonathan Knowles Acked-by: Jonathan Ludlam Acked-by: Dave Scott --- diff --git a/ocaml/xenops/squeeze_xen.ml b/ocaml/xenops/squeeze_xen.ml index aea8be25..62a99222 100644 --- a/ocaml/xenops/squeeze_xen.ml +++ b/ocaml/xenops/squeeze_xen.ml @@ -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 *) diff --git a/ocaml/xenops/squeezed.ml b/ocaml/xenops/squeezed.ml index 2c2e5306..80092cfe 100644 --- a/ocaml/xenops/squeezed.ml +++ b/ocaml/xenops/squeezed.ml @@ -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; [] )