Skip to contentSkip to conversation

Cleanup empy domain if memory reservation fails

PATCH New Anthony Liguori 1 participant 1 message Jul 26, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Cleanup empy domain if memory reservation fails

Attached patch removes the empty domain if xc.memory_increase_reservation fails.

Regards,

Anthony Liguori

tools/python/xen/xend/image.py +7 -1
diff -r 70c3ba5276c0 tools/python/xen/xend/image.py
@@ -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<<int(cpu))
         return dom

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel