From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: [PATCH] Cleanup empy domain if memory reservation fails Date: Tue, 26 Jul 2005 10:52:52 -0500 Message-ID: <42E65C54.7020601@us.ibm.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010405030608070104030608" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------010405030608070104030608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Attached patch removes the empty domain if xc.memory_increase_reservation fails. Regards, Anthony Liguori Signed-off-by: Anthony Liguori --------------010405030608070104030608 Content-Type: text/x-patch; name="bug113.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bug113.diff" diff -r 70c3ba5276c0 tools/python/xen/xend/image.py --- a/tools/python/xen/xend/image.py Tue Jul 26 13:57:56 2005 +++ b/tools/python/xen/xend/image.py Tue Jul 26 10:50:47 2005 @@ -130,7 +130,13 @@ # xc.domain_setuuid(dom, uuid) xc.domain_setcpuweight(dom, cpu_weight) xc.domain_setmaxmem(dom, mem_kb) - xc.domain_memory_increase_reservation(dom, mem_kb) + + try: + xc.domain_memory_increase_reservation(dom, mem_kb) + except: + xc.domain_destroy(dom) + raise + if cpu != -1: xc.domain_pincpu(dom, 0, 1<