WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 5 of 7] [XIU]: When destroying a domain in the simulato

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 5 of 7] [XIU]: When destroying a domain in the simulator, give its memory back to xen
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Fri, 27 Nov 2009 22:47:30 +0000
Delivery-date: Fri, 27 Nov 2009 14:47:09 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1259362045@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1259361890 0
# Node ID 017686f2d3b2f906b094a07fbd32926ef6b832ad
# Parent  099e85cfc1fee37b949f20ae56ff85125380a956
[XIU]: When destroying a domain in the simulator, give its memory back to xen.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 099e85cfc1fe -r 017686f2d3b2 ocaml/xiu/xiu.ml
--- a/ocaml/xiu/xiu.ml  Fri Nov 27 22:44:49 2009 +0000
+++ b/ocaml/xiu/xiu.ml  Fri Nov 27 22:44:50 2009 +0000
@@ -517,7 +517,9 @@
        newdom
 
 let domain_destroy domid =
-       ignore (domain_find domid); Hashtbl.remove domains domid
+  let d = domain_find domid in
+  transfer_to_domain d (-d.tot_mem_kib);
+  Hashtbl.remove domains domid
 
 let domain_sethandle domid uuid =
        let dom = domain_find domid in dom.uuid <- uuid; ()
1 file changed, 3 insertions(+), 1 deletion(-)
ocaml/xiu/xiu.ml |    4 +++-


Attachment: xen-api.hg-7.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api